curl https://api.thanxsandbox.com/purchases \
-X POST \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \
-H "X-ClientId: ${client_id}"
-d '{
"purchase": {
"merchant_id": "weoru",
"location_id": "hljkfd2345",
"user_id": "wgljsdwer23",
"amount": 13.45,
"purchased_at": "2020-09-15T00:52:10.655+00:00",
"card_id": null
}
}'
{}
Purchases
Create Purchase
This endpoint submits a purchase to our system for processing. Because this purchase is processed asynchronously, there is no response JSON. Please allow up to a couple minutes to receive this purchase back from the GET /purchases endpoint.
POST
/
purchases
curl https://api.thanxsandbox.com/purchases \
-X POST \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \
-H "X-ClientId: ${client_id}"
-d '{
"purchase": {
"merchant_id": "weoru",
"location_id": "hljkfd2345",
"user_id": "wgljsdwer23",
"amount": 13.45,
"purchased_at": "2020-09-15T00:52:10.655+00:00",
"card_id": null
}
}'
{}
This endpoint is only available in SANDBOX
Please review proper request headers here.
Response
string
The merchant ID
string
Location ID
decimal
The purchase amount
string
Time the purchase was made in ISO8601-format
string
The card the user used, if it is registered in Thanx
curl https://api.thanxsandbox.com/purchases \
-X POST \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \
-H "X-ClientId: ${client_id}"
-d '{
"purchase": {
"merchant_id": "weoru",
"location_id": "hljkfd2345",
"user_id": "wgljsdwer23",
"amount": 13.45,
"purchased_at": "2020-09-15T00:52:10.655+00:00",
"card_id": null
}
}'
{}