# Additional APIs

Some API endpoints are restricted to a limited number of partners. If you require access to functionality like charge creation, please contact us through the dashboard (opens new window).

A set of endpoints which could help you integrate with XanPay REST API.

# Translations

Returns user interface strings in the language corresponding to the requested locale

Endpoint GET /translations

Url parameters

Parameter Default Description
locale none locale you want to use

Available locales

Locale Language
en English
zh Chinese

Request example

curl 
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET}
"https://api.xanpay.com/translations?locale=en"

Response example

{
    "translation": {
        "mainPage": {
            "cancelled": "Your pending charge has been cancelled",
            "title": "You are paying",
            "country": {
                "label": "Country"
            },
            ...
}

# Payment methods

Returns the list of supported payment methods with their currencies.

Endpoint GET /methods

Request example

curl 
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET}
"https://api.xanpay.com/methods"

Response example

[
    {
        "country": "SG",
        "currency": "SGD",
        "methods": [
            {
                "method": "paynow",
                "max": 500,
                "name": "Paynow",
                "icon": "cdn path"
            },
        ...
        ]      
    },
    ...
]

# FX Conversion

Executes conversion between currencies based on XanPay rates.

Endpoint GET /forex

Url parameters

Parameter Default Description
sourceCurrency none Source currency
sourceAmount none Amount of being converted
destinationCurrency none Final currency

Request example

curl 
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET}
"https://api.xanpay.com/forex?sourceCurrency=HKD&sourceAmount=150&destinationCurrency=SGD"

Response example

{
   "amount": 26.25,
   "rate": 0.18    
}