Recurring Payments
Setup and use Mandates to charge users multiple times
Create a Mandate for Recurring Payments with PIS
You can embed setting up a Mandate to be used for recurring charges within a one-off payment flow. This simplifies the process in your system, as it removes the need to build extra confirmation screens or integrate new Ivy endpoints.
At a high level, the flow is the following:
-
Checkout Creation: Add a
mandate
object to your Checkout Create request, set the fieldsetup
totrue
, pass areferenceId
for the Mandate to associate the respectivemandate_setup_succeeded
andmandate_setup_failed
webhook events with your initial request later on. Additionally, you need to pass auserNotificationEmail
to the Mandate object which is displayed during the Checkout when requesting to setup a Mandate (you need to notify the user about the respective events using this email address as well). -
You can pass an optional object
additionalDisplayInformation
to show a cadence and amount for the Mandate to your customers.- Keep in mind that both the object is optional, and either of price and cadence. However, if you provide an amount, you also have to provide the currency.
- Cadence can be any of the following:
BI_WEEKLY, WEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUAL, ANNUAL, ON_DEMAND
- See how showing these values looks in the Checkout in the screenshots below.
-
Proceed the same way as you would for a usual payment flow with Checkout Sessions and send your user to Ivy’s hosted Checkout flow.
Example Payload -
Within the payment flow, users confirm to set up a Mandate on the Ivy screens.
-
Following a successful payment authorization that starts with the
CheckoutSession
, anOrder
will be created. Alongside thisOrder
, a Mandate will be set up separately and without blocking the payment authorization process.
Authorization Screen for a Mandate with a 1.00€ payment immediately and 9.99€ Monthly
Handling Mandate Related Webhook Events
We emit several Mandate-related webhook events while setting up and finalizing a Mandate. To get notified via changes to your Mandate, you should subscribe to these via a webhook.
Currently, we emit the following events:
mandate_setup_started
mandate_setup_succeeded
mandate_setup_failed
mandate_revoked
Mandate Setup Started
When initiating a Checkout Create with a Mandate as described above, we will notify you when the Mandate setup has started. You can receive the mandate_setup_started
event to confirm that starting the Mandate setup was successful. You will get notified later once the Mandate has been finalized via the mandate_setup_succeeded
or the mandate_setup_failed
event.
Successful Mandate Setup
Following a successful Mandate setup, you will receive the mandate_setup_succeeded
webhook event. This allows you to retrieve and store the Mandate’s id
which can be used to initiate charges afterwards. This webhook event contains all relevant Mandate data that can be used to inform the user about the issuance and usage of the Mandate as required by the SEPA regulation.
Failed Mandate Setup
When a Mandate setup fails, you can get notified using the mandate_setup_failed
webhook event. This provides more insights into why the Mandate setup failed.
Mandate Revocation
When a charge is reversed by a customer or we detect that it’s no longer valid for any other reason, we inform you about the Mandate being revoked. In this case, this Mandate can’t be used any longer to create a charge. A new Mandate needs to be set up if you want to create further charges for the respective customer.