Internal Payment API

How to use OxaPay internal payment API?

With the help of OxaPay internal payment API, you can mass fund transfers to other OxaPay users with zero fees automatically. Also, this is appropriate for webmasters who have micropayment to their users. Create an API and follow the steps below.
To use the internal payment API endpoint, you must first log in to your account and generate your API key in the Payment API section.
To generate a new API, observe the following points:
  1. 1.
    You can define some IP addresses that only requests sent from these addresses are validated. It is recommended to do this to increase the security of your account and API keys.
  2. 2.
    The Total daily transfer limit field is used to limit the transfer amount in the last 24 hours. Note that this amount is defined in dollars and when transferring different currencies, their dollar equivalents are included.
  3. 3.
    The Transfer limit per transaction field is defined in dollars to create a limit for each transfer transaction.

Send endpoint

This endpoint is called to send the assets in your wallet balance to another account.
post
https://api.oxapay.com
/api/send
Parameters
Body
key*
String
Require for authentication
currency*
String
Currency for transfer
amount*
Long
Currency amount
address*
String
OxaPay wallet address of receiver (Always must start with OXA)
description
String
description of transaction (maximum 200 characters)
Responses
200: OK
Sample JSON you sent to this endpoint
{
"key": "xxx",
"currency": "btc",
"amount": 0.002,
"address": "OXActMf2EVzRCqSmpy2cMguzgc"
"description": "Hello World!"
}

Result table

100
Successful operation
101
Validating problem
102
Entered key is incorrect
103
Disable key
104
The receiver address is incorrect or is not found
105
The receiver address is yours
106
No selected currency
107
Entered currency is incorrect
108
The amount entered is incorrect or less than $0.1
109
Transfer limit per transaction
110
Total daily transfer limit error
111
Total daily transfer limit will be reached by this transaction
115
Invalid IP
120
Insufficent balance

Sample code

php
Node.js
Python
<?php
if($_GET['success'] == 1) {
$params = array(
'key' => 'xxx',
'currency' => "btc",
'amount' => 0.002,
'address' => "OXActMf2EVzRCqSmpy2cMguzgc",
'description' => "Hello World!"
);
$url = 'https://api.oxapay.com/api/send';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$res = json_decode($res);
if ($res->result == 100) {
var_dump($res);
// store $res->trackId data
}
else{
echo "errorCode: ".$res->result."<br>";
echo "message: ".$res->message;
}
}
?>
var request = require('request-promise');
var params = {
key: 'xxx',
currency: "btc",
amount: 0.002,
address: "OXActMf2EVzRCqSmpy2cMguzgc",
description: "Hello World!"
};
var options = {
method: "POST",
url: "https://api.oxapay.com/api/send",
headers: {
'cache-control': 'no-cache',
'content-type': 'application/json'
},
body: params,
json: true
};
request(options)
.then(function (res) {
if (res.result == 100) {
// store to result.trackId url
}
})
import requests
params = {
'key': 'xxx',
'currency': "btc",
'amount': 0.002,
'address': "OXActMf2EVzRCqSmpy2cMguzgc",
'description': "Hello World!"
}
url = "https://api.oxapay.com/api/send"
response = requests.post(url = url, json= params)
res = response.json()
if res['result'] == 100:
# store res['trackId']

Currencies endpoint

This endpoint is called to query the currencies supported by OxaPay.
post
https://api.oxapay.com
/api/currencies
Parameters
Body
key*
String
Require for authentication
Responses
200: OK
Sample JSON you sent to this endpoint
{
"key": "xxx"
}

Result table

100
Successful operation
101
Validating problem
102
Entered key is incorrect
103
Disable key
115
Invalid IP
Last modified 3d ago