Initiate a credit transfer
Send SEPA Credit Transfers, Instant SEPA Credit Transfers, and Swan Internal Credit Transfers with the API.
If you use Swan's Web Banking frontend, your users can send transfers from their account directly.
- You're an account member with the
canInitiatePaymentsmembership permission. - You're authenticating with a user access token.
Swan automatically includes Verification of Payee (VoP) in all single SEPA Credit Transfers. For an optimal user experience, consider integrating the verifyBeneficiary mutation.
Send a SEPA Credit Transfer​
Send a SEPA Credit Transfer to a beneficiary within the SEPA network.
- Call the
initiateCreditTransfersmutation. - Add all required information, marked by an (*) asterisk in API Explorer, including your Swan
accountId(line 6), and information such as your redirect URL and your transfer amount. - Add an
idempotencyKeyto prevent duplicate payments (line 4). - For this use case, add information about your
sepaBeneficiary, including their name and IBAN (lines 10-11). - For
mode, chooseRegularto send a basic SEPA Credit Transfer. - Add the
InitiateCreditTransfersSuccessPayloadpayload. - Add the consent URL to the success payload (line 28):
statusInfo>PaymentConsentPending>consent>consentUrl. - Add rejections (not shown).
mutation SepaDefault {
initiateCreditTransfers(
input: {
idempotencyKey: "$YOUR_IDEMPOTENCY_KEY"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
accountId: "$YOUR_ACCOUNT_ID"
creditTransfers: {
amount: { value: "100", currency: "EUR" }
sepaBeneficiary: {
iban: "IT23P0300203280632123553748"
name: "Francesca Verrilli"
isMyOwnIban: false
save: false
}
mode: Regular
}
}
) {
... on InitiateCreditTransfersSuccessPayload {
__typename
payment {
createdAt
id
statusInfo {
... on PaymentConsentPending {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
Add an invoice reference​
Send a SEPA Credit Transfer with an optional structured or unstructured invoice reference by using the labelType and label fields.
- Call the
initiateCreditTransfersmutation. - Add all required information, marked by an (*) asterisk in API Explorer, including any information such as your consent redirect URL (line 4), your Swan
accountId(line 5), and your transfer amount (line 7). - For this use case, add information about your
sepaBeneficiary, including their name and IBAN (lines 8-10). - Add
labelType, choose an option (lines 13-14), and add the reference value in thelabelinput. - Add the
InitiateCreditTransfersSuccessPayload(line 18). - Add the consent URL to the success payload (line 22):
statusInfo>PaymentConsentPending>consent>consentUrl. - Include error handling for all rejection types defined in the
initiateCreditTransfersPayloadunion (lines 31-55)
mutation initiateWithLabelType {
initiateCreditTransfers(
input: {
consentRedirectUrl: "$YOUR_REDIRECT_URL"
accountId: "$YOUR_ACCOUNT_ID"
creditTransfers: {
amount: { value: "100", currency: "EUR" }
sepaBeneficiary: {
iban: "IT23P0300203280632123553748"
name: "Francesca Verrilli"
save: false
}
labelType: OgmVcs
label: "000000000097"
}
}
) {
... on InitiateCreditTransfersSuccessPayload {
__typename
payment {
statusInfo {
... on PaymentConsentPending {
__typename
consent {
consentUrl
}
}
}
}
}
... on ValidationRejection {
__typename
fields {
code
message
path
}
message
}
... on BeneficiaryVerificationTokenAlreadyConsumedRejection {
__typename
message
beneficiaryVerificationTokens
}
... on InternalErrorRejection {
__typename
message
}
... on ForbiddenRejection {
__typename
message
}
... on AccountNotFoundRejection {
id
message
}
}
}
Send an Instant SEPA Credit Transfer​
Send an Instant SEPA Credit Transfer to a beneficiary within the SEPA network.
- Call the
initiateCreditTransfersmutation. - Add all required information, marked by an (*) asterisk in API Explorer, including your Swan
accountId(line 6), and information such as your redirect URL and your transfer amount. - Add an
idempotencyKeyto prevent duplicate payments (line 4). - For this use case, add information about your
sepaBeneficiary, including their name and IBAN (lines 10-11). - For
mode, chooseInstantWithFallback, which begins as an instant transfer but falls back to a regular transfer if instant isn't available. - Add the
InitiateCreditTransfersSuccessPayloadpayload. - Add the consent URL to the success payload (line 28):
statusInfo>PaymentConsentPending>consent>consentUrl. - Add rejections (not shown).
mutation SepaInstant {
initiateCreditTransfers(
input: {
idempotencyKey: "$YOUR_IDEMPOTENCY_KEY"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
accountId: "$YOUR_ACCOUNT_ID"
creditTransfers: {
amount: { value: "100", currency: "EUR" }
sepaBeneficiary: {
iban: "IT23P0300203280632123553748"
name: "Francesca Verrilli"
isMyOwnIban: false
save: false
}
mode: InstantWithFallback
}
}
) {
... on InitiateCreditTransfersSuccessPayload {
__typename
payment {
createdAt
id
statusInfo {
... on PaymentConsentPending {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
Send a Swan Internal Credit Transfer​
Send an internal credit transfer within Swan's network using the beneficiary's Swan account number.
- Call the
initiateCreditTransfersmutation. - Add all required information, marked by an (*) asterisk in API Explorer, including your Swan
accountId(line 6), and information such as your redirect URL and your transfer amount. - Add an
idempotencyKeyto prevent duplicate payments (line 4). - For this use case, add information about your
swanAccountBeneficiaryinstead of a SEPA beneficiary, including their name and Swan account number (lines 10-11). - Add the
InitiateCreditTransfersSuccessPayloadpayload. - Add the consent URL to the success payload (line 28):
statusInfo>PaymentConsentPending>consent>consentUrl. - Add rejections (not shown).
mutation SwanInternal {
initiateCreditTransfers(
input: {
idempotencyKey: "$YOUR_IDEMPOTENCY_KEY"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
accountId: "$YOUR_ACCOUNT_ID"
creditTransfers: {
amount: { value: "100", currency: "EUR" }
swanAccountBeneficiary: {
accountNumber: "$SWAN_ACCOUNT_NUMBER"
name: "Henri Dupont"
save: false
}
}
}
) {
... on InitiateCreditTransfersSuccessPayload {
__typename
payment {
createdAt
id
statusInfo {
status
... on PaymentConsentPending {
__typename
status
consent {
consentUrl
}
}
}
}
}
}
}
Send multiple credit transfers​
For bulk credit transfers requiring Verification of Payee (VoP), you must use verification tokens from the verifyBeneficiary mutation. Learn more about bulk credit transfers with VoP →
Send up to 2500 credit transfers in a single API call. You can send a mix of SEPA Credit Transfers, Instant SEPA Credit Transfers, and Swan Internal Credit Transfers in the same mutation.
- Call the
initiateCreditTransfersmutation. - Add all required information, marked by an (*) asterisk in API Explorer, including your Swan
accountId(line 6), and information such as your redirect URL. - Add an
idempotencyKeyto prevent duplicate payments (line 4). - Add a beneficiary block for each of your beneficiaries. The beneficiary block includes:
amount, meaning you can send a different amount to each beneficiary (in euros).sepaBeneficiaryorswanAccountBeneficiaryobject.mode(optional), meaning you can send instant and regular transfers with the same API call.- The example blocks (lines 9-16, 19-26, and 29-35) model different configurations.
- Add the
InitiateCreditTransfersSuccessPayloadpayload. - Add the consent URL to the success payload (line 49):
statusInfo>PaymentConsentPending>consent>consentUrl. - Add rejections (not shown).
mutation MultipleTransfers {
initiateCreditTransfers(
input: {
idempotencyKey: "$YOUR_IDEMPOTENCY_KEY"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
accountId: "$YOUR_ACCOUNT_ID"
creditTransfers: [
{
amount: { value: "200", currency: "EUR" }
sepaBeneficiary: {
iban: "IT23P0300203280632123553748"
name: "Francesca Verrilli"
isMyOwnIban: false
save: false
}
mode: InstantWithFallback
}
{
amount: { value: "100", currency: "EUR" }
sepaBeneficiary: {
iban: "GB61BARC20035368766178"
name: "Dillon Byrne"
isMyOwnIban: false
save: false
}
mode: Regular
}
{
amount: { value: "100", currency: "EUR" }
swanAccountBeneficiary: {
accountNumber: "21077522761"
name: "Henri Dupont"
save: false
}
mode: Regular
}
]
}
) {
... on InitiateCreditTransfersSuccessPayload {
__typename
payment {
createdAt
id
statusInfo {
... on PaymentConsentPending {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
Identify the initiating user​
User identification helps you maintain effective internal controls and traceability over payment operations.
Identify which user initiated a credit transfer by querying the payment before consent is granted, or by storing user details at the time of initiation.
Query the payment before consent is granted​
While a payment is in ConsentPending status, you can query the payment's statusInfo to access the consent object, which contains the userId and full user details for the user who must consent to the transfer.
Once the payment moves to Initiated or Rejected, the PaymentConsentPending fragment returns null and user information is no longer available through this method.
- Call the
paymentquery. - Add the payment ID.
- Include
statusInfowith thePaymentConsentPendingfragment to access consent details. - Add
userIdanduserfields to identify the initiating user (lines 9-14).
query GetPaymentInitiator {
payment(id: "$YOUR_PAYMENT_ID") {
id
createdAt
statusInfo {
status
... on PaymentConsentPending {
consent {
userId
user {
id
firstName
lastName
}
}
}
}
}
}
Store user information at initiation​
For reliable, long-term access to initiator information, store the user details at the time you initiate the transfer.
The initiateCreditTransfers mutation requires a user access token, which identifies the initiating user.
When you call the mutation successfully, store the user ID or account membership ID alongside the paymentId returned in the response.
This approach provides immediate access to user information without additional queries, and remains available regardless of the payment's consent status.
Payload​
The payload is similar for all the sample mutations on this page.
The payload shows that the credit transfer is created with the status ConsentPending (line 9), and provides the consentUrl (line 12).
Send the consentUrl to your user.
If you're sending multiple transfers, your user consents to all of them with a single consentUrl.
{
"data": {
"initiateCreditTransfers": {
"__typename": "InitiateCreditTransfersSuccessPayload",
"payment": {
"createdAt": "2024-01-25T16:16:09.859Z",
"id": "$YOUR_PAYMENT_ID",
"statusInfo": {
"status": "ConsentPending",
"__typename": "PaymentConsentPending",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}
}
}
If your transaction is created with the status Rejected, learn why in the rejectedReasonCode field.
For example, the rejection could be due to insufficient funds, or communication between Swan and the other bank timed out.