Search…
Control card usage
It's great to be able to issue cards, but you'll also want to know how to control the way cardholders use them, as well as understand payment flows.
Card payments usually involve two transactions:
  • authorization: when the merchant asks Swan if the account has enough money to cover a purchase
  • debit: the money moving from your account to the merchant's account.
In real life, these events happen automatically with each payment regardless of whether it was made in-store or online. In sandbox, you will use the Event Simulator > Cards to simulate different transactions.

Simulate an authorization request

An authorization request is a way for the merchant to check if the payment account linked to the card holds enough funds to pay for the good or service provided. Sometimes this is used by the merchant to check if the card exists (for example for authorizing a small amount or even 0€).
Simulation for an authorization request

Simulate a clearing

A clearing is the actual money flow during a card payment. Those transactions usually occur between 1 to 3 days after the authorization (depending on the merchant). But this is not set in stone and merchant can bypass the standard process. Therefore we can receive an authorization without debit, a debit without an authorization or even multiple debit for the same authorization. To simulate this part of the card payment use the Event Simulator > Debit.
Simulation for a debit clearing

Get a card's transactions

If you provide multiple cards to multiple people on the same payment account, you may want to display to each cardholder their own transactions. With GraphQL this is a really easy feat. Since every card transaction is linked to a card, you can get all transactions linked to that specific card.
In the web banking interface, just select a card and you'll see this feature directly. In the API, make a query using the cardId to fetch all transactions made with that card.
Request
Response
1
query MyQuery {
2
card(cardId: "{{YOUR_CARD_ID}}") {
3
transactions {
4
edges {
5
node {
6
... on CardTransaction {
7
id
8
category
9
label
10
statusInfo {
11
status
12
}
13
type
14
amount {
15
currency
16
value
17
}
18
}
19
}
20
}
21
}
22
}
23
}
24
​
Copied!
1
{
2
"data": {
3
"card": {
4
"transactions": {
5
"edges": [
6
{
7
"node": {
8
"id": "decao_e42e2ef856ae44ac5dde49e820a1143d",
9
"category": "InStore",
10
"label": "SWAN",
11
"statusInfo": {
12
"status": "Booked"
13
},
14
"type": "CardOut",
15
"amount": {
16
"currency": "EUR",
17
"value": "12.00"
18
}
19
}
20
},
21
{
22
"node": {
23
"id": "aucao_ca4ccb4f25d5976ed79d4f0cdbd11827",
24
"category": "InStore",
25
"label": "SWAN",
26
"statusInfo": {
27
"status": "Released"
28
},
29
"type": "CardOut",
30
"amount": {
31
"currency": "EUR",
32
"value": "0"
33
}
34
}
35
}
36
]
37
}
38
}
39
}
40
}
Copied!

Next steps

Now that you understand our payment features, it's time to learn to manage memberships.
Last modified 2mo ago