Declare a payment mandate for Internal Direct Debit
Before accepting payments with Internal Direct Debit B2B or Standard, you need to declare a payment mandate to your Swan account. Each debtor must have their own payment mandate.
Review the requirements for Internal Direct Debit payment mandates if needed.
- Debtor's account status: any except
ClosingorClosed - Merchant profile status:
Enabled - Internal Direct Debit B2B payment method status:
Enabled - Debtor and merchant have accounts in the same Swan projects
- [B2B only] Debtor's account type:
Company
Declare a payment mandate​
- Confirm you have a project access token or, if you're an account member, a user access token with
CanManageAccountMembershippermissions, and confirm the prerequisites are met. - Call the
addInternalDirectDebitPaymentMandatemutation. - Replace
$YOUR_DEBTOR_ACCOUNT_IDand$YOUR_PAYMENT_METHOD_IDwith IDs from your project (lines 4, 5). - Choose either Standard or B2B in your mandate name (line 6).
- Choose
RecurrentorOneOff.OneOffpayment mandates can only be used once.
- Add validations and rejections that are helpful for you, as well as optional information such as a
referencefor your internal use. - The payment mandate is created with the status
Enabled.
For Standard, merchants can start using the payment method to accept payments immediately.
For B2B, you must add the received mandate first, as the debtor is required to consent.
Mutation​
Open in API Explorermutation AddPaymentMandate {
addInternalDirectDebitPaymentMandate(
input: {
paymentMethodId: "$YOUR_PAYMENT_METHOD_ID"
debtorAccountId: "$YOUR_DEBTOR_ACCOUNT_ID"
name: "Standard/B2B Internal Direct Debit Mandate"
sequence: Recurrent
}
) {
... on InternalErrorRejection {
__typename
message
}
... on PaymentMandateReferenceAlreadyUsedRejection {
__typename
message
}
... on SchemeWrongRejection {
__typename
message
}
... on DebtorAccountClosedRejection {
__typename
message
}
... on DebtorAccountNotAllowedRejection {
__typename
message
}
... on NotFoundRejection {
id
message
}
... on ForbiddenRejection {
__typename
message
}
... on AddInternalDirectDebitPaymentMandateSuccessPayload {
__typename
paymentMandate {
id
}
}
}
}
Payload​
Note the id (line 6) for your Internal Direct Debit payment mandate.
{
"data": {
"addInternalDirectDebitPaymentMandate": {
"__typename": "AddInternalDirectDebitPaymentMandateSuccessPayload",
"paymentMandate": {
"id": "$YOUR_MANDATE_ID"
}
}
}
}
B2B only: Add received mandate​
For Internal Direct Debit B2B only, call the addReceivedInternalDirectDebitB2bMandate mutation to declare the received payment mandate.
- Only account members with the permission
canInitiatePaymentscan declare mandates. - Make sure to execute the mutation on the debtor's account.
Mutation​
- Add the
idrecovered in the previous payload. - Add your
consentUrl. - Call the
addReceivedInternalDirectDebitB2bMandatemutation.
mutation AddReceivedInternalDirectDebitB2bMandate {
addReceivedInternalDirectDebitB2bMandate(
input: {
paymentMandateId: "$YOUR_MANDATE_ID"
consentRedirectUrl: "$YOUR_CONSENT_URL"
}
) {
... on AddReceivedInternalDirectDebitB2bMandateSuccessPayload {
__typename
receivedDirectDebitMandate {
id
statusInfo {
... on ReceivedDirectDebitMandateStatusInfoConsentPending {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
Payload​
Note the id for the received mandate (line 6), and its status (line 8.)
{
"data": {
"addReceivedInternalDirectDebitB2bMandate": {
"__typename": "AddReceivedInternalDirectDebitB2bMandateSuccessPayload",
"receivedDirectDebitMandate": {
"id": "$RECIEVED_MANDATE_ID",
"statusInfo": {
"__typename": "ReceivedDirectDebitMandateStatusInfoConsentPending",
"consent": {
"consentUrl": "$YOUR_CONSENT_URL"
}
}
}
}
}
}