Integration using Checkout Page
Last updated
Last updated
This form of integration allows you to get a head start on integration and saves you the trouble of building your own UI, generating user addresses for each currency and displaying them to the user.
The main mode of operation of XGateway is using with a fixed exchange rate.
Please read page before starting. The invoice creation API uses several parameters that need explanation.
A fixed rate invoice locks exchange rate for the transfer of funds for 15 minutes. After this period the invoice is marked as expired.
In order to create a Fixed Rate invoice in the payment processing system, you need to make a POST
request to the Invoice API v2 endpoint.
The XGateway provides one API endpoint, which automatically defines a corresponding payment methods based on the input parameters provided by the merchant.
Below you can see examples of requests for different payment methods. A detailed explanation of the API endpoint is available in the next section.
The system will skip all XGateway intermediate pages and redirect the customer directly to the payment method only if all required data is provided.
The full API endpoint specification is available below.
The request to create an invoice may specify application (applicationId). This is an optional parameter used to customise the look and feel of the checkout page. Every application contains its own settings set to tailor the checkout page for different needs.
The customer identificator is a mandatory field, which must contain the id of the customer, used in your system. This id is sent back in the callbacks on every deposit in order to link deposits with corresponding customers.
The order identificator is an optional parameter, which will be sent back to your system with a callback for the deposit linked to this exact invoice.
Remember to authorise the request with your x-api-key
header.
x-api-key*
String
Your API key
Invoices at the moment of creation have no expiration time. After invoice activation on the checkout page (when the customer selects the payment currency and clicks "Proceed"), the system will set an expiration time according to invoice TTL. Once an invoice has expired, the link will show an error.
You can make several requests for the same customer with a different amount/base currency and get a different checkout link back.
The time to live for floating invoices is 24 hours.
The time to live for fixed invoices can be configured during merchant creation and can also be adjusted later in the Merchant's back office. The default value for the invoice TTL is 1200 seconds, which is equivalent to 20 minutes.
The KYC flow through the Checkout V2 supports pre-population of fields in case your service already has the personal data of the customers. This function is only available for banking onramp. In order to pre-populate the form add the information into the URL parameters (query parameters) when working with an invoice. See the example below:
Creates an invoice using a fixed or floating exchange rate strategy. The invoice is generated based on the provided parameters, including amount, base currency, customer ID, and optionally, an order ID.
If paymentCurrency
is provided and all required activation parameters for a specific payment are included
(customerFirstName
, customerLastName
, customerEmail
, customerCountry
, customerPhone
, customerAccount
), the invoice is instantly activated.
Returns a checkout link upon successful creation.
Access to this endpoint requires a valid API key. The API key is sent in the x-api-key
header on requests.
Params:
Base Currency is the currency of a customer deposit or withdrawal. It is used to initiate the deposit invoice or withdrawal request. This is the currency a customer will typically see on the merchant cashier page.
Example: A customer wants to deposit 10 EUR of ETH. In this case the base currency is EUR.
This is an array of currencies used to manage the display of currencies on the Checkout page. When an array is provided, the function preserves and respects the specified list and order of the currencies shown to the customer.
Represents the possible strategies of an invoice.
A transaction currency is the native currency that is received by XGateway and available for settlement by the corresponding merchant. This is the currency used to make the transaction on the blockchain to move the value, ie ETH, BTC, any ERC-20 token etc.
Example: A customer wants to deposit 10 EUR of ETH. In this case the transaction currency is ETH.