Make transactions
Having branded accounts is great but you'll want them to serve their purpose, too! Users will want to be able to make payments and receive money. Here's how to make that happen.

Simulate a credit (SCT-IN)

Crediting an account in live environment is easy. You just need to use your account's IBAN and make a transfer from another bank. Once Swan receives the money we will instantly credit your account and the money will be available. The only type of transfer we currently accept is through the SEPA network.
In sandbox, the Event Simulator lets you credit an account using a fake IBAN: Event Simulator > SEPA Credit Transfers > Receive an incoming transfer. Select the desired amount and it will be instantly credited to the account of your choice.
A new payment associated with the account is created, along with one transactionwith SepaCreditTransferIn type. The payment is instantly available through the web banking interface or the API.
Event simulator for SEPA Credit Transfer

Get transactions

Connect to the web banking to see all transactions for a given account. The web banking displays SEPA transactions, card payments, and any other money credited or debited to the account.
The web banking displays all transactions for a given account
The query below lets you access the same information through the API. Just replace {{YOUR_ACCOUNT_ID}} with your account id.
Request
Response
1
query MyQuery {
2
account(accountId: "{{YOUR_ACCOUNT_ID}}") {
3
balances {
4
available {
5
currency
6
value
7
}
8
}
9
transactions {
10
edges {
11
node {
12
amount {
13
value
14
currency
15
}
16
id
17
type
18
label
19
createdAt
20
reference
21
side
22
statusInfo {
23
status
24
}
25
updatedAt
26
}
27
}
28
}
29
}
30
}
31
Copied!
1
{
2
"data": {
3
"account": {
4
"balances": {
5
"available": {
6
"currency": "EUR",
7
"value": "1000.00"
8
}
9
},
10
"transactions": {
11
"edges": [
12
{
13
"node": {
14
"amount": {
15
"value": "1000.00",
16
"currency": "EUR"
17
},
18
"id": "bosci_858cdd7f6a990a202f75029747e4cadd",
19
"type": "SepaCreditTransferIn",
20
"label": "Payment for invoice",
21
"createdAt": "2021-09-20T12:52:37.590Z",
22
"reference": "Invoice123",
23
"side": "Credit",
24
"statusInfo": {
25
"status": "Booked"
26
},
27
"updatedAt": "2021-09-20T12:52:38.913Z"
28
}
29
}
30
]
31
}
32
}
33
}
34
}
Copied!
You can also use the payment or transaction queries to get information regarding a specific transaction.

Initiate a debit

Both the web banking and API let you send money to another account. From the web banking, just fill out the form in the Payments tab.
Making a payment on the web banking
Making a payment is a sensitive operation. We always ask for the end-user to confirm the operation with a 2 factor authentication (2FA) process. At the end of the form, we create a consent for the user that they validate using their smartphone.
To make a payment via the API, use the initiateCreditTransfer mutation. The API lets you make one payment with multiple transaction to differents accounts at the same time. To call this mutation, you need to use a User Access Token. We will ask the user to consent to the payment . There is only one consent per payment, regardless of the number of transactions linked to the payment. Replace {{YOUR_ACCOUNT_NUMBER}} with the account number from which you want to initiate the payment and fill {{YOUR_REDIRECT_URL}}with the URL you want to redirect the user to.
Request
Reponse
1
mutation MyMutation {
2
initiateCreditTransfers(
3
input: {
4
creditTransfers: [{
5
amount: { value: "100", currency: "EUR" }
6
label: "First payments Label"
7
reference: "Reference 123"
8
sepaBeneficiary: {
9
iban: "FR4817569000304133391968B38"
10
name: "My creditor"
11
isMyOwnIban: false
12
save: false
13
},{
14
amount: { value: "53", currency: "EUR" }
15
label: "ACME payment"
16
reference: "PMNT#898753D3XZ"
17
sepaBeneficiary: {
18
iban: "FR1517569000709997845731H51"
19
name: "Payment"
20
isMyOwnIban: false
21
save: false
22
}]
23
}
24
consentRedirectUrl: "{{YOUR_REDIRECT_URL}}"
25
accountNumber: "{{YOUR_ACCOUNT_NUMBER}}"
26
}
27
) {
28
... on InitiateCreditTransfersSuccessPayload {
29
__typename
30
payment {
31
id
32
statusInfo {
33
status
34
... on PaymentConsentPending {
35
__typename
36
consent {
37
consentUrl
38
}
39
}
40
}
41
}
42
}
43
... on AccountNotFoundRejection {
44
id
45
message
46
}
47
... on ForbiddenRejection {
48
__typename
49
message
50
}
51
}
52
}
53
Copied!
1
{
2
"data": {
3
"initiateCreditTransfers": {
4
"__typename": "InitiateCreditTransfersSuccessPayload",
5
"payment": {
6
"id": "cto_a1e70fc4a95cbc32d2ad0ea31c0ee475",
7
"statusInfo": {
8
"status": "ConsentPending",
9
"__typename": "PaymentConsentPending",
10
"consent": {
11
"consentUrl": "https://identity.swan.io/consent?consentId=7a7ea958-0d42-4e7a-ac94-5074833e298d&env=Sandbox"
12
}
13
}
14
}
15
}
16
}
17
}
Copied!
If you execute this request you will have to open the consentUrl. Once the consent is done you'll find the payment and the two associated transactions in the API.

Refund a credit

If someone transferred money to one of your accounts by mistake, you can reimburse them by using the refund mutation. Just enter the amount you want to refund. This creates a new transaction linked to the same payment. It's possible to handle multiple transactions at once.
To refund a credit, replace {{YOUR_TRANSACTION_ID}} with the transaction ID you want to refund and {{YOUR_REDIRECT_URL}} with the URL you want to redirect the user to.
Request
Response
1
mutation MyMutation {
2
refund(
3
input: {
4
refundTransactions: [
5
{
6
originTransactionId: "{{YOUR_TRANSACTION_ID}}"
7
amount: { value: "10", currency: "EUR" }
8
}
9
]
10
consentRedirectUrl: "{{YOUR_REDIRECT_URL}}"
11
}
12
) {
13
... on RefundSuccessPayload {
14
__typename
15
consent {
16
id
17
consentUrl
18
}
19
}
20
... on RefundRejection {
21
__typename
22
code
23
message
24
}
25
}
26
}
27
Copied!
1
{
2
"data": {
3
"refund": {
4
"__typename": "RefundSuccessPayload",
5
"consent": {
6
"id": "6027e552-ea91-44f5-8545-cdb015f74ee9",
7
"consentUrl": "https://identity.swan.io/consent?consentId=6027e552-ea91-44f5-8545-cdb015f74ee9&env=Sandbox"
8
}
9
}
10
}
11
}
Copied!

Standing order

A standing order is a recurring payment that you configure just one time. Consent is only required during set up. After that, Swan automatically executes the payments on a regular basis, based on your configuration. There are two types of Standing Orders that behave differently.
To set up a recurring check to transfer all funds above a target amount (Swan will execute a transaction only when necessary), use targetAvailableBalance .
To set up a "classic" recurring payment with a fixed amount, use amount. Swan will make a recurring payment at the interval you set. If there is not enough money it will be refused for InsufficientFunds
To create a Standing Order use the scheduleStandingOrder mutation. Replace {{YOUR_ACCOUNT_ID}} and {{YOUR_REDIRECT_URL}} with the URL you want to redirect the user to.
Request : Fixed amount
Request : Target balance
1
mutation MyMutation {
2
scheduleStandingOrder(
3
input: {
4
period: Daily
5
accountId: "{{YOUR_ACCOUNT_ID}}"
6
consentRedirectUrl: "{{YOUR_REDIRECT_URL}}"
7
amount: { value: "10", currency: "EUR" }
8
label: "Recurring label"
9
firstExecutionDate: "2021-09-21T"
10
lastExecutionDate: "2022-01-01T"
11
sepaBeneficiary: {
12
iban: "NL15ABNA5172064443"
13
name: "ACME Company"
14
isMyOwnIban: false
15
save: false
16
}
17
reference: "Reference"
18
}
19
) {
20
... on ScheduleStandingOrderSuccessPayload {
21
__typename
22
standingOrder {
23
statusInfo {
24
status
25
... on StandingOrderConsentPendingStatusInfo {
26
__typename
27
consent {
28
consentUrl
29
}
30
}
31
}
32
id
33
}
34
}
35
... on ForbiddenRejection {
36
__typename
37
message
38
}
39
... on InternalErrorRejection {
40
__typename
41
message
42
}
43
... on InvalidArgumentRejection {
44
__typename
45
code
46
message
47
}
48
}
49
}
50
Copied!
1
mutation MyMutation {
2
scheduleStandingOrder(
3
input: {
4
period: Daily
5
accountId: "{{YOUR_ACCOUNT_ID}}"
6
consentRedirectUrl: "{{YOUR_REDIRECT_URL}}"
7
label: "Recurring label"
8
firstExecutionDate: "2021-09-21T"
9
lastExecutionDate: "2022-01-01T"
10
sepaBeneficiary: {
11
iban: "NL15ABNA5172064443"
12
name: "ACME Company"
13
isMyOwnIban: false
14
save: false
15
}
16
reference: "Reference"
17
targetAvailableBalance: { currency: "EUR", value: "100" }
18
}
19
) {
20
... on ScheduleStandingOrderSuccessPayload {
21
__typename
22
standingOrder {
23
statusInfo {
24
status
25
... on StandingOrderConsentPendingStatusInfo {
26
__typename
27
consent {
28
consentUrl
29
}
30
}
31
}
32
id
33
}
34
}
35
... on ForbiddenRejection {
36
__typename
37
message
38
}
39
... on InternalErrorRejection {
40
__typename
41
message
42
}
43
... on InvalidArgumentRejection {
44
__typename
45
code
46
message
47
}
48
}
49
}
50
Copied!

Next steps

In this guide you use consent for the first time. It will be helpful for you to also consult the documentation on consents and payments.
Or move on to the next guide: How to issue cards.
If the card is not relevant to your project, you could skip ahead to: Add member to an account