Get a list of card transactions
You can call the API to get a list of all card transactions executed from an account.
Transaction information is also available on your Dashboard > Data > Transactions, as well as Swan's Web Banking interface if you're using it.
Prerequisites
You need a project access token to call the query.
Guide​
- Call the
card
query. - Add the card ID.
- Add
transactions
. - Add all information you'd like to review about each card transaction.
- Add pagination if you're expecting a long list.
Query​
🔎 Open the query in API Explorer
query ListCardTransactions {
card(cardId: "$YOUR_CARD_ID") {
transactions {
edges {
node {
... on CardTransaction {
id
label
statusInfo {
status
}
type
amount {
currency
value
}
}
paymentId
}
}
}
}
}
Payload​
Review these two card transactions for an eCommerce purchase: the authorization and the final payment. Each transaction has its own transaction ID (lines 8, 23) but share the same payment ID (lines 18, 33)
{
"data": {
"card": {
"transactions": {
"edges": [
{
"node": {
"id": "decao_af21958a1f6b29f191c386b14217d8c5",
"label": "Book purchase",
"statusInfo": {
"status": "Booked"
},
"type": "CardOutDebit",
"amount": {
"currency": "EUR",
"value": "20.00"
},
"paymentId": "cro_f12d71a2a601affcb69f61bc8669e919"
}
},
{
"node": {
"id": "aucao_d0c6cc158978d783d53c65bd659454ca",
"label": "Book purchase",
"statusInfo": {
"status": "Released"
},
"type": "CardOutAuthorization",
"amount": {
"currency": "EUR",
"value": "15.00"
},
"paymentId": "cro_f12d71a2a601affcb69f61bc8669e919"
}
},
]
}
}
}
}