Add a payment mandate
Add SEPA Direct Debit B2B received payment mandates with the API. Note that when Swan receives new SEPA Direct Debit instructions, the corresponding mandate is added automatically.
Prerequisites
- You're an account member with the
canInitiatePaymentsmembership permission. - You're authenticating with a user access token.
Guide​
- Call the
addReceivedSepaDirectDebitB2bMandatemutation. - Add the Unique Mandate Reference (
mandateReference) and SEPA Creditor Identifier (creditorIdentifier). - Add the creditor's name, plus your Swan IBAN and consent redirect URL.
- Choose whether the mandate can be used once (
OneOff) or multiple times (Recurrent). - Add the
AddReceivedSepaDirectDebitB2bMandateSuccessPayload, including theconsentUrl. - Add rejections (not shown).
Mutation​
🔎 Open the mutation in API Explorer
mutation AddReceivedMandate {
addReceivedSepaDirectDebitB2bMandate(
input: {
mandateReference: "$YOUR_URM"
creditorIdentifier: "$YOUR_SCI"
creditorName: "Katherine Johnson"
iban: "$SWAN_IBAN"
sequence: OneOff
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on AddReceivedSepaDirectDebitB2bMandateSuccessPayload {
__typename
receivedDirectDebitMandate {
statusInfo {
status
... on ReceivedDirectDebitMandateStatusInfoConsentPending {
__typename
consent {
consentUrl
}
status
}
... on ReceivedDirectDebitMandateStatusInfoEnabled {
__typename
enabledAt
status
}
}
}
}
}
}
Payload​
The payload shows the mandate was added successfully with the status ConsentPending, and provides the consentUrl (line 10).
Make sure to send the consentUrl to your user so they can provide consent for the mandate.
{
"data": {
"addReceivedSepaDirectDebitB2bMandate": {
"__typename": "AddReceivedSepaDirectDebitB2bMandateSuccessPayload",
"receivedDirectDebitMandate": {
"statusInfo": {
"status": "ConsentPending",
"__typename": "ReceivedDirectDebitMandateStatusInfoConsentPending",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}
}
}