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
- You're an account member with the
canInitiatePayments
membership permission. - You're authenticating with a user access token.
Guide​
- Call the
updateReceivedSepaDirectDebitB2bMandate
mutation. - Add the ID for the mandate you're updating.
- Add the information you'd like to update. This example shows an updated
mandateReference
. - Add your consent redirect URL (consent is required to update the mandate).
- If you add the
version
(line 22), you'll see an increase in the payload, meaning the mandate was updated successfully. - Add the
UpdateReceivedSepaDirectDebitB2bMandateSuccessPayload
, including theconsentUrl
. - 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"
}
}
}
}