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
,canceled
Transaction Statuses:
confirmed
,failed
Supported Flows
This endpoint enables the following scenarios:
Creating a
failed
orconfirmed
transaction from anactive
invoice, which then triggers a callback.Creating a
confirmed
transaction from acanceled
invoice (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 aconfirmed
transaction) orcanceled
(for afailed
transaction).
Important Notes
Amount: When creating a new transaction from an
active
invoice, 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.
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.
10
The invoice ID.
349deb32-2577-44ca-8b03-fc04fd2b8be9
The status that will be assigned to the transaction ("confirmed" or "failed").
confirmed
Ok
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