Public API

Get currency list.

get
https://api.okipays.com/v1/public/currency-list
curl --request GET \
--url '/v1/public/currency-list'

Success 200

Name Type Description
status boolean

Request status

data array

Array of payment currencies

id string

Currency Id

name string

Full name of currency

iso3 string

ISO code of currency

  HTTP/1.1 200 OK
{
    "status": true,
    "data": [
        {
            "id": 4,
            "name": "Dollar",
            "iso3": "USD"
            "decimal": 2
        },
        ...
    ],
    "token": "90b413637637634d1e3624ad545fa420a8879f9bdedd67a0hefb86c29c771e8e",
}

Get currency network list

get
https://api.okipays.com/v1/public/currency-network-list
curl --request GET \
--url '/v1/public/currency-network-list'

Success 200

Name Type Description
status boolean

Request status

data array

Array of crypto currencies

name string

Full name of crypto currency

icon string

Currency icon

networks array

Array of networks that can use when creating an invoice

network_id integer

Network ID

network_iso string

Network name

  HTTP/1.1 200 OK
{
    "status": true,
    "data": {
        "iso3": "USDT",
        "name": "Tether",
        "icon": "https://api.okipays.com/upload/files/image/svg/4/8/481e9018956fa31d4dfe16c18366ea32.svg",
        "data": [
            {
                "network": 1,
                "network_name"": "ETH"
            },
              {
                "network": 2,
                "network_name"": "TRX"
            },
              {
                "network": 4,
                "network_name"": "BSC"
            }
            ...
        ],
    },
    "token": "90b413637637634d1e3624ad545fa420a8879f9bdedd67a0hefb86c29c771e8e",
}

Private API

Adding values ​​with a secret and hashing: hash('sha256', parama_A + param_D + pamam_B + param_C + 123 + secret).

https://api.okipays.com/
Before sort:
{
  "request_id":123,
  "a":{
      "d":'param_D',
      "a":'param_A'
    },
  "c":'param_C',
  "b":'param_B'
}

After sort:
{
  "a":{
      "a":'param_A',
      "d":'param_D'
    },
  "b":'param_B',
  "c":'param_C',
  "request_id":123
}

Request params

Name Type Description
X-Auth-Token string

This is a token that is formed in merchant cabinet

X-Auth-Sign string

This algorithm forms a string by combining the request body and a secret. First, all keys of the request body object are sorted alphabetically. Next, all values of the object are merged into a single string, with the secret added at the end. The resulting string is then hashed using the sha256 method

Parameter request_id of each request must be more than previous. You can take time in timestamp as request_id for example.

https://api.okipays.com/
post
https://api.okipays.com/v1/order/create
curl --request POST \ 
  --url `https://api.okipays.com/v1/order/create` \
  --header 'content-type: application/json' \ 
  --header 'X-Auth-Token: XXXXXX' \ 
  --header 'X-Auth-Sign: XXXXXX' \ 
  --data '{"request_id": "1610097140116", "order_id": 123, "payment_currency_iso": "USD", "price": 15, "include_commission": 1, "description": "description", "currencies": [{ "iso": "USDT", "network": 1 }, { "iso": "BTC", "network": 0 }, … ], "time_expired": 1676525820 } \

Request params

Name Type Description
request_id integer

A unique request identifier is required, and it must be greater than any previous request identifiers used. For example, you can use the current time in timestamp format as the value for the request_id

order_id integer

Your merchant internal order ID is a required parameter and must be unique

payment_currency_iso string

The currency ISO3 code is a required parameter. To view a list of all available payment currencies, please refer to the public endpoint 'Get Currency List'

price float

Amount in a payment currency

include_commission integer

Has to be 1 or 0

description string

Invoice description

time_expired timestamp

Time in timestamp format when invoice set to expired

currencies array

The endpoint 'Get Currency Network List' provides a list of all allowed cryptocurrency networks. This parameter is optional - if the request does not include this array, the invoice will provide all allowed cryptocurrency networks by default

iso string

Cryptocurrency network_iso

network integer

Cryptocurrency network

Success 200

Name Type Description
status boolean

Status of the operation (true/false)

message string

Success or error message

data object

Object with order data

id integer

Invoice id

order_id integer

Your merchant internal order_id

status string

Created

Partially

Completed

Cancelled

Pay Failed

Error

In Process

Expired

Paid

Deleted

Overpayment

status_id integer

0 - Created

1 - Partially

2 - Completed

3 - Cancelled

4 - Pay Failed

5 - Error

6 - In Process

7 - Expired

8 - Paid

9 - Deleted

10 - Overpayment

price float

Amount in a payment currency

payment_currency_iso string

The payment ISO3 currencies code

include_commission integer

Include commission status

description string

Invoice description

link string

Link to the page to continue the order

currencies array

List of all allowed cryptocurrency networks

token string

Token of authorization

 HTTP/1.1 200 OK
{
   "status": true,
   "message": "Success send request to create order",
   "data": {
       "id": "4JWOUAGY",
       "order_id": 2,
       "status": Created,
       "status_id": 0,
       "price": "15",
       "payment_currency_iso": "USD",
       "include_commission": 1,
       "description": "description",
       "link": "https://api.okipays.comcheckout/4JWOUAGY",
       "currencies": [
           {
               "iso": "USDT",
               "network": 1
           },
           {
               "iso": "BTC",
               "network": 0
           }
       ]
   },
   "token": "90b413637637634d1e3624ad545fa420a8879f9bdedd67a0hefb86c29c771e8e"
}
 HTTP/1.1 400 BadRequest
{
    "name": "Bad Request",
    "message": "Currency not available",
    "code": -1,
    "status": 400
}
post
https://api.okipays.com/v1/order/get
curl --request POST \ 
  --url `https://api.okipays.com/v1/order/get` \
  --header 'content-type: application/json' \ 
  --header 'X-Auth-Token: XXXXXX' \ 
  --header 'X-Auth-Sign: XXXXXX' \ 
  --data '{"request_id": "1610097140116", "order_id": 123 } \

Request params

Name Type Description
request_id integer

A unique request identifier is required, and it must be greater than any previous request identifiers used. For example, you can use the current time in timestamp format as the value for the request_id

order_id integer

Your merchant internal order_id

Success 200

Name Type Description
status boolean

Status of the operation (true/false)

message string

Success or error message

data object

Object with order data

id integer

Invoice id

order_id integer

Your merchant internal order_id

status string

Created

Partially

Completed

Cancelled

Pay Failed

Error

In Process

Expired

Paid

Deleted

Overpayment

status_id integer

0 - Created

1 - Partially

2 - Completed

3 - Cancelled

4 - Pay Failed

5 - Error

6 - In Process

7 - Expired

8 - Paid

9 - Deleted

10 - Overpayment

price float

Amount in a payment currency

payment_currency_iso string

The payment ISO3 currencies code

include_commission integer

Include commission status

description string

Invoice description

link string

Link to the page to continue the order

currencies array

List of all allowed cryptocurrency networks

token string

Token of authorization

 HTTP/1.1 200 OK
{
   "status": true,
   "message": "Success get order data.",
   "data": {
       "id": "4JWOUAGY",
       "order_id": 2,
       "status": Created,
       "status_id": 0,
       "price": "15",
       "payment_currency_iso": "USD",
       "include_commission": 1,
       "description": "description",
       "link": "https://api.okipays.comcheckout/4JWOUAGY",
       "currencies": [
           {
               "iso": "USDT",
               "network": 1
           },
           {
               "iso": "BTC",
               "network": 0
           }
       ]
   },
   "token": "90b413637637634d1e3624ad545fa420a8879f9bdedd67a0hefb86c29c771e8e"
}
 HTTP/1.1 400 BadRequest
{
    "status": false,
    "error": "Required order_id",
    "code": 19,
    "token": "90b4136376376c1e1624ad545fa420a88a9f9bdd67a06c4b86c29c771e8e"
}
 HTTP/1.1 400 BadRequest
{
    "status": false,
    "error": "Order not found",
    "code": 14,
    "token": "90b4136376376c1e1624ad545fa420a88a9f9bdd67a06c4b86c29c771e8e"
}

Merchant API

Result URL

It receives a notification about a change in the status or amount of payment on an invoice

{
  "id": "4JWOUAGY", 
  "order_id": 3053, 
  "currency": "BTC", 
  "payment_currency": "USD", 
  "status": "Partially", 
  "status_id": 0, 
  "include_commissin": 1, 
  "amount": "0.00003243", 
  "amount_send": "0.00003243", 
  "price": "34", 
  "price_send": "34", 
  "rate": "1048229", 
  "total_sum_price": "12". 
  "commission": 0, 
  "address": "XXXXXXX", 
  "network_type": "Main", 
  "time_create": 1610716246, 
  "time_update": 1610716300, 
  "time_done": 1637931315, 
  "time_expired": 1637931315 
  "time_send": 1637931315 
  "time_receive": 1637931315 
}

Parameter

Name Type Description
id integer

Invoice ID

order_id interger

Your merchant internal order ID

currency string

Crypto currency ISO

payment_currency string

Payment currency ISO

status string

Created

Partially

Completed

Cancelled

Pay Failed

Error

In Process

Expired

Paid

Deleted

Overpayment

status_id integer

0 - Created

1 - Partially

2 - Completed

3 - Cancelled

4 - Pay Failed

5 - Error

6 - In Process

7 - Expired

8 - Paid

9 - Deleted

10 - Overpayment

include_commission integer

0 – commission isn’t included

1 – commission is included

amount float

Amount in cryptocurrency.

Included commission if include_commission = 1

amount_send float

Amount in cryptocurrency.

Does not include commission if include_commission = 1

price float

Amount in a payment currency

price_send float

Amount in a payment currency.

If include_commission = 1 price exclude network commission else equals to price

rate integer

Cryptocurrency rate

total_sum_price float

Total receive amount in payment currency

commission float

Network commission

address string

Cryptocurrency address

network_type string

Cryptocurrency network name

time_create timestamp

Time when invoice created

time_update timestamp

Time when invoice updated

time_done timestamp

Time when invoice done

time_expired timestamp

Time when invoice expired

time_send timestamp

Time Send Data to External Merchant

time_receive timestamp

Time Receive Status from External Merchant

In this case, you need to return the answer. if successfully accepted then the order will go to the closed status {"status":"done"} if the order is not successful, the status will change to canceled {"status":"cancel"}

Our website is using cookies to provide you with service of the highest quality as possible, analyze our traffic, and for security and marketing purposes. You agree to our use of cookies by visiting our website. Read more about cookies