Skip to main content

Get Purchase

Queries a crypto purchase by the ID returned upon creation (POST /crypto/purchases). Useful to verify status when a webhook was missed or to reconcile delivery.


Endpoint​

  • Method: GET
Endpoint URL
https://api.xgateglobal.com/crypto/purchases/{id}

Request​

Required Headers​

HeaderValueDescription
AuthorizationBearer <your_token>The JWT token obtained at login.

Path​

ParameterTypeDescription
idstringPurchase ID returned at creation time.

Responses​

Success (200 OK)​

Returns the full purchase object. The purchase webhook delivers only a summary of it.

{
"id": "6710c2f4a1b2c3d4e5f60718",
"externalId": "order-7781",
"status": "DELIVERED",
"channel": "API",
"asset": "USDT",
"network": "TRON",
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"amount": "1500.00",
"rate": "5.45400000",
"cryptoAmount": "275.027502",
"networkFee": "0.012000",
"deliveredAmount": "275.015502",
"quoteId": "l3m8Qm1n0pV2cXk5dY9sTg4hWz7aB6eR1uJ0oK2qF3i",
"depositId": null,
"approval": { "required": true, "decision": "APPROVED", "decidedAt": "2026-10-13T14:08:02.000Z" },
"delivery": { "status": "CONFIRMED", "txHash": "9f2c1e7b0a…", "confirmedAt": "2026-10-13T14:11:39.000Z" },
"rejection": null,
"executedAt": "2026-10-13T14:03:40.512Z",
"createdAt": "2026-10-13T14:03:40.204Z",
"updatedAt": "2026-10-13T14:11:40.031Z"
}

The complete field description is documented in Purchase object.

Common Errors​

StatusReason
401UNAUTHORIZED
403COMPANY_BLOCKED, ALLOWED_IPS_REQUIRED, CLIENT_IP_NOT_ALLOWED, CRYPTO_DISABLED, CRYPTO_API_DISABLED
404PURCHASE_NOT_FOUND: Inexistent ID, malformed, or belonging to another company.

See the meaning of each code in Error Codes.


Integration​

const axios = require("axios");

(async () => {
const email = "your_email@domain.com";
const password = "**********";
const purchaseId = "6710c2f4a1b2c3d4e5f60718";

try {
const url_api = "https://api.xgateglobal.com";
const login = await axios.post(`${url_api}/auth/token`, { email, password });
const { data } = await axios.get(`${url_api}/crypto/purchases/${purchaseId}`, {
headers: { "Authorization": `Bearer ${login.data.token}` }
});
console.log(data.status, data.deliveredAmount, data.delivery.txHash); // Response
} catch (error) {
console.log(error.response.data.reason, error.response.data.message); // Error
}
})()