Get Sale
Queries a crypto sale by ID. Each confirmed transfer to your company's fixed address becomes a sale (see Sell Crypto); the id is delivered via the sale webhook.
Endpoint
- Method: GET
Endpoint URL
https://api.xgateglobal.com/crypto/sales/{id}
Request
Required Headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer <your_token> | The JWT token obtained at login. |
Path
| Parameter | Type | Description |
|---|---|---|
id | string | Sale ID. |
Responses
Success (200 OK)
{
"id": "6711c0e5a1b2c3d4e5f60718",
"status": "SETTLED",
"asset": "USDT",
"network": "TRON",
"depositAddress": "TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
"sourceAddress": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"txHash": "9f2c1e0b7a6d5c4b3a291807f6e5d4c3b2a1908f7e6d5c4b3a2918070f6e5d4c",
"cryptoAmount": "1000.000000",
"rate": "5.41000000",
"grossAmount": "5410.00",
"netAmount": "5410.00",
"settlement": { "type": "BALANCE", "beneficiaryId": null, "withdrawId": null, "fallbackReason": null },
"review": null,
"receivedAt": "2026-10-16T14:03:22.114Z",
"settledAt": "2026-10-16T14:03:24.870Z",
"createdAt": "2026-10-16T14:03:22.114Z",
"updatedAt": "2026-10-16T14:03:24.870Z"
}
Sale Object
The sale webhook delivers only a summary of this object.
| Field | Type | Description |
|---|---|---|
id | string | Sale ID. |
status | string | RECEIVED (received and confirmed, awaiting rate) · SETTLING (rate locked, credit in progress) · SETTLED (settled via configured method; final) · SETTLED_TO_BALANCE (was Pix, fell back to balance; final). |
asset, network | string | Asset and network. |
depositAddress | string | Company fixed deposit address that received the transfer. |
sourceAddress | string | null | Sender address, when provided by the network. |
txHash | string | null | On-chain transfer hash. Use for reconciliation. |
cryptoAmount | string | Received quantity (6 decimal places). |
rate | string | null | BRL price per unit (8 decimal places), locked at settlement, with commercial spread already included. |
grossAmount, netAmount | string | null | Amount credited in BRL (cryptoAmount × rate, rounded down, 2 decimal places). Currently identical. |
settlement | object | type (BALANCE | PIX_KEY), beneficiaryId, withdrawId (created Pix payout), fallbackReason (PIX_SETTLEMENT_UNAVAILABLE · BENEFICIARY_NOT_ELIGIBLE · PAYOUT_REJECTED · PAYOUT_FAILED · PAYOUT_UNAVAILABLE · null). |
review | object | null | Sale under review by XGate. reason: BELOW_MINIMUM · COMPANY_UNAVAILABLE · COMPANY_BLOCKED · SELL_POLICY_MISSING · NET_NOT_POSITIVE · CONFIRMATIONS_TIMEOUT · CREDIT_REVIEW. |
receivedAt, settledAt, createdAt, updatedAt | string | ISO 8601 timestamps (UTC). updatedAt and status order out-of-order webhooks. |
Common Errors
| Status | Reason |
|---|---|
| 401 | UNAUTHORIZED |
| 403 | COMPANY_BLOCKED, ALLOWED_IPS_REQUIRED, CLIENT_IP_NOT_ALLOWED |
| 404 | SALE_NOT_FOUND: Inexistent ID, malformed, or belonging to another company. |
See the meaning of each code in Error Codes.
Integration
- Node.js
const axios = require("axios");
(async () => {
const email = "your_email@domain.com";
const password = "**********";
const saleId = "6711c0e5a1b2c3d4e5f60718";
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/sales/${saleId}`, {
headers: { "Authorization": `Bearer ${login.data.token}` }
});
console.log(data.status, data.txHash, data.netAmount, data.settlement.type); // Response
} catch (error) {
console.log(error.response.data.reason, error.response.data.message); // Error
}
})()