Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

Skip to main content

Add a SEPA Direct Debit B2B funding source

Add a SEPA Direct Debit B2B funding source with the API.

Prerequisites
  1. The user adding the funding source is either an account member with the canManageAccountMembership and canViewAccount permissions, or the account holder.
  2. The funding source is a non-Swan account that is accessible to the Swan account holder or eligible account member.
  3. Call the mutation with a user access token associated with the account holder or eligible account member. They need to sign the direct debit mandate by consenting to the sensitive operation of adding a funding source.

Step 1: Add the funding source​

  1. Call the addDirectDebitFundingSource mutation.
  2. Choose the SepaDirectDebitB2b scheme.
    • Though Core is an option in the API, it's not actually available for account funding.
  3. Add your accountId, iban, consentRedirectUrl, and a name for your funding source (name is primarily for your reference).
  4. Add the success payload: AddDirectDebitFundingSourceSuccessPayload.
  5. Add the consent URL to the success payload: fundingSource > DirectDebitFundingSource > paymentMandate > SEPAPaymentDirectDebitMandate > statusInfo > PaymentMandateConsentPendingStatusInfo > consent > consentUrl.
  6. Add rejections (not shown).
Open in API Explorer
mutation AddSddB2b {
addDirectDebitFundingSource(
input: {
scheme: SepaDirectDebitB2b
accountId: "$YOUR_ACCOUNT_ID"
iban: "$YOUR_IBAN"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
name: "Your funding source name"
}
) {
... on AddDirectDebitFundingSourceSuccessPayload {
__typename
fundingSource {
... on DirectDebitFundingSource {
id
name
paymentMandate {
... on SEPAPaymentDirectDebitMandate {
id
name
signatureDate
statusInfo {
... on PaymentMandateConsentPendingStatusInfo {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
}
}
}

  1. Send the consentUrl (line 14) to your Swan account member.
  2. Instruct them to consent to adding the funding source.

Note that you also receive a funding source ID (line 6) and a payment mandate ID (line 9).

{
"data": {
"addDirectDebitFundingSource": {
"__typename": "AddDirectDebitFundingSourceSuccessPayload",
"fundingSource": {
"id": "$YOUR_FUNDING_SOURCE_ID",
"name": "Your funding source name",
"paymentMandate": {
"id": "$YOUR_PAYMENT_MANDATE_ID",
"name": null,
"statusInfo": {
"__typename": "PaymentMandateConsentPendingStatusInfo",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$CONSENT_ID&env=Sandbox"
}
},
"mandateDocumentUrl": ""
}
}
}
}
}
Funding source and mandate Enabled

After the account holder consents to adding the funding source, the statuses for both the funding source and the direct debit mandate change to Enabled, and funds can be pulled into the Swan account.

However, the account holder still needs to declare their payment mandate to their external provider.

Step 3: Get the payment mandate​

Get the mandateDocumentUrl to download the payment mandate.

  1. Call the fundingSource query.
  2. Add the funding source ID (provided in the step 2 payload, line 6)
  3. Add the mandateDocumentUrl to the payload (line 10).
Open in API Explorer
query GetMandateUrl {
fundingSource(id: "$YOUR_FUNDING_SOURCE_ID") {
... on DirectDebitFundingSource {
id
name
paymentMandate {
... on SEPAPaymentDirectDebitMandate {
id
name
mandateDocumentUrl
}
}
}
}
}

Step 4: Declare the mandate to the external account provider​

The account holder must declare the payment mandate to the provider of their non-Swan account.

  1. Open the mandateDocumentUrl provided in the payload (line 9), which automatically triggers the download of the SEPA Direct Debit payment mandate PDF document.
  2. Provide the payment mandate document to the account holder.
  3. Instruct the account holder to declare the payment mandate to the provider of their non-Swan account.
{
"data": {
"fundingSource": {
"id": "$YOUR_FUNDING_SOURCE_ID",
"name": "Your funding source name",
"paymentMandate": {
"id": "$YOUR_PAYMENT_MANDATE_ID",
"name": "Your mandate name",
"mandateDocumentUrl": "https://mandate.swan.io/$YOUR_FUNDING_SOURCE_ID/SANDBOX/FR23ZZZ87D106/UkdSRjJCVUJSSkpXR05EVkY=.pdf?Expires=1734430612&Signature=$SIGNATURE"
}
}
}
}

Sample SEPA Direct Debit B2B payment mandate to provide to non-Swan account provider