Skip to main content

Update a payment mandate

Update SEPA Direct Debit B2B received payment mandates with the API. Note that you can't update the sequence (OneOff or Recurrent).

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 updateReceivedSepaDirectDebitB2bMandate mutation.
  2. Add the ID for the mandate you're updating.
  3. Add the information you'd like to update. This example shows an updated mandateReference.
  4. Add your consent redirect URL (consent is required to update the mandate).
  5. If you add the version (line 22), you'll see an increase in the payload, meaning the mandate was updated successfully.
  6. Add the UpdateReceivedSepaDirectDebitB2bMandateSuccessPayload, including the consentUrl.
  7. Add rejections (not shown).

Mutation​

🔎 Open the mutation in API Explorer

mutation UpdateMandate {
updateReceivedSepaDirectDebitB2bMandate(
input: {
receivedDirectDebitMandateId: "$YOUR_MANDATE_ID"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
mandateReference: "UpdatedUniqueMandateReference"
}
) {
... on UpdateReceivedSepaDirectDebitB2bMandateSuccessPayload {
__typename
receivedDirectDebitMandate {
statusInfo {
status
... on ReceivedDirectDebitMandateStatusInfoConsentPending {
__typename
status
consent {
consentUrl
}
}
}
version
}
}
}
}

Payload​

The payload provides the consentUrl (line 10) and the status ConsentPending. Make sure to send the consentUrl to your user so they can provide consent for the update.

Notice the increased version (line 13).

{
"data": {
"updateReceivedSepaDirectDebitB2bMandate": {
"__typename": "UpdateReceivedSepaDirectDebitB2bMandateSuccessPayload",
"receivedDirectDebitMandate": {
"statusInfo": {
"status": "ConsentPending",
"__typename": "ReceivedDirectDebitMandateStatusInfoConsentPending",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
},
"version": "3"
}
}
}
}