Skip to main content

Receive Sale Webhooks

XGate sends an event to your URL on every status change of a crypto sale.


Setup​

The setup is the same as for the other webhooks (see Receiving Webhooks): in the XGate dashboard, Webhooks menu, select the event type Crypto Sales (CRYPTO_SALE) and the statuses you want to receive.

The CRYPTO_SALE type only appears for companies with sales enabled.


Event format​

Envelope differs from deposit and withdrawal webhooks

Crypto events do not use the flat format of the deposit and withdrawal webhooks (id, status, amount, operation...). They come in an envelope with id, type, createdAt and data, the same as the purchase webhooks.

  • Method: POST
{
"id": "evt_6ad6d669b2be17e22bbec226_SETTLED",
"type": "sale.settled",
"createdAt": "2026-10-16T14:03:24.902Z",
"data": {
"id": "6711c0e5a1b2c3d4e5f60718",
"status": "SETTLED",
"asset": "USDT",
"network": "TRON",
"txHash": "9f2c1e0b7a6d5c4b3a291807f6e5d4c3b2a1908f7e6d5c4b3a2918070f6e5d4c",
"cryptoAmount": "1000.000000",
"netAmount": "5355.90",
"settlement": { "type": "BALANCE" },
"updatedAt": "2026-10-16T14:03:24.870Z"
}
}

Event envelope​

FieldTypeDescription
idstringUnique event ID. Use to discard duplicate deliveries.
typestringEvent type (table below).
createdAtstringEvent creation date (ISO 8601, UTC).
dataobjectSale summary (table below). The full object is available in Get Sale.

Fields in data (sale summary)​

FieldTypeDescription
idstringSale ID at XGate. Use in GET /crypto/sales/{id}.
statusstringRECEIVED · SETTLING · SETTLED · SETTLED_TO_BALANCE.
assetstringReceived asset.
networkstringNetwork on which it was received.
txHashstringIntegrator transfer hash. Sales do not have an externalId; reconciliation is done via this field.
cryptoAmountstringReceived quantity.
netAmountstring | nullCredited BRL amount. null until settlement.
settlementobject{ type }: BALANCE or PIX_KEY.
updatedAtstring (ISO)Last update timestamp; use with status to sort out-of-order events.

Events​

Event (type)Dashboard statusWhen
sale.receivedRECEIVEDCrypto received and confirmed at the fixed address.
sale.settledSETTLED or SETTLED_TO_BALANCEBRL credited. data.status tells which of the two and data.settlement shows how. Final.

Rules for the integrator​

  • One event per status change, sent once.
  • At-least-once delivery: the same event may arrive more than once. Handle idempotency using the event id.
  • Order: events may arrive out of order. Sort by data.updatedAt and data.status.
  • Respond 200 quickly, as with the other webhooks.
  • Reconcile each sale using the data.txHash of your transfer.