Audience:
Developers
Initiate a funding request
Initiate a funding request with the API to pull funds from an enabled funding source into a Swan account.
Prerequisites
- The payment mandate from the Swan account holder or eligible account member who is funding their account is
Enabled. - Call the mutation with a user access token associated with the account holder or eligible account member with the
canInitiatePaymentspermission.
The funding source status can be Enabled even if the account verification status is PendingVerification; the interaction between statuses explains how the two relate.
Guide
- Call the
initiateFundingRequestmutation. - Add an
idempotencyKeyto prevent duplicate funding requests (line 4). Refer to the idempotency guide for more information. - Add your
fundingSourceId(line 5) andconsentRedirectUrl(line 6). - Add the
amountto send the account, and itscurrency(line 7). - Optionally, add a
label,reference, and any other information you'd like. - Add the
InitiateFundingRequestSuccessPayloadsuccess payload (line 10). - Add rejections that are helpful for you (not all shown).
Consent
No consent is required to initiate the funding request. Consent is given through the payment mandate.
Mutation
Open in API Explorermutation 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"
}
}
}
}
}