Resume or enable a payment mandate
Resume or enable a SEPA Direct Debit received payment mandate with the API.
Use the enableReceivedDirectDebitMandate mutation to:
- Resume a
Suspendedmandate to its previous status (Enabledfor Core,ConsentPending, orEnabledfor B2B). - Initiate or re-initiate consent for a B2B mandate in
ConsentInitiationPendingstatus, moving it toConsentPending. This occurs when a mandate is automatically created from a received instruction, after an update requiring consent, or when consent was previously refused or expired.
ConsentInitiationPending status
The ConsentInitiationPending status indicates that a B2B mandate requires consent initiation.
When you call enableReceivedDirectDebitMandate, a consent request is created, and the status moves to ConsentPending.
If the debtor refuses or the consent expires, the mandate returns to ConsentInitiationPending, allowing them to retry without recreating the mandate.
Prerequisites
- You're an account member with the
canInitiatePaymentsmembership permission. - You're authenticating with a user access token.
Guide​
- Call the
enableReceivedDirectDebitMandatemutation. - Add the ID for the mandate you're resuming or enabling (line 4).
- If you're enabling or resuming a B2B mandate, add your consent redirect URL (line 5).
- Add the
EnableReceivedDirectDebitMandateSuccessPayload(line 8; include theconsentUrlfor B2B). - Add rejections (not shown).
Mutation​
Open in API Explorermutation ResumeMandate {
enableReceivedDirectDebitMandate(
input: {
receivedDirectDebitMandateId: "$YOUR_MANDATE_ID"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on EnableReceivedDirectDebitMandateSuccessPayload {
__typename
receivedDirectDebitMandate {
statusInfo {
status
... on ReceivedDirectDebitMandateStatusInfoEnabled {
__typename
enabledAt
}
... on ReceivedDirectDebitMandateStatusInfoConsentPending {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
Payload​
The payload shows the mandate status returned to 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": {
"enableReceivedDirectDebitMandate": {
"__typename": "EnableReceivedDirectDebitMandateSuccessPayload",
"receivedDirectDebitMandate": {
"statusInfo": {
"status": "ConsentPending",
"__typename": "ReceivedDirectDebitMandateStatusInfoConsentPending",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}
}
}