Skip to main content

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​

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

Path​

ParameterTypeDescription
idstringSale 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.

FieldTypeDescription
idstringSale ID.
statusstringRECEIVED (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, networkstringAsset and network.
depositAddressstringCompany fixed deposit address that received the transfer.
sourceAddressstring | nullSender address, when provided by the network.
txHashstring | nullOn-chain transfer hash. Use for reconciliation.
cryptoAmountstringReceived quantity (6 decimal places).
ratestring | nullBRL price per unit (8 decimal places), locked at settlement, with commercial spread already included.
grossAmount, netAmountstring | nullAmount credited in BRL (cryptoAmount × rate, rounded down, 2 decimal places). Currently identical.
settlementobjecttype (BALANCE | PIX_KEY), beneficiaryId, withdrawId (created Pix payout), fallbackReason (PIX_SETTLEMENT_UNAVAILABLE · BENEFICIARY_NOT_ELIGIBLE · PAYOUT_REJECTED · PAYOUT_FAILED · PAYOUT_UNAVAILABLE · null).
reviewobject | nullSale under review by XGate. reason: BELOW_MINIMUM · COMPANY_UNAVAILABLE · COMPANY_BLOCKED · SELL_POLICY_MISSING · NET_NOT_POSITIVE · CONFIRMATIONS_TIMEOUT · CREDIT_REVIEW.
receivedAt, settledAt, createdAt, updatedAtstringISO 8601 timestamps (UTC). updatedAt and status order out-of-order webhooks.

Common Errors​

StatusReason
401UNAUTHORIZED
403COMPANY_BLOCKED, ALLOWED_IPS_REQUIRED, CLIENT_IP_NOT_ALLOWED
404SALE_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 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
}
})()