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.
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
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
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
query MyQuery {
card(cardId: "{{YOUR_CARD_ID}}") {
transactions {
edges {
node {
... on CardTransaction {
id
category
label
statusInfo {
status
}
type
amount {
currency
value
}
}
}
}
}
}
}
{
"data": {
"card": {
"transactions": {
"edges": [
{
"node": {
"id": "{{YOUR_TRANSACTION_ID}}",
"category": "InStore",
"label": "SWAN",
"statusInfo": {
"status": "Booked"
},
"type": "CardOut",
"amount": {
"currency": "EUR",
"value": "12.00"
}
}
},
{
"node": {
"id": "{{YOUR_TRANSACTION_ID}}",
"category": "InStore",
"label": "SWAN",
"statusInfo": {
"status": "Released"
},
"type": "CardOut",
"amount": {
"currency": "EUR",
"value": "0"
}
}
}
]
}
}
}
}
Last modified 1yr ago