Consultar Venta
Consulta una venta de cripto por ID. Cada transferencia confirmada hacia la dirección fija de la empresa se convierte en una venta (vea Vender Cripto); el id llega en el webhook de venta.
Endpoint
- Método: GET
URL del Endpoint
https://api.xgateglobal.com/crypto/sales/{id}
Solicitud
Headers Obligatorios
| Header | Valor | Descripción |
|---|---|---|
Authorization | Bearer <su_token> | El token JWT obtenido en el login. |
Path
| Parámetro | Tipo | Descripción |
|---|---|---|
id | string | ID de la venta. |
Respuestas (Responses)
Éxito (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"
}
Objeto de la venta
El webhook de venta envía únicamente un resumen de este objeto.
| Campo | Tipo | Descripción |
|---|---|---|
id | string | ID de la venta. |
status | string | RECEIVED (recibida y confirmada, esperando precio) · SETTLING (precio congelado, crédito en curso) · SETTLED (liquidada según la modalidad configurada; final) · SETTLED_TO_BALANCE (era Pix, se acreditó en saldo; final). |
asset, network | string | Activo y red. |
depositAddress | string | Dirección fija de la empresa receptora. |
sourceAddress | string | null | Billetera de origen, cuando la red la informa. |
txHash | string | null | Hash on-chain de la transferencia. Úselo para conciliar. |
cryptoAmount | string | Cantidad recibida (6 decimales). |
rate | string | null | Precio en BRL por unidad (8 decimales), congelado en la liquidación, con el margen comercial incluido.[cite: 17] |
grossAmount, netAmount | string | null | Monto acreditado en BRL (cryptoAmount × rate, hacia abajo, 2 decimales). Actualmente son iguales.[cite: 17] |
settlement | object | type (BALANCE | PIX_KEY), beneficiaryId, withdrawId (retiro Pix creado), fallbackReason (PIX_SETTLEMENT_UNAVAILABLE · BENEFICIARY_NOT_ELIGIBLE · PAYOUT_REJECTED · PAYOUT_FAILED · PAYOUT_UNAVAILABLE · null). |
review | object | null | Venta en revisión por XGate. reason: BELOW_MINIMUM · COMPANY_UNAVAILABLE · COMPANY_BLOCKED · SELL_POLICY_MISSING · NET_NOT_POSITIVE · CONFIRMATIONS_TIMEOUT · CREDIT_REVIEW. |
receivedAt, settledAt, createdAt, updatedAt | string | Fechas ISO 8601 (UTC). updatedAt y status permiten ordenar webhooks fuera de orden. |
Errores Comunes
| Status | Reason |
|---|---|
| 401 | UNAUTHORIZED |
| 403 | COMPANY_BLOCKED, ALLOWED_IPS_REQUIRED, CLIENT_IP_NOT_ALLOWED |
| 404 | SALE_NOT_FOUND: ID inexistente, fuera de formato o de otra empresa. |
Vea el significado de cada código en Códigos de Error.
Integración
- 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
}
})()