Mandate Reference API
POST/rest/create_mandate_reference
/rest/create_mandate_referenceThe Mandate Reference API is used to create SEPA mandate references before a payment is submitted. SEPA Direct Debit payments can either provide the mandate reference directly in the Payment API via sepa_mandate, or create it upfront with this endpoint.
This endpoint is used with SEPA Direct Debit for both schemes: dd (B2C) and dd_b2b (B2B).
The same endpoint also creates MB WAY mandates (payment_type: "mbway"), which work differently. See the section below.
Mandate Reference API Parameters
payment_typeStringrequireddd for the SEPA Direct Debit B2C scheme or dd_b2b for the SEPA Direct Debit B2B schemerecurringInteger1 for a recurring mandate. Omit for a one-time mandatefirst_nameStringlast_nameStringemailStringaddressStringaddress2StringcityStringpostal_codeStringstateStringcountryStringISO 3166-1 alpha-2phoneStringaccount_holderStringibanStringbicStringPOST /rest/create_mandate_reference
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"payment_type": "dd",
"recurring": 1,
"first_name": "Max",
"last_name": "Mustermann",
"account_holder": "Max Mustermann",
"iban": "DE89370400440532013000"
}
Mandate Reference API Response
transaction_idStringoriginal_transaction_idtokenStringsepa_mandatestatus_codeIntegerstatusStringerror_codeIntegerorder_idString{
"transaction_id": "c2a6bf6d-2dd7-4a9c-b4de-2d04347d802b",
"token": "a7678918bfbbfa449cf9ff78446b60a4",
"status_code": 9,
"status": "registered",
"error_code": 0,
"order_id": "123000"
}
Typical Flow
- Create a mandate reference with
POST /rest/create_mandate_reference. - Show the returned
token(mandate reference) to the customer as part of the SEPA mandate text. - Store the returned
transaction_id. - Create the actual SEPA payment with the Payment API.
- For recurring collections, use the stored
transaction_idasoriginal_transaction_id.
If you already have your own mandate reference, you can skip this endpoint and send it directly as sepa_mandate in the Payment API.
MB WAY mandates
With payment_type: "mbway", this endpoint creates an MB WAY mandate. The customer receives an approval request in the MB WAY app and sets a monthly amount limit and an expiry date there. After approval, you can charge the mandate with recurring payments that need no further approval.
The sections above describe SEPA mandate references and still apply to dd and dd_b2b unchanged. For mbway the differences are:
- The request must be authenticated with Basic authentication or a checksum. An unauthenticated request is rejected with HTTP
401. phoneis required: the mobile number linked to the customer's MB WAY account. Bank account parameters are not used.- The mandate is returned as
pending(2), notregistered(9). It becomesregisteredwhen the customer approves it, and you receive a postback. tokenis empty in the response. Use the returnedtransaction_idasoriginal_transaction_idwhen you charge the mandate.
payment_typeStringrequiredmbwayphoneStringrequired+4917143214321, 0049 171 43214321), or a Portuguese one without country code (912345678). It is converted to the MB WAY format <country code>#<number> automatically; numbers already in that format (34#612345678) are accepted too. Other values are rejected with error code 166first_nameStringlast_nameStringpostback_urlStringrequiredPOST /rest/create_mandate_reference
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"payment_type": "mbway",
"phone": "912345678",
"first_name": "Maria",
"last_name": "Silva",
"postback_url": "https://your-postback.url.com"
}
transaction_idStringoriginal_transaction_id for recurring chargesstatus_codeInteger2 (pending) until the customer approves the mandate, then 9 (registered)mbway_mandate_statusStringpending, active, suspended, expired or cancelledmbway_mandate_amount_limitStringmbway_mandate_expires_onStringYYYY-MM-DD) until which the mandate can be charged. Included once the mandate is approved{
"transaction_id": "1f7b2c4d-93a8-4b6e-a3f0-5d2e8c9b7a61",
"payment_type": "mbway",
"status_code": 2,
"status": "pending",
"message": "Waiting for the customer to approve the MB WAY mandate.",
"mbway_mandate_status": "pending",
"token": null,
"error_code": 0
}
Typical Flow (MB WAY)
- Create the mandate with
POST /rest/create_mandate_referenceandpayment_type: "mbway". - Store the returned
transaction_id. Tell the customer to approve the mandate in the MB WAY app. - Wait for the postback with
status_code9andmbway_mandate_statusactive. - Charge the mandate with the Payment API,
recurring: 1andoriginal_transaction_idset to the storedtransaction_id.
A charge is rejected with error code 162 (not an MB WAY mandate), 163 (not approved yet), 164 (suspended, cancelled or expired) or 165 (above the monthly limit). See MB WAY mandates for the full lifecycle.