๐Ÿ› ๏ธ
Integration Guide
  • ๐Ÿ”ŽOverview
    • ๐Ÿ‘‹Welcome to XGateway
      • Integrate with XGateway
      • Supported currencies
      • KYC
  • โš™๏ธIntegration Guides
    • Crypto Payments using Checkout
    • SEPA Secure payments using Checkout
    • Alternative Payment Methods using Checkout
    • Crypto Payments using API
    • Advanced features of Invoice creation
  • โ”Miscellaneous
    • Keys and authentication
    • Check transaction status
    • Environments
    • Invoice currencies
    • Deposit data confirmation
    • Callbacks
      • Transaction callback
      • Bank Account callback
      • KYC callback
    • Withdrawal initiation with API
    • Disputes resolution
  • ๐Ÿ’ฑPayment flows
    • Transaction flowchart
    • KYC checks diagram
    • Confirmation subprocess
    • User flow for Crypto Payments
    • User flow for SEPA Secure
    • Fees structure
      • Adjustable BTC Minimum Deposit Fee Framework
  • ๐ŸคBack office
Powered by GitBook
On this page
  1. Integration Guides

Crypto Payments using API

PreviousAlternative Payment Methods using CheckoutNextAdvanced features of Invoice creation

Last updated 8 days ago

XGateway enables direct deposits without the necessity to use the Checkout page or pre-create an invoice. This simplified process, known as , has two key differences:

  1. The exchange rates are not fixed.

  2. No UI is provided by XGateway.

Creating an Channel

In order to create a channel, you need to make a POST request to the corresponding API endpoint.

In case of a successful response, the data property contains the address that you can display to your customer. You can also use the qrCodeURL property to display the address in an easy-to-use format.

By default, the payment gateway links the created wallet to a customer forever. The created wallet can be used across all EVM compatible chains.

Remember to authorise the request with your key using x-api-key header.

Processing a callback

{
   "callbackType":"transaction",
   "amount":"200",
   "applicationId":null,
   "currency":"USDT",
   "customerId":"000394",
   "hash":"...",
   "id":"7e71d132-d80d-4140-8e60-9c89d0bd9eed",
   "invoiceId":"184e9933-1526-...-fe567091b5bd",
   "network":"tron",
   "orderId":null,
   "status":"confirmed",
   "transactionHash":"0x58f6",
   "type":"deposit",
   "info":{
      "exchangeRate":"1.03759",
      "referenceAmount":"207.52",
      "referenceCurrency":"USD",
      "referenceExchangeRate":"1.000065",
      "transactionAmount":"207.51518",
      "transactionCurrency":"tUSDT"
   },
   "fees":{
      "processing":"7.263031",
      "technical":null
   },
   "eur":"200.12",
   "usd":"207.52"
}

Confirming a transaction

Testing Crypto Payments on Demo environment

The best way to test the integration is to deposit native token on a test network. Proceed with the integration up to the point where the customer wallet is generated and returned to you. Make sure that deposits of ETH are enabled for your profile.

Send a portion of this ETH to the wallet, assigned to your customer.

Wait for the system to send you a callback about a successful deposit.

When a customer makes a deposit using a cryptocurrency, XGateway detects the transaction and sends a deposit callback to the merchant. Below is an example of such a callback. For detailed information, please visit.

Due to security risks, merchants must use our to request transaction details. XGateway is not liable for issues caused by relying only on callback data.

To confirm the callback is valid, please use the .

You can test direct crypto deposits in the.

Use faucets, like one, to get some ETH on Sepolia test network.

โš™๏ธ
this page
API endpoint
API endpoint
demo environment
this
  • Creating an Channel
  • POSTReturns a previously created or brand-new address with a link to a QR code.
  • Processing a callback
  • Confirming a transaction
  • Testing Crypto Payments on Demo environment

Returns a previously created or brand-new address with a link to a QR code.

post

Create a channel for the customer for a specified currency.

Access to this endpoint requires a valid API key. The API key is sent in the x-api-key header on requests.

Authorizations
Body
  • Contains currency and customer id.

Params:

  • currency - The currency.
  • customerId - The customer ID in the external system.
currencystring ยท enumRequired

Represents supported crypto currencies in the payment processing system.

Currencies:

  • BNB - Binance Coin
  • bUSDT - Tether (pegged to USD), issued on BNB Smart Chain network (BEP20 token)
  • BTC - Bitcoin
  • ETH - Ether
  • eUSDC - USD Coin (pegged to USD), issued on Ethereum network (ERC20 token)
  • eUSDT - Tether (pegged to USD), issued on Ethereum network (ERC20 token)
  • FTN - Fasttoken
  • POL - POL
  • pUSDC - USD Coin (pegged to USD), issued on Polygon network (ERC20 token)
  • SOL - SOL
  • sUSDT - Tether (pegged to USD), issued on Solana network (SPL token)
  • tUSDC - USD Coin (pegged to USD), issued on Tron network (TRC20 token)
  • tUSDT - Tether (pegged to USD), issued on Tron network (TRC20 token)
  • wpUSDC - wrapped USD Coin (pegged to USD), issued on Polygon network (ERC20 token)
  • wpUSDT - wrapped Tether (pegged to USD), issued on Polygon network (ERC20 token).
Possible values:
customerIdstringRequired
Responses
200
Ok
application/json
Responseany of
or
201
Created
application/json
400
Database violation
application/json
401
Unauthorized
application/json
422
Unprocessable content
application/json
500
Internal server error
application/json
post
POST /api/v2/channels HTTP/1.1
Host: api.xgateway.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "currency": "BNB",
  "customerId": "ff36a7a5-08fd-418a-a150-f6f2d36676a8"
}
{
  "data": {
    "address": "n3UrMJG4rxAbXfVWo8dpZ4JLsDZMFm8LM9",
    "qrCodeURL": "https://objects.xgateway.dev/public/43c33515-8b56-4937-ae48-7bd6de7e11f9.svg"
  },
  "success": true
}
Channels