Subscription API

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.

  1. Create a subscription with POST /v2/subscriptions. A mandate is created with it, and
    the response contains a link.
  2. 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.
  3. The mandate and the subscription become active. You receive a callback with the type
    mandate.
  4. Charge the customer with POST /v2/subscriptions/{subscription}/payments whenever 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 amount and currency unless 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

StateMeaning
pendingNo mandate is active yet, so the subscription cannot be charged.
activeAt least one mandate is active, and you can create payments.
canceledThe 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

StateMeaning
pendingWaiting for the customer to approve it through the link.
activeApproved. It can be used for payments.
revokedRevoked. It can no longer be used.
expiredThe 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.