Skip to main content

Schedule a Standing Order

Schedule a Standing Order to send money on a recurring basis using the SEPA network.

Prerequisites
  1. You're an account member with the canInitiatePayments membership permission.
  2. You're authenticating with a user access token.

Schedule a fixed amount​

The example schedules a fixed monthly Standing Order.

  1. Call the scheduleStandingOrder mutation.
  2. Add all required information, including period, account ID, your redirect URL, your beneficiary, and whether or not the IBAN belongs to you (lines 4-14).
    • For period, choose Monthly.
    • Add the amount object with your fixed value and its currency.
    • Don't add the targetAvailableBalance object.
  3. Add the consent URL to the success payload (line 29): statusInfo > StandingOrderConsentPendingStatusInfo > consent > consentUrl.
  4. Add rejections (not shown).

Mutation​

🔎 Open the mutation in API Explorer

mutation FixedMonthly {
scheduleStandingOrder(
input: {
period: Monthly
accountId: "$YOUR_ACCOUNT_ID"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
label: "Your custom label"
firstExecutionDate: "2024-09-21T"
lastExecutionDate: "2025-01-01T"
sepaBeneficiary: {
iban: "NL79RABO7114507283"
name: "Catharijne Janssen"
isMyOwnIban: false
save: false
}
reference: "Your custom reference"
amount: { value: "100", currency: "EUR" }
}
) {
... on ScheduleStandingOrderSuccessPayload {
__typename
standingOrder {
statusInfo {
status
... on StandingOrderConsentPendingStatusInfo {
__typename
consent {
consentUrl
}
}
}
id
}
}
}
}

Payload​

The payload shows the Standing Order created with the status ConsentPending (line 7), and provides the consentUrl (line 10).

{
"data": {
"scheduleStandingOrder": {
"__typename": "ScheduleStandingOrderSuccessPayload",
"standingOrder": {
"statusInfo": {
"status": "ConsentPending",
"__typename": "StandingOrderConsentPendingStatusInfo",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
},
"id": "$YOUR_STANDING_ORDER_ID"
}
}
}
}

Schedule a target balance​

The example schedules a daily target balance Standing Order.

  1. Call the scheduleStandingOrder mutation.
  2. Add all required information, including period, account ID, amount with currency and value, your redirect URL, your beneficiary, and whether or not the IBAN belongs to you (lines 4-14).
    • For period, choose Daily.
    • Add the targetAvailableBalance object with your target balance value and its currency.
    • Don't add the amount object.
  3. Add the consent URL to the success payload (line 29): statusInfo > StandingOrderConsentPendingStatusInfo > consent > consentUrl.
  4. Add your targetAvailableBalance information to the payload (lines 33-35)
  5. Add rejections (not shown).

Mutation​

🔎 Open the mutation in API Explorer

mutation TargetDaily {
scheduleStandingOrder(
input: {
period: Daily
accountId: "$YOUR_ACCOUNT_ID"
consentRedirectUrl: "$YOUR_REDIRECT_URL"
label: "Your custom label"
firstExecutionDate: "2024-09-21T"
lastExecutionDate: "2025-01-01T"
sepaBeneficiary: {
iban: "DE88500105171579833731"
name: "Rae Schmidt"
isMyOwnIban: false
save: false
}
reference: "Your custom reference"
targetAvailableBalance: { value: "100", currency: "EUR" }
}
) {
... on ScheduleStandingOrderSuccessPayload {
__typename
standingOrder {
statusInfo {
status
... on StandingOrderConsentPendingStatusInfo {
__typename
consent {
consentUrl
}
}
}
id
targetAvailableBalance {
currency
value
}
}
}
}
}

Payload​

The payload shows the Standing Order created with the status ConsentPending (line 7), and provides the consentUrl (line 10). Your targetAvailableBalance information is also provided (lines 14-16).

{
"data": {
"scheduleStandingOrder": {
"__typename": "ScheduleStandingOrderSuccessPayload",
"standingOrder": {
"statusInfo": {
"status": "ConsentPending",
"__typename": "StandingOrderConsentPendingStatusInfo",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
},
"id": "$YOUR_STANDING_ORDER_ID",
"targetAvailableBalance": {
"currency": "EUR",
"value": "100"
}
}
}
}
}