Our checkout-link API returns a generated checkout-link customised based on parameters. You can use this link to direct customers to XanPay's interface for making the payment.
Required Fields
To successfully generate a checkout-link, only the "amount" and "currency" parameters are required. All other attributes are optional, and can be used for additional customisation.
Geo-Detection
Our checkout widget automatically detects a customer's geo-location, and presents the relevant country's payment methods to them. E.g. When a customer from Singapore is redirected to the XanPay checkout page, they will see Singapore in the "country" field, and see a list of payment options that includes PayNow and/or other methods available to Singapore.
Currency Conversion
Our widget automatically converts currencies for your customers. E.g. If your store lists item prices in AUD, but your customer is from Singapore, Malaysia etc., the original AUD amount of your item will be listed at the top, but the converted amount will be at the bottom of the widget, on the Pay button.
To learn more about the fees charged for currency conversions, please refer to this link.
Default Methods vs. Selected Methods
We have varied default payment methods available for every country. To check what payment methods are available for your account, please use the GET /methods endpoint.
How do I show all payment methods?
To show all payment methods by default, you only need to pass the "amount" and "currency" parameters in your checkout-link request body. Do not specify the "paymentMethods" attribute.
In this example below, as the customer is located in Singapore, the payment options presented are Singapore's local APM solution, PayNow, and all other default payment methods like Xan Wallet, Stellar USDC and USDT.
How do I show fiat-only payment methods?
To show only a selected set of payment methods, or in this case - fiat-only payment methods, you may specify the "paymentMethods" attribute with only each countries' local payment methods.
Here is an example of how you can specify the checkout-link's request body:
After the checkout-link has been generated successfully, you should see that your checkout page's payment options display only the local payment methods of the specified countries.
I only want to show 1 payment method at checkout, how can I do that?
You may do so by specifying the selected currency and the relevant country's local payment method in the "paymentMethods" attribute.
Here is an example of how the checkout-link request body can look like:
Autofill Customer Details
To improve your customers' checkout experience, you may choose to pass their email, phone country code, and mobile number into the "customer" parameter. After doing so, all they have to do at the checkout page is to verify their phone number by keying in the OTP sent to them. This significantly increases conversion for most of our merchants.
Here is an example of how the checkout-link request body can look like:
RedirectUrl
How do I redirect a customer back to my page after they have paid?
You may specify the "redirectUrl" parameter in the request body. It enables a button that takes the customer back to specified URL.
Here is an example of how the checkout-link request body can look like:
After clicking on "I have made my payment", the customer should be redirected to the specified URL. In that URL, the chargeID associated with the created charge will be displayed as well.
"orders" and "notifyPayload" Parameters
The "orders" parameter can be specified with the following attributes. Using the Order object, you can provide a list of orders for each charge. These orders will be displayed in the invoice sent to the customer.
The "notifyPayload" parameter is a custom string that can be saved as part of the charge object. If you want your endpoint to receive additional data, such as the your internal order identifier, you can set this parameter. Example: You wish to send an object e.g {"orderId": "251"}, you can convert it into a string by encoding into base64, e.g. "eyJvcmRlcklkIjogIjI1MSJ9". To learn more about how to use the "notifyPayload" parameter, please refer to this link.