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 or confirmed transaction from an active invoice, which then triggers a callback.

  • Creating a confirmed transaction from a canceled 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 a confirmed transaction) or canceled (for a failed 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.

post

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.

Authorizations
Body
  • Request body containing the data necessary for simulating the transaction.
amountstringRequired

The transaction amount.

Example: 10
invoiceIdstringRequired

The invoice ID.

Example: 349deb32-2577-44ca-8b03-fc04fd2b8be9
statusany ofRequired

The status that will be assigned to the transaction ("confirmed" or "failed").

Example: confirmed
string · enumOptionalPossible values:
or
string · enumOptionalPossible values:
Responses
200

Ok

application/json
post
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