Purchases
Get Purchases
Purchases
Get Purchases
This section describes endpoints that enable a third party to fetch a user's purchases. This endpoint describes all available purchases.
GET
/purchases
Bearer*
curl --request GET \
--url https://api.thanx.com/purchases \
--header 'Authorization: Bearer <token>'
Parameters
merchant_id
string
Only return purchases for this merchant
location_id
string
Only return purchases for this location
user_id
string
Only return purchases for this user. Note: the bearer token will be used to determine which user’s purchases are being requested when the request is made by a logged in user.
Response
id
string
The ID of the tier status record
user_id
string
The user ID
merchant_id
string
The merchant ID
location_id
string
Location ID
purchased_at
string
Time the purchase was made in ISO8601-format
amount
decimal
The purchase amount
order
hash
Provides information about the associated order, if any
{
"purchases": [
{
"id": "92b7b0dac4",
"user_id": "weori235",
"merchant_id": "9a1f0772c9ac",
"location_id": "e7183da044",
"purchased_at": "2020-01-01T20:00:00Z",
"amount": 9.99,
"order": {
"provider": "OLO",
"id": "YWEI2342F"
}
}
]
}
curl --request GET \
--url https://api.thanx.com/purchases \
--header 'Authorization: Bearer <token>'
{
"purchases": [
{
"id": "92b7b0dac4",
"user_id": "weori235",
"merchant_id": "9a1f0772c9ac",
"location_id": "e7183da044",
"purchased_at": "2020-01-01T20:00:00Z",
"amount": 9.99,
"order": {
"provider": "OLO",
"id": "YWEI2342F"
}
}
]
}