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.
Creating crypto payment link
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
Flows for using of payment link
Payment link to classic crypto invoice
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
- Production
- Sandbox
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"
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- code - Code of invoice currency
- amount - Amount of transaction from merchant
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after failed processing
Payment link to classic crypto invoice, but at USD
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
- Production
- Sandbox
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"
}
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- code - Code of invoice currency
- fiat.amount - Amount of transaction at fiat currency
- fiat.currency - Fiat currency for payment
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after failed processing
Payment link to invoice at USD, with full list of crypto currencies
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
- Production
- Sandbox
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"
}
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- fiat.amount - Amount of transaction at fiat currency
- fiat.currency - Fiat currency for payment
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after falied processing
Payment link to invoice without amount, with not full list of crypto currencies
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.
- Production
- Sandbox
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"
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- code - Code of available currencies on payment link
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after failed processing
Payment link to invoice without amount, with full list of crypto currencies
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
- Production
- Sandbox
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"
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after failed processing
Payment link to invoice without amount with one crypto currency
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
- Production
- Sandbox
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"
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- code - Code of invoice currency
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after failed processing
Additional settings
Available payment methods on Payment Link
In some cases, you can enable or disable certain payment methods on the payment link using parameters methods
- Production
- Sandbox
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"
}
}
POST https://api.sandbox.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
- txId - Unique transaction identifier of the merchant (platform)
- fiat.amount - Amount of transaction at fiat currency
- fiat.currency - Fiat currency for payment
- urlRedirectSuccess - URL address, where the customer to be redirected after success processing
- urlRedirectFail - URL address, where the customer to be redirected after failed processing
- 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)
Unavailable countries on Payment Link
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
- Production
- Sandbox
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\"]"
}
]
}
POST https://api.sandbox.xamax.io/v1/merchant/preference HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
{
"preferences": [
{
"key": "restricted-country-list",
"value": "[\"AF\", \"AU\"]"
}
]
}
Parameters
- key - restricted-country-list
- 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}
- Production
- Sandbox
DELETE https://api.xamax.io/v1/merchant/preferences/restricted-country-list HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
DELETE https://api.sandbox.xamax.io/v1/merchant/preferences/restricted-country-list HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json