Charge a customer again and again with subscriptions and mandates.
With subscriptions you can charge a customer on a recurring basis, for example every month,
without asking them to pay in the payment window each time.
How it works
A subscription has one or more mandates. A mandate is the customer's permission for you to
create payments on their behalf. In most cases one mandate per subscription is enough, but you
can add more if your use case needs it.
- Create a subscription with
POST /v2/subscriptions. A mandate is created with it, and
the response contains alink. - Send the customer to the
link. The customer approves the mandate by paying a small
verification amount of 1 unit of the currency, for example 1 DKK. The verification is never
captured. - The mandate and the subscription become
active. You receive a callback with the type
mandate. - Charge the customer with
POST /v2/subscriptions/{subscription}/paymentswhenever a
payment is due. The customer does not need to do anything.
Recurring payments
A payment created with POST /v2/subscriptions/{subscription}/payments:
- Is authorized right away, using the customer's approved card.
- Is captured automatically, unless you set
"autocapture": false. - Uses the subscription's
amountandcurrencyunless you set others. - Needs its own unique
order_id. - Uses the mandate you give in
mandate_id. If you leave it out, an active mandate on the
subscription is used.
The payment has the type recurring, and its callbacks are sent to the subscription's
callback_url. A subscription without an active mandate cannot be charged.
Subscription states
| State | Meaning |
|---|---|
pending | No mandate is active yet, so the subscription cannot be charged. |
active | At least one mandate is active, and you can create payments. |
canceled | The subscription is canceled and can no longer be used. |
Only an active subscription can be canceled. Canceling revokes all of its active mandates and
cannot be undone.
If you revoke the last active mandate, the subscription goes back to pending until a new
mandate is approved.
Mandate states
| State | Meaning |
|---|---|
pending | Waiting for the customer to approve it through the link. |
active | Approved. It can be used for payments. |
revoked | Revoked. It can no longer be used. |
expired | The card behind the mandate has expired. |
Adding a mandate
To add a mandate to an existing subscription, for example when the customer wants to use a new
card, call POST /v2/subscriptions/{subscription}/mandates. The response contains a link for
the customer to approve the new mandate, the same way as when the subscription was created.