Skip to main content

Initiate a funding request

Initiate a funding request with the API.

Prerequisites
  1. The payment mandate from the Swan account holder or eligible account member who is funding their account is Enabled.
  2. Call the mutation with a user access token associated with the account holder or eligible account member with the canInitiatePayments permission.

Please note that the funding source status can be Enabled even if the account verification status is PendingVerification. Review the interaction between statuses for more information.

Guide​

  1. Call the initiateFundingRequest mutation.
  2. Add an idempotencyKey to prevent duplicate funding requests (line 4). Refer to the idempotency guide for more information.
  3. Add your fundingSourceId (line 5) and consentRedirectUrl (line 6).
  4. Add the amount to send the account, and its currency (line 7).
  5. Optionally, add a label, reference, and any other information you'd like.
  6. Add the InitiateFundingRequestSuccessPayload success payload (line 10).
  7. Add rejections that are helpful for you (not all shown).
Consent

No consent is required to initiate the funding request. Consent is provided through the payment mandate.

Mutation​

Open in API Explorer
mutation InitiateRequest {
initiateFundingRequest(
input: {
idempotencyKey: "$YOUR_IDEMPOTENCY_KEY"
fundingSourceId: "$YOUR_FUNDING_SOURCE_ID"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
amount: { value: "100", currency: "EUR" }
}
) {
... on InitiateFundingRequestSuccessPayload {
__typename
payment {
id
statusInfo {
status
... on PaymentInitiated {
__typename
status
}
}
}
}
... on IdempotencyConflictRejection {
__typename
message
}
}
}

Payload​

The payload shows the account funding payment status Initiated (line 8).

On your transaction history, you'll see a SEPA Direct Debit transaction with the status Upcoming.

{
"data": {
"initiateFundingRequest": {
"__typename": "InitiateFundingRequestSuccessPayload",
"payment": {
"id": "$TRANSACTION_ID",
"statusInfo": {
"status": "Initiated",
"__typename": "PaymentInitiated"
}
}
}
}
}