Skip to main content

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
  1. You're an account member with the canInitiatePayments membership permission.
  2. You're authenticating with a user access token.

Guide​

  1. Call the addReceivedSepaDirectDebitB2bMandate mutation.
  2. Add the Unique Mandate Reference (mandateReference) and SEPA Creditor Identifier (creditorIdentifier).
  3. Add the creditor's name, plus your Swan IBAN and consent redirect URL.
  4. Choose whether the mandate can be used once (OneOff) or multiple times (Recurrent).
  5. Add the AddReceivedSepaDirectDebitB2bMandateSuccessPayload, including the consentUrl.
  6. 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"
}
}
}
}
}
}