Operations (legacy)
Alert – The Operation object changes in the next version
The new Operation object is now available in Sandbox. If you have any doubts about how to migrate, contact your Treezor Account Manager.
Retrieve operations
When requesting a list of operations, the following query parameters are required:
walletId
– Restrict to operations related to that walletdateTo
– Restrict to operations posterior to that datedateFrom
– Restrict to operations anterior to that date
Note – 3-month timeframe support
The dateTo
and dateFrom
fields must be less than 3 months apart.
To get the list of operations, use the following request (which supports cursor-based pagination).
bash
curl -X GET {baseUrl}/core-connect/operations?walletId={walletId}&dateFrom={dateFrom}&dateTo={dateTo} \
--header 'Authorization: Bearer {accessToken}' \
Here is an example of a response. It returns an array of Operation objects along with a cursor.
json
{
"data": [
{
"operationType": "cardTransaction",
"amount": {
"amount": 48686359277,
"currency": "EUR"
},
"walletId": 617902,
"direction": "DEBIT",
"objectId": "29114",
"label": "AJCY41mC+1yNlyNdW8TZ7U3cWlMQoFM/ZTJmG9z3FGqibci6hc38rhB3Fsplf7tIXDVLEw3wZQ==",
"externalReference": null,
"metadata": {
"cardPayment": {
"mcc": {
"code": 8407
},
"mid": {
"value": "PVsPcbqFh6CmgvkVG9t4daisUM1y6pxVzn7p5quglgGfzrl/rKk77w4FRkVii5gv4D4amg=="
},
"localAmount": {
"amount": 48686359277,
"currency": "EUR"
},
"authorizationNote": "yoCzhxTe1IwCbtla72Rijd2L1s/V0/zsTUcMDjCLFmX2A4fI2j8J8hzjJD+4Wad6iX60w7sN6MfKIqI9thrJ"
}
},
"status": "SETTLED",
"date": {
"creation": "2020-05-21T11:59:05+02:00"
}
},
{
"operationType": "cardTopup",
"amount": {
"amount": 45074736937,
"currency": "EUR"
},
"walletId": 617902,
"direction": "CREDIT",
"objectId": 85689,
"label": "Card Top Up (via hipay) (85689)",
"externalReference": null,
"metadata": null,
"status": "SETTLED",
"date": {
"creation": "2020-05-20T19:41:33+02:00",
"settlement": "2020-05-20T02:00:00+02:00"
}
},
// [...] some objects are hidden
],
"cursor": {
"prev": null,
"current": "356a192b7913b04c54574d18c28d46e6395428ab",
"next": "da4b9237bacccdf19c0760cab7aec4a8359010b0"
}
}
Metadata
The metadata
object contains key information regarding the initial operation. This content differs depending on the operation.
Apart from transfers and card transactions, this value will be null
.
Transfers
json
"metadata":
{
"transfer":
{
"receiverId": 1872135,
"emitterId": 2078539,
"tag": ""
}
}
Card Transactions
json
"metadata":
{
"cardPayment":
{
"mcc": { // <-- you can read about MCC in /guide/cards/modifications.html and in the Glossary
"code": 12,
},
"mid": { // <-- you can read about MID in /guide/cards/modifications.html and in the Glossary
"value": "1231542UR"
},
"localAmount": {
"amount": 100,
"currency": "DT"
},
"authorizationNote": "You spent too much money",
"authorizationResponseCode": {
"action": "string",
"description": "string",
"value": "string"
}
}
}
Labels
You can expose the label
field values to your end users to provide more information. The information displayed depends on the context.
Context | Exposed data | Returned string example |
---|---|---|
Card Top Up | Indicates the type of operation, along with the corresponding id . | Card Top Up (1236548) |
Cancelled Card Top Up | Indicates the type of refund, along with the corresponding id . | |
Bank Transfer | Indicates the type of operation, along with the corresponding id . | Bank Transfer (408265455) |
Refund of Bank Transfer | Indicates the type of refund, along with the corresponding id . | Refund of Bank Transfer (1236548) |
Bank Direct Debit | Indicates the type of operation, along with the corresponding id . | |
Refund of Bank Direct Debit | Indicates the type of refund, along with the corresponding id . | |
Check | Indicates the type of operation, along with the corresponding id . | Check (12389478) |
Refund of a Check | Indicates the type of refund, along with the corresponding id . | Refund of Check (365895412) |
Transfer (wallet-to-wallet) | Indicates the name of the Wallet owner along with the operation id . | Alex Oak (65852369) |
Transfer (if fees or creditNote ) | Indicates the Transfer label (custom field) and id . | |
Card Transaction | Indicates the type of operation, along with the merchantName . |