Set up recurring payments
Authorize a Trustly Direct Debit mandate and use the stored payment method for recurring charges.
When a customer completes a Trustly payment with recurring enabled, they authorize a Direct Debit Instruction with their bank. This mandate gives you permission to charge their bank account on an ongoing basis without redirecting them again.
Before you begin
To set up Trustly recurring payments:
- The mandate must be set up through a payment session.
- The customer's email address is required in
billing_details. Without it, the mandate cannot be created. - During the Trustly redirect, the customer authorizes a Direct Debit Instruction. This is a UK-regulated authorization that covers future charges.
Set up the initial payment
The first payment sets up the Direct Debit mandate and gives you a stored payment method for later charges.
- 1
Create a payment session with mandate
On your server, send a
POSTrequest to/v1/sessions/paymentwithsetup_future_usageset to"off_session". Include the customer's email inbilling_details. Amounts are in minor units, so2500is £25.00.{ "currency": "gbp", "amount": 2500, "customer_reference_id": "cust-001", "payment_method_types": ["trustly"], "setup_future_usage": "off_session", "return_url": "https://your-site.com/payment/complete", "billing_details": { "email": "customer@example.com", "name": "John Smith", "address": { "country": "GB" } } }{ "id": "ps_771387817447132160", "resource": "payment_session", "amount": 2500, "amount_human_readable": "25.00", "currency": "gbp", "status": "open", "client_secret": "eyJhbGciOiJIUzUxMiJ9...", "customer": "cust_771387817447132161", "customer_reference_id": "cust-001", "payment_method_types": ["trustly"], "setup_future_usage": "off_session", "billing_details": { "email": "customer@example.com", "name": "John Smith", "address": { "country": "GB" } }, "created": "2026-10-30T15:02:13.752Z", "test_mode": true }Pass the
client_secretto your frontend to initialize the SDK. - 2
Customer authorizes the Direct Debit
Use the SDK to render the checkout. When the customer selects Trustly, they are redirected to the Trustly payment page where they select their bank and authorize a Direct Debit Instruction. This authorization covers both the initial payment and future charges.
checkout.universal({ container: '#pay-com-checkout', })The customer selects their bank, logs in, and confirms the Direct Debit. After authorization, the customer is returned to your site, and the SDK fires
onSuccess(oronPendingif Trustly has not confirmed the payment yet, in which case wait for thecharge.succeededwebhook event). - 3
Store the payment method
onSuccessgives the charge intransactionand the stored method inpaymentMethod(pm_trustly_...). Store the payment method ID against the customer in your database. You will need this for future recurring charges.Retrieving the charge from your server is optional. Its
payment_methodis the same ID. Use the charge ID fromtransaction.curl -X GET "https://api.sandbox.pay.com/v1/charges/chrg_771388479263813632" \ -u ':sk-pay-com-sandbox-…'{ "id": "chrg_771388479263813632", "resource": "charge", "amount": 2500, "amount_human_readable": "25.00", "currency": "gbp", "status": "succeeded", "payment_method": "pm_trustly_771388487130677248", "payment_method_details": { "setup_future_usage": "off_session", "type": "trustly", "trustly": { "account_number": "4469581408", "bank": "Barclays", "bank_code": "BARC", "clearing_house": "UNITED_KINGDOM", "country": "GB", "descriptor": "**** *5803", "last4": "5803", "name": "John Smith" } }, "test_mode": true }
Create recurring charges
Once you have the pm_trustly_... ID, you can use it to charge
the customer without them being present. Trigger each charge using
the stored pm_trustly_... ID with "off_session": true. See the
recurring charges guide
for the full request format, response handling, and webhook events.
Subscriptions take card payment methods (pm_card_…) only, so you
can't attach a pm_trustly_... ID to a subscription.
Requirements
A Trustly mandate needs a payment session with setup_future_usage set to
"off_session" and the customer's email.
| Requirement | Details |
|---|---|
| Integration path | Payment session |
setup_future_usage | Must be "off_session". Set on the payment session, not in source_data. |
| Customer email | Required in billing_details.email. The mandate cannot be created without it. |
| Mandate type | UK Direct Debit Instruction. The customer authorizes this during the Trustly redirect. |