advanced API - Get transaction (legacy)

How to get your transactions from the API

S
Written by Sascha Hoffmann
Updated over a week ago

The get transactions API allows you to receive all your transactions programmatically. In order to get all your transactions via API, you need an access token. You'll find more information in our article: Article to get access token

How to get transactions

Endpoint:

Method:

GET

Request header:

Header: {
Authorization: Bearer ACCESS_TOKEN,
Content-Type: application/vnd.api+json
}

Optional Parameter

Date range:

To set a date range for your request you can set a starting and ending by using unix timestamps.

starting=1595894400
ending=1596036985

Relations:

Because the endpoint calls a relation based database a lot of secondary information are linked as relation. For the best performance please you can exclude all relation by using an empty include paramater or just use the relations you need. For example sites (contains the site id) and transaction status.

relations=include[sites,external_transaction_status]

Pagination:
If you want to get just a part of your transaction, you can set the page[size] and the number of the page. This is recommended especially for request with bigger time ranges.

page[size]=100 ( number ) 
page[number]=1 ( number )

response data attributes

    "transaction_id": String => advanced store identifier
"external_advertiser_id": String => internal partner id
"advertiser_cost": integer
"external_identifier": String || null => external partner id
"last_external_update_time": Date || null => external update time
"external_advertiser_name": String => name of the Partner
"tracking_category": String || null
"created_at": Date
"contract_commission": Integer => microcent of the commission
"confirmation_time": Date || null => Date of Sale confirmation
"referrer": String
"updated_at": Date || null => Date of update
"click_time": Integer
"transaction_time": Date => Date of transaction
"value": Integer => basket value in microcent
"sub_id_or_text": String || null => sub string

response data relations

"relationships": {
"external_transaction_status": {
"data": {
"id": "2", // 0 = open, 1 = confirmed, 2 = rejected
"type": "external_transaction_status"
}
},
"sites": {
"data": {
"id": "211", // the id of your site at advanced store
"type": "sites"
}
}
}

Example

Curl Example

curl --location --request GET 'https://api.ad4mat.net/1.0/external_transactions?page[number]=1&page[size]=10&relations=include[]&starting=1595894400&ending=1596036985' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'Content-Type: application/vnd.api+json'

Response Example

{
"meta": {
"total_pages": 99999,
"overall_items": 99999
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": {
"href": "https://api.ad4mat.net/1.0/external_transactions/?page[number]=1&relations=include[]&page[size]=1",
"meta": {}
},
"first": {
"href": "https://api.ad4mat.net/1.0/transaction_types/?page[number]=1&relations=include[]&page[size]=1",
"meta": {}
},
"last": {
"href": "https://api.ad4mat.net/1.0/transaction_types/?page[number]=1&relations=include[]&page[size]=1",
"meta": {}
},
"next": {
"href": "https://api.ad4mat.net/1.0/transaction_types/?page[number]=1&relations=include[]&page[size]=1",
"meta": {}
},
"prev": {
"href": "https://api.ad4mat.net/1.0/transaction_types/?page[number]=1&relations=include[]&page[size]=1",
"meta": {}
}
},
"data": [
{
"id": "1",
"type": "external_transactions",
"attributes": {
"transaction_id": "123456789",
"external_advertiser_id": 987654321,
"advertiser_cost": 0,
"external_identifier": null,
"last_external_update_time": null,
"external_advertiser_name": "advanced store",
"tracking_category": null,
"created_at": 1558089126144,
"contract_commission": 623000,
"confirmation_time": null,
"referrer": "",
"updated_at": 1579608928555,
"click_time": 0,
"transaction_time": 1556203321000,
"value": 12670000,
"sub_id_or_text": "your subid string"
},
"relationships": {
"external_transaction_status": {
"data": {
"id": "2",
"type": "external_transaction_status"
}
},
"sites": {
"data": {
"id": "211",
"type": "sites"
}
}
},
"links": {
"self": {
"href": "https://api.ad4mat.net/1.0/external_transactions/1"
}
}
}
]
}

Did this answer your question?