Skip to main content

Payment Link

Payment link provide to You easy way to receive payment from the client.
On the payment link page the client can select available and simple, for him, option of payment and pay the transaction. At this moment at payment link available next payment methods:

  • Scan QR and pay by crypto wallet
  • Pay by card

Preparation

Before you can start crate a payment link and accepting payments, you need to make settings and specify callback URL.

To create a payment link, you need to use the request /v1/payment-link (Production or Sandbox).
It is enough to specify the reference identifier txId from the merchant system.
You may not specify the currency code code, the amount amount, urlRedirectSuccess, urlRedirectFail or invoice type

The merchant creating invoice by API or at private area and share the link to payment. The merchant knows crypto currency and amount at the currency for transaction, and client cannot change it.

Example: Merchant wants to receive 50 USDT. See values in blockchain units in crypto settings

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120229",
"code": [ "usdt" ],
"amount": "50000000",
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress"
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. code - Code of invoice currency
  3. amount - Amount of transaction from merchant
  4. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  5. urlRedirectFail - URL address, where the customer to be redirected after failed processing

The merchant creating payment link at USD and indicate only one crypto currency for payment

Example: Merchant wants to receive 1000 USD at ETH only

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120230",
"code": [ "eth" ],
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress",
"fiat": {
"amount": 1000,
"currency": "usd"
}
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. code - Code of invoice currency
  3. fiat.amount - Amount of transaction at fiat currency
  4. fiat.currency - Fiat currency for payment
  5. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  6. urlRedirectFail - URL address, where the customer to be redirected after failed processing

The merchant creating payment link at USD and don't indicate crypto currencies for payment.

Example: Merchant wants to receive 1000 USD at any currencies

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120231",
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress",
"fiat": {
"amount": 1000,
"currency": "usd"
}
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. fiat.amount - Amount of transaction at fiat currency
  3. fiat.currency - Fiat currency for payment
  4. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  5. urlRedirectFail - URL address, where the customer to be redirected after falied processing

The merchant creating payment link, but don't indicated amount (at crypto or fiat), and indicated list of crypto currencies, available for payment

Example: Merchant wants to receive some amount ( which client put at payment link form), at selected, from merchant's side, crypto currencies.

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120232",
"code": [ "usdt", "eth", "btc", "usdt_trc20", "bnb", "zec" ],
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress"
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. code - Code of available currencies on payment link
  3. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  4. urlRedirectFail - URL address, where the customer to be redirected after failed processing

The merchant creating payment link, but don't indicate amount (at crypto or fiat) and list of crypto currencies

Example: Merchant wants to receive some amount ( which client put at payment link form) at any currencies

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120233",
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress"
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  3. urlRedirectFail - URL address, where the customer to be redirected after failed processing

The merchant creating payment link, but don't indicate amount (at crypto or fiat) and indicate receiving currency - BTC

Example: Merchant wants to receive some amount (which client put at payment link form) at BTC

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120234",
"code": [ "btc" ],
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress"
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. code - Code of invoice currency
  3. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  4. urlRedirectFail - URL address, where the customer to be redirected after failed processing

Additional settings

In some cases, you can enable or disable certain payment methods on the payment link using parameters methods

POST https://api.xamax.io/v1/payment-link HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"txId": "120231",
"methods": ["DIRECT"],
"urlRedirectSuccess": "https://YourUrlAddress",
"urlRedirectFail": "https://YourUrlAddress",
"fiat": {
"amount": 1000,
"currency": "usd"
}
}
Parameters
  1. txId - Unique transaction identifier of the merchant (platform)
  2. fiat.amount - Amount of transaction at fiat currency
  3. fiat.currency - Fiat currency for payment
  4. urlRedirectSuccess - URL address, where the customer to be redirected after success processing
  5. urlRedirectFail - URL address, where the customer to be redirected after failed processing
  6. methods - merchant can indicate, which payment methods will be available on payment link; (if the parameter will not using, XAMAX will show all available payment methods)
    • DIRECT - only crypto;
    • ONRAMP - only Card to Crypto(Card2Crypto) or Local methods to Crypto(Local2Crypto)

Adding list of countries

In case, if You've some restrictions by location or countries, You can set restrictions for these list of countries. We'll be check of country(location) by IP address of client

POST https://api.xamax.io/v1/merchant/preferences HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json

{
"preferences": [
{
"key": "restricted-country-list",
"value": "[\"AF\", \"AU\"]"
}
]
}
Parameters
  1. key - restricted-country-list
  2. value* - list of countries, for users which we should to return information about unsupported the country

* - The value is passed as an escaped json array, example [\"AE\", \"AD\", \"AF\"], all quotes are preceded by a slash

Remove list of countries

If You need to change and remove restrictions, You can use the method /v1/merchant/preferences/{key}

DELETE https://api.xamax.io/v1/merchant/preferences/restricted-country-list HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json