Recurring payments
Save a card with a first payment, then charge it later without the shopper present.
Recurring payments let you charge a shopper's saved card for payments they have agreed to, such as subscriptions or standing orders. Today recurring payments work with cards only.
There are two kinds of recurring payments:
| Kind | The shopper is | Example |
|---|---|---|
| Customer-initiated (CIT) | Present in the session | The first payment, where the shopper agrees |
| Merchant-initiated (MIT) | Not present | The monthly subscription charge |
How it works
sequenceDiagram
autonumber
participant S as Shopper
participant M as Your server
participant A as Aera
M->>A: Create recurring payment session (recurringInfo)
A-->>M: pspReference, paymentSessionUrl
M-->>S: Redirect to paymentSessionUrl
Note over S,A: Shopper agrees and pays the first payment (or 0)
M->>A: Get payment status
A-->>M: recurringReference
Note over M: Save the recurringReference
M->>A: Authorize recurring payment (recurringReference)
A-->>M: New pspReference for this payment
Step 1: Set up the agreement with a first payment
Call Create recurring payment session. The shopper completes the first payment on the hosted or embedded checkout, and the card is saved for the later payments.
The first payment can be the first term, or zero (0) if you only want the shopper's approval now.
Example Create recurring payment session request
{
"merchantData": {
"successRedirectUrl": "https://shop.example.com/success",
"cancelRedirectUrl": "https://shop.example.com/cancel",
"errorRedirectUrl": "https://shop.example.com/error"
},
"transactionData": {
"merchantReference": "sub-12344333",
"immediateCapture": true,
"amountDetails": { "amount": 20000, "currency": "NOK" }
},
"paymentInstrumentsProfileData": {
"merchantShopperId": "LOYAL-70018882"
},
"recurringInfo": {
"recurringModel": "SCHEDULED",
"recurringFrequency": 28,
"recurringDescription": "Gym membership"
}
}This sets up a monthly subscription with a variable amount. The first payment is NOK 200, but that amount isn't tied to the later payments.
The agreement (recurringInfo)
recurringInfo)| Field | Required | Description |
|---|---|---|
recurringModel | Yes | SCHEDULED: payments at a fixed interval, such as subscriptions and standing orders. The amount can vary. UNSCHEDULED: payments at varying times and amounts. |
recurringFrequency | For SCHEDULED | The minimum number of days between two payments. For monthly payments, use 28. |
recurringExpiry | No | The last date for a recurring payment, as YYYY-MM-DD. Leave out for no end date. |
recurringDescription | Yes | A short description of the agreement, up to 25 characters. |
For recurring sessions, only CARD is available. You don't need paymentMethodInfo unless you want to limit the card schemes.
Step 2: Get the recurring reference
After the first payment, call Get payment status with the pspReference. Save the recurringReference from the authorisation details. You need it for every later payment.
All operations on the first payment, such as capture, cancel, refund, update and status, use its pspReference as usual.
Step 3: Charge the later payments
Call Authorize recurring payment with the recurringReference. No checkout page is shown, because the shopper isn't present.
Example Authorize recurring payment request
{
"transactionData": {
"merchantReference": "sub-12344333-2026-11",
"recurringReference": "0192a7c4-6b2e-7f10-9a3d-5c6e7f8a9b0c",
"immediateCapture": true,
"amountDetails": { "amount": 19900, "currency": "NOK" }
}
}Each recurring payment gets its own new pspReference. Use it to capture (if immediateCapture is false), cancel, refund or check the payment.
Your responsibility
- Charge only payments the shopper agreed to in your terms and conditions.
- Keep each payment within the agreed amount limits and frequency. For
SCHEDULED, wait at leastrecurringFrequencydays between payments, and never charge afterrecurringExpiry. - For merchant-initiated payments, the shopper can ask for a chargeback, and you are liable in a dispute.
Good to know
- A card saved for recurring payments and also for convenience has two
paymentInstrumentReferencevalues. Deleting one doesn't delete the other. See Save cards.
Updated 4 days ago