Deposit and Withdrawal simulation
The XGateway Demo Environment offers an API to simulate a transaction processing and receive a transaction notification (callback).
The API ingests an invoice ID and forms a transactions with a callback based on the invoice data. It requires the prior created invoice to be either activated or finalised.
Supported Statuses
Invoice Statuses:
active,completed,canceledTransaction Statuses:
confirmed,failed
Supported Deposit Flows
This endpoint enables the following scenarios:
Creating a
failedorconfirmedtransaction from anactiveinvoice, which then triggers a callback.Creating a
confirmedtransaction from acanceledinvoice (this is known as the "confirmed from failed" flow), which then triggers a callback.Resending a callback for an existing transaction. This is used when an invoice is already
completed(for aconfirmedtransaction) orcanceled(for afailedtransaction).
Important Notes
Amount: When creating a new transaction from an
activeinvoice, the amount specified in the API call is used. However, this amount is ignored when resending a callback for an invoice that already has a transaction linked to it.Crypto Payments: The "confirmed from failed" flow is not supported for Crypto payments.
Fees: Any fees shown in the callback are generated randomly and do not reflect actual charges.
Testing Withdrawal Callback
When a withdrawal request is created, the system also creates a linked invoice. The invoice can be seen in the Merchant Backoffice (Invoices tab). Use a corresponding invoice id to trigger a callback via the simulation API.

Allows you to simulate transaction processing and and receive transaction notifications. Requires the prior creation and activation of an invoice. Skips the step of creating a transaction and simply resends the notification in cases where the invoice already has a finalized transaction.
- Request body containing the data necessary for simulating the transaction.
The transaction amount.
10The invoice ID.
349deb32-2577-44ca-8b03-fc04fd2b8be9The status that will be assigned to the transaction ("confirmed" or "failed").
confirmedOk
Bad request
Unauthorized
Not Found
Unprocessable content
Internal server error
POST /api/v2/transaction/simulate HTTP/1.1
Host: api.xgateway.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 87
{
"amount": "10",
"invoiceId": "349deb32-2577-44ca-8b03-fc04fd2b8be9",
"status": "confirmed"
}{
"data": "The transaction was successfully simulated.",
"success": true
}Last updated