Schedule a Standing Order
Schedule a Standing Order to send money on a recurring basis using the SEPA network.
Prerequisites
- You're an account member with the
canInitiatePayments
membership permission. - You're authenticating with a user access token.
Schedule a fixed amount​
The example schedules a fixed monthly Standing Order.
- Call the
scheduleStandingOrder
mutation. - Add all required information, including
period
, account ID, your redirect URL, yourbeneficiary
, and whether or not the IBAN belongs to you (lines 4-14).- For
period
, choose Monthly. - Add the
amount
object with your fixedvalue
and itscurrency
. - Don't add the
targetAvailableBalance
object.
- For
- Add the consent URL to the success payload (line 29):
statusInfo
>StandingOrderConsentPendingStatusInfo
>consent
>consentUrl
. - 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.
- Call the
scheduleStandingOrder
mutation. - Add all required information, including
period
, account ID, amount withcurrency
andvalue
, your redirect URL, yourbeneficiary
, and whether or not the IBAN belongs to you (lines 4-14).- For
period
, choose Daily. - Add the
targetAvailableBalance
object with your target balancevalue
and itscurrency
. - Don't add the
amount
object.
- For
- Add the consent URL to the success payload (line 29):
statusInfo
>StandingOrderConsentPendingStatusInfo
>consent
>consentUrl
. - Add your
targetAvailableBalance
information to the payload (lines 33-35) - 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"
}
}
}
}
}