### Code Examples for Fetching Supported Fiat Currencies Source: https://docs.oxapay.com/api-reference/common These code examples demonstrate how to programmatically access the `GET /v1/common/fiats` endpoint using various popular programming languages and tools. Each example shows the basic structure for making an HTTP GET request and processing the API response. ```cURL curl -X GET https://api.oxapay.com/v1/common/fiats ``` ```PHP array( 'method' => 'GET' ) ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```Node.js const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/fiats'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```Python import requests url = 'https://api.oxapay.com/v1/common/fiats' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### OxaPay Supported Networks API Request Examples Source: https://docs.oxapay.com/api-reference/common/supported-networks Provides practical code examples demonstrating how to make a GET request to the OxaPay 'Supported Networks' endpoint. Examples are provided in cURL, PHP, Node.js (using Axios), and Python (using Requests) to illustrate common client implementations. ```bash curl -X GET https://api.oxapay.com/v1/common/networks ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/networks'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/networks' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### Retrieve Supported Currencies API Request Examples Source: https://docs.oxapay.com/api-reference/common These code snippets demonstrate how to make a GET request to the 'Supported Currencies' endpoint using various programming languages. They illustrate the basic setup required to fetch the list of cryptocurrencies and their network details from the Oxapay API. ```bash curl -X GET https://api.oxapay.com/v1/common/currencies ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/currencies'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/currencies' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### OxaPay System Status API Request Examples Source: https://docs.oxapay.com/api-reference/common Demonstrates how to make a GET request to the OxaPay System Status API endpoint using cURL, PHP, Node.js (with Axios), and Python (with Requests). These examples show basic API interaction. ```bash curl -X GET https://api.oxapay.com/v1/common/monitor ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/monitor'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/monitor' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### Fetch Oxapay Swap Pairs API Data with Authentication Source: https://docs.oxapay.com/api-reference/swap These code examples demonstrate how to make a GET request to the Oxapay `/v1/general/swap/pairs` endpoint using various programming languages. Each example shows how to include the `general_api_key` in the request header for authentication, which is mandatory for accessing the API. ```bash curl -X GET https://api.oxapay.com/v1/general/swap/pairs \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" ``` ```PHP array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```JavaScript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap/pairs'; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```Python import requests url = 'https://api.oxapay.com/v1/general/swap/pairs' headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Retrieve Payout Information API Request Samples Source: https://docs.oxapay.com/api-reference/payout/payout-information These code examples demonstrate how to programmatically make a GET request to the Oxapay Payout Information API using various programming languages. Each snippet shows how to construct the API call, include the necessary 'payout_api_key' in the headers, and handle the response. ```bash curl -X GET https://api.oxapay.com/v1/payout/{track_id}\ -H "payout_api_key: YOUR_PAYOUT_API_KEY" \ -H "Content-Type: application/json" ``` ```php array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const track_id = 'TRACK_ID'; const url = `https://api.oxapay.com/v1/payout/${track_id}`; const headers = { 'payout_api_key': `YOUR_PAYOUT_API_KEY `, 'Content-Type': 'application/json' }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json track_id = 'TRACK_ID' url = f'https://api.oxapay.com/v1/payout/{track_id}' headers = { 'payout_api_key': 'YOUR_PAYOUT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Retrieve Payout History API Request Examples Source: https://docs.oxapay.com/api-reference/payout Collection of code examples demonstrating how to make a GET request to the OxaPay Payout API's `/v1/payout` endpoint. These examples show how to include pagination parameters (`size`, `page`) and required headers (`payout_api_key`, `Content-Type`). Users must replace `YOUR_PAYOUT_API_KEY` with their actual key. ```bash curl -X GET "https://api.oxapay.com/v1/payout/?size=20&page=1" \ -H "payout_api_key: YOUR_PAYOUT_API_KEY" \ -H "Content-Type: application/json" ``` ```php 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'payout_api_key: YOUR_PAYOUT_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payout/'; const params = { size: 20, page: 1 }; const headers = { 'payout_api_key': `YOUR_PAYOUT_API_KEY`, 'Content-Type': 'application/json' }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payout/' params = { 'size': 20, 'page': 1 } headers = { 'payout_api_key': 'YOUR_PAYOUT_API_KEY ', 'Content-Type': 'application/json' } response = requests.get(url, params=params , headers=headers) result = response.json() print(result) ``` -------------------------------- ### Sample API Request Codes for Supported Fiat Currencies Source: https://docs.oxapay.com/api-reference/common/supported-fiat-currencies Provides practical code examples demonstrating how to make a GET request to the /v1/common/fiats endpoint using various programming languages and tools. These snippets illustrate how to fetch the list of supported fiat currencies and process the API response. ```bash curl -X GET https://api.oxapay.com/v1/common/fiats ``` ```php array( 'method' => 'GET' ) ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/fiats'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/fiats' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### Sample API Requests for OxaPay Payment History Source: https://docs.oxapay.com/api-reference/payment Provides practical code examples in various programming languages (cURL, PHP, Node.js, Python) to demonstrate how to send a GET request to the OxaPay payment history endpoint. These examples illustrate how to include necessary headers and query parameters for pagination. ```bash curl -X GET "https://api.oxapay.com/v1/payment/?size=20&page=1" \ -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \ -H "Content-Type: application/json" ``` ```php 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'merchant_api_key: YOUR_MERCHANT_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payment/'; const params = { size: 20, page: 1 }; const headers = { 'merchant_api_key': `YOUR_MERCHANT_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payment/' params = { 'size': 20, 'page': 1 } headers = { 'merchant_api_key': 'YOUR_MERCHANT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, params=params , headers=headers) result = response.json() print(result) ``` -------------------------------- ### Oxapay Swap Calculate API Successful Response Example Source: https://docs.oxapay.com/api-reference/swap Shows a concrete example of a successful response from the Oxapay Swap Calculate API, including actual values for the swapped amount, rate, and status. This helps in understanding the format and content of a typical successful API response. ```JSON { "data": { "to_amount": 94763.06, "rate": 94763.06000000, "amount": 1 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Sample Code for GET /v1/common/currencies Endpoint Source: https://docs.oxapay.com/api-reference/common/supported-currencies These code examples demonstrate how to programmatically make a GET request to the Oxapay 'Supported Currencies' API endpoint using cURL, PHP, Node.js (with Axios), and Python (with Requests library). ```bash curl -X GET https://api.oxapay.com/v1/common/currencies ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/currencies'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/currencies' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### Initial API Response Example for OxaPay Prices Source: https://docs.oxapay.com/api-reference/common Demonstrates the typical JSON structure and content returned by the OxaPay `/v1/common/prices` endpoint upon a successful request, showing various cryptocurrency balances. ```json { "data": { "BNB": 0.0000000000, "DGB": 0.0000000000, "XMR": 0.0000000000, "BTC": 0.3502949200, "ETH": 0.0000000000, "USDC": 0.0000000000, "POL": 0.0000000000, "SOL": 0.0000000000, "NOT": 0.0000000000, "SHIB": 0.0000000000, "TRX": 0.0000000000, "USDT": 1074682.7139400000, "DOGS": 0.0000000000, "TON": 0.0000000000, "BCH": 0.0000000000, "DOGE": 0.0000000000, "LTC": 0.0000000000 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Second API Response Example for OxaPay Prices Source: https://docs.oxapay.com/api-reference/common An additional JSON response example from the OxaPay `/v1/common/prices` endpoint, providing another instance of the data structure with different cryptocurrency price values. ```json { "data": { "DOGE": 0.3341700000, "BNB": 695.7900000000, "XMR": 198.4200000000, "BTC": 94876.5500000000, "ETH": 3301.4500000000, "USDC": 1.0001000000, "POL": 0.4591000000, "SOL": 191.3500000000, "NOT": 0.0059799000, "SHIB": 0.0000216300, "TRX": 0.2422000000, "USDT": 1.0000000000, "DOGS": 0.0004590000, "TON": 5.2515000000, "BCH": 433.5000000000, "DGB": 0.0124400000, "LTC": 103.9900000000 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.3" } ``` -------------------------------- ### Sample Code for Retrieving Cryptocurrency Prices Source: https://docs.oxapay.com/api-reference/common/prices Provides example code snippets in cURL, PHP, Node.js, and Python demonstrating how to make a GET request to the OxaPay 'Prices' API endpoint. ```bash curl -X GET https://api.oxapay.com/v1/common/prices ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/prices'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/prices' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### Retrieve Account Balance - Multi-language Examples Source: https://docs.oxapay.com/api-reference/common Sample code snippets demonstrating how to make a GET request to the Oxapay Account Balance API endpoint using cURL, PHP, Node.js, and Python. These examples show how to include the required `general_api_key` in the request header to authenticate the call and retrieve wallet balance details. ```bash curl -X GET https://api.oxapay.com/v1/general/account/balance \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" ``` ```php array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/account/balance'; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/general/account/balance' headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Requesting Swap Pairs Endpoint with Various Languages Source: https://docs.oxapay.com/api-reference/swap/swap-pairs Example code snippets demonstrating how to make a GET request to the Oxapay 'Swap Pairs' endpoint using cURL, PHP, Node.js (with Axios), and Python (with Requests). These examples show how to include the 'general_api_key' in the request header. Remember to replace 'YOUR_GENERAL_API_KEY' with your actual key. ```cURL curl -X GET https://api.oxapay.com/v1/general/swap/pairs \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" ``` ```PHP array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```Node.js const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap/pairs'; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json' }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```Python import requests url = 'https://api.oxapay.com/v1/general/swap/pairs' headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Example of Successful OxaPay Swap Rate API Response Source: https://docs.oxapay.com/api-reference/swap/swap-rate A JSON example illustrating the structure and content of a successful response from the OxaPay Swap Rate API. It shows the 'data' object containing the 'rate', along with 'message', 'error' (empty for success), 'status', and 'version' fields. ```json { "data": { "rate": 94763.06000000 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### OxaPay System Status API Successful Response Example Source: https://docs.oxapay.com/api-reference/common An example of a successful JSON response from the OxaPay System Status API, illustrating the expected data format and values for an operational status. ```json { "data": { "status": true }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Request OxaPay Swap Rate API with cURL, PHP, Node.js, and Python Source: https://docs.oxapay.com/api-reference/swap/swap-rate Example code snippets demonstrating how to make a POST request to the OxaPay Swap Rate API endpoint using various programming languages. These examples illustrate how to include the 'general_api_key' in the header and pass the 'from_currency' and 'to_currency' in the JSON request body. ```bash curl -X POST https://api.oxapay.com/v1/general/swap/rate \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from_currency": "USDT", "to_currency": "TRX" }' ``` ```php "USDT", "to_currency" => "TRX" ]; $headers = [ 'Content-Type: application/json', 'general_api_key: YOUR_GENERAL_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'POST', 'content' => json_encode($data), ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap/rate'; const data = { from_currency: "USDT", to_currency: "TRX" }; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json' }; axios.post(url, data, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/general/swap/rate' data = { "from_currency": "USDT", "to_currency": "TRX" } headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.post(url, data=json.dumps(data), headers=headers) result = response.json() print(result) ``` -------------------------------- ### Example JSON Response for Cryptocurrency Prices Source: https://docs.oxapay.com/api-reference/common/prices A concrete example of the JSON data returned by the OxaPay 'Prices' API endpoint, illustrating the structure and typical values for various cryptocurrencies. ```json { "data": { "DOGE": 0.3341700000, "BNB": 695.7900000000, "XMR": 198.4200000000, "BTC": 94876.5500000000, "ETH": 3301.4500000000, "USDC": 1.0001000000, "POL": 0.4591000000, "SOL": 191.3500000000, "NOT": 0.0059799000, "SHIB": 0.0000216300, "TRX": 0.2422000000, "USDT": 1.0000000000, "DOGS": 0.0004590000, "TON": 5.2515000000, "BCH": 433.5000000000, "DGB": 0.0124400000, "LTC": 103.9900000000 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.3" } ``` -------------------------------- ### Retrieve Account Balance using Python Requests Source: https://docs.oxapay.com/api-reference/common/account-balance Provides a Python code example demonstrating how to make a GET request to the Oxapay Account Balance API using the popular `requests` library. It includes setting the 'general_api_key' header for authentication and parsing the JSON response. ```python import requests url = 'https://api.oxapay.com/v1/general/account/balance' headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Request Static Address List API Source: https://docs.oxapay.com/api-reference/payment This section provides code examples in multiple programming languages (cURL, PHP, Node.js, Python) to demonstrate how to make a GET request to the Oxapay API's `/v1/payment/static-address` endpoint. The request includes pagination parameters (`size` and `page`) and requires a `merchant_api_key` for authentication. The examples show how to set headers and handle the API response. ```bash curl -X GET "https://api.oxapay.com/v1/payment/static-address?size=20&page=1" \ -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \ -H "Content-Type: application/json" ``` ```php 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'merchant_api_key: YOUR_MERCHANT_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payment/static-address'; const params = { size: 20, page: 1 }; const headers = { 'merchant_api_key': `YOUR_MERCHANT_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payment/static-address' params = { 'size': 20, 'page': 1 } headers = { 'merchant_api_key': 'YOUR_MERCHANT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, params=params , headers=headers) result = response.json() print(result) ``` -------------------------------- ### Requesting OxaPay Prices Endpoint in Multiple Languages Source: https://docs.oxapay.com/api-reference/common Provides practical code examples for making a GET request to the OxaPay `/v1/common/prices` API endpoint using cURL, PHP, Node.js (Axios), and Python (Requests library) to retrieve cryptocurrency prices. ```bash curl -X GET https://api.oxapay.com/v1/common/prices ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/prices'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/prices'; response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### OxaPay API System Status Response Example Source: https://docs.oxapay.com/api-reference/common/system-status Provides a concrete JSON example of a successful response from the OxaPay API system status endpoint. This illustration helps users understand the typical structure and values for data, message, error, status, and version fields returned by the API. ```json { "data": { "status": true }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Request OxaPay System Status Endpoint Across Languages Source: https://docs.oxapay.com/api-reference/common/system-status Demonstrates how to make a GET request to the OxaPay API system status endpoint using various programming languages and tools. These examples show how to connect to the API and handle the response in cURL, PHP, Node.js (Axios), and Python (Requests) environments. ```bash curl -X GET https://api.oxapay.com/v1/common/monitor ``` ```php array( 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/common/monitor'; axios.get(url) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests url = 'https://api.oxapay.com/v1/common/monitor' response = requests.get(url) result = response.json() print(result) ``` -------------------------------- ### Example Response for Oxapay Swap Calculate API Source: https://docs.oxapay.com/api-reference/swap/swap-calculate This JSON snippet illustrates the expected structure and content of a successful response from the Oxapay '/v1/general/swap/calculate' API endpoint, showing the calculated 'to_amount', 'rate', and 'amount' along with status information. ```json { "data": { "to_amount": 94763.06, "rate": 94763.06000000, "amount": 1 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### OxaPay Supported Networks API Successful Response Example Source: https://docs.oxapay.com/api-reference/common/supported-networks Illustrates a typical successful JSON response from the OxaPay 'Supported Networks' API endpoint. This example shows the structure of the `data` field containing the list of network names, along with `message`, `error`, `status`, and `version` fields. ```json { "data": { "list": [ "Bitcoin Network", "Ethereum Network", "Tron Network", "Binance Smart Chain", "Dogecoin Network", "Solana Network", "Polygon Network", "Litecoin Network", "DigiByte Network", "Monero Network", "TON Network", "Bitcoin Cash Network", "Base" ] }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Retrieve Swap History from Oxapay API Source: https://docs.oxapay.com/api-reference/swap Demonstrates how to make a GET request to the Oxapay API's /v1/general/swap endpoint to retrieve swap history. It includes examples in cURL, PHP, Node.js, and Python, showing how to set query parameters like 'size' and 'page' and include the 'general_api_key' header. Remember to replace YOUR_GENERAL_API_KEY with your actual key. ```cURL curl -X GET "https://api.oxapay.com/v1/general/swap/?size=20&page=1" \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" ``` ```PHP 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'general_api_key: YOUR_GENERAL_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```Node.js const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap/'; const params = { size: 20, page: 1 }; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json' }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```Python import requests url = 'https://api.oxapay.com/v1/general/swap/' params = { 'size': 20, 'page': 1 } headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, params=params, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Example of a Successful Payout API Response Source: https://docs.oxapay.com/api-reference/payout Provides a concrete example of a successful JSON response from the Oxapay Payout API, illustrating typical values for `track_id`, `address`, `currency`, `amount`, `status`, and other fields. This helps in understanding the actual data format returned by the API. ```json { "data": { "track_id": "258298351", "address": "1AmH3Qz2LooYa1YSyLhySuatwoRMsfznPJ", "currency": "BTC", "network": "Bitcoin Network", "amount": 0.0200000000, "fee": 0.0000100000, "status": "processing", "tx_hash": "", "description": "test", "internal": false, "memo": "test", "date": 1736501470 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Oxapay Account Balance API Successful Response Example Source: https://docs.oxapay.com/api-reference/common/account-balance An example of a successful JSON response returned by the Oxapay Account Balance API. It showcases the structure of the 'data' field containing various currency balances, along with the message, error object, status, and version fields. ```json { "data": { "BNB": 0.0000000000, "DGB": 0.0000000000, "XMR": 0.0000000000, "BTC": 0.3502949200, "ETH": 0.0000000000, "USDC": 0.0000000000, "POL": 0.0000000000, "SOL": 0.0000000000, "NOT": 0.0000000000, "SHIB": 0.0000000000, "TRX": 0.0000000000, "USDT": 1074682.7139400000, "DOGS": 0.0000000000, "TON": 0.0000000000, "BCH": 0.0000000000, "DOGE": 0.0000000000, "LTC": 0.0000000000 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Request Swap Rate using Node.js with Axios Source: https://docs.oxapay.com/api-reference/swap Node.js example using the Axios library to send a POST request to the OxaPay Swap Rate endpoint. It shows how to include authentication headers and handle the JSON response or errors. ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap/rate'; const data = { from_currency: "USDT", to_currency: "TRX", }; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json', }; axios.post(url, data, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` -------------------------------- ### API Response Example for Cryptocurrency Data Source: https://docs.oxapay.com/api-reference/common This JSON snippet illustrates the typical structure of an API response providing detailed information for various cryptocurrencies. It includes data points such as the cryptocurrency symbol, full name, current status, and a breakdown of network-specific attributes like required confirmations, withdrawal fees, minimum withdrawal amounts, minimum deposit amounts, and static fixed fees. Please note that the provided JSON is a partial example and may be truncated. ```json { "data": { "BTC": { "symbol": "BTC", "name": "Bitcoin", "status": true, "networks": { "Bitcoin": { "network": "Bitcoin", "name": "Bitcoin Network", "required_confirmations": 2, "withdraw_fee": 0.01, "withdraw_min": 1.0e-5, "deposit_min": 1.0e-6, "static_fixed_fee": 2 } } }, "ETH": { "symbol": "ETH", "name": "Ethereum", "status": true, "networks": { "Ethereum": { "network": "Ethereum", "name": "Ethereum Network", "required_confirmations": 10, "withdraw_fee": 0.0011, "withdraw_min": 0.00011, "deposit_min": 1.0e-6, "static_fixed_fee": 1 }, "Base": { "network": "Base", "name": "Base", "required_confirmations": 10, "withdraw_fee": 0.0017, "withdraw_min": 0.0001, "deposit_min": 1.0e-6, "static_fixed_fee": 0 } } }, "USDT": { "symbol": "USDT", "name": "Tether", "status": true, "networks": { "Ethereum": { "network": "Ethereum", "name": "Ethereum Network", "required_confirmations": 10, "withdraw_fee": 8, "withdraw_min": 1, "deposit_min": 1.0e-6, "static_fixed_fee": 0 }, "Tron": { "network": "Tron", "name": "Tron Network", "required_confirmations": 10, "withdraw_fee": 1, "withdraw_min": 0.01, "deposit_min": 1.0e-6, "static_fixed_fee": 0 }, "BSC": { "network": "BSC", "name": "Binance Smart Chain", "required_confirmations": 15, "withdraw_fee": 0.25, "withdraw_min": 0.01, "deposit_min": 1.0e-6, "static_fixed_fee": 0 }, "Polygon": { "network": "Polygon", "name": "Polygon Network", "required_confirmations": 250, "withdraw_fee": 1, "withdraw_min": 0.01, "deposit_min": 1.0e-6, "static_fixed_fee": 0 }, "TON": { "network": "TON", "name": "TON Network", "required_confirmations": 3, "withdraw_fee": 1, "withdraw_min": 1, "deposit_min": 1.0e-6, "static_fixed_fee": 0 } } }, "USDC": { "symbol": "USDC", "name": "USD Coin", "status": true, "networks": { "Ethereum": { "network": "Ethereum", "name": "Ethereum Network", "required_confirmations": 10, "withdraw_fee": 8, "withdraw_min": 5, "deposit_min": 1.0e-6, "static_fixed_fee": 0 } } }, "BNB": { "symbol": "BNB", "name": "BNB", "status": true, "networks": { "BSC": { "network": "BSC", "name": "Binance Smart Chain", "required_confirmations": 15, "withdraw_fee": 5.0e-5, "withdraw_min": 0.0004, "deposit_min": 1.0e-6, "static_fixed_fee": 0 } } }, "DOGE": { "symbol": "DOGE", "name": "Dogecoin", "status": true, "networks": { "Dogecoin": { "network": "Dogecoin", "name": "Dogecoin Network", "required_confirmations": 12, "withdraw_fee": 0.01, "withdraw_min": 0.0001, "deposit_min": 1.0e-6, "static_fixed_fee": 0 } } }, "POL": { "symbol": "POL", "name": "Polygon", "status": true, "networks": { ``` -------------------------------- ### Accepted Currencies API Response Example Source: https://docs.oxapay.com/api-reference/payment Illustrates the expected JSON structure and data returned by the /v1/payment/accepted-currencies API endpoint upon a successful request, showing a list of supported cryptocurrencies and general response metadata. ```json { "data": { "list": [ "BTC", "ETH", "USDT", "USDC", "BNB", "DOGE" ] }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Request Swap Rate using cURL Source: https://docs.oxapay.com/api-reference/swap Example cURL command to send a POST request to the OxaPay Swap Rate endpoint. It includes setting the General API Key in the header and providing 'from_currency' and 'to_currency' in the JSON request body. ```bash curl -X POST https://api.oxapay.com/v1/general/swap/rate \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from_currency": "USDT", "to_currency": "TRX" }' ``` -------------------------------- ### Retrieve Account Balance using cURL Source: https://docs.oxapay.com/api-reference/common/account-balance Demonstrates how to make a GET request to the Oxapay Account Balance API using the cURL command-line tool. It includes setting the 'general_api_key' for authentication and specifying the 'Content-Type' header. ```bash curl -X GET https://api.oxapay.com/v1/general/account/balance \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" ``` -------------------------------- ### Retrieve Payout History via GET Request Source: https://docs.oxapay.com/api-reference/payout/payout-history This snippet provides examples in various programming languages for making a GET request to the OXPAY Payout API's `/v1/payout/` endpoint. It demonstrates how to include pagination parameters (`size`, `page`) and the necessary `payout_api_key` for authentication to fetch payout transaction history. ```bash curl -X GET "https://api.oxapay.com/v1/payout/?size=20&page=1" \ -H "payout_api_key: YOUR_PAYOUT_API_KEY" \ -H "Content-Type: application/json" ``` ```php 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'payout_api_key: YOUR_PAYOUT_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payout/'; const params = { size: 20, page: 1 }; const headers = { 'payout_api_key': `YOUR_PAYOUT_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payout/' params = { 'size': 20, 'page': 1 } headers = { 'payout_api_key': 'YOUR_PAYOUT_API_KEY ', 'Content-Type': 'application/json' } response = requests.get(url, params=params , headers=headers) result = response.json() print(result) ``` -------------------------------- ### Retrieve Oxapay Payment Information via GET Request Source: https://docs.oxapay.com/api-reference/payment/payment-information This snippet provides multi-language examples for fetching payment details from the Oxapay API's `/v1/payment/{track_id}` endpoint. It demonstrates how to set the `merchant_api_key` header for authentication and parse the JSON response. Examples include cURL, PHP, Node.js (Axios), and Python (Requests). ```bash curl -X GET https://api.oxapay.com/v1/payment/{track_id}\ -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \ -H "Content-Type: application/json" ``` ```php array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const track_id = 'TRACK_ID'; const url = `https://api.oxapay.com/v1/payment/${track_id}`; const headers = { 'merchant_api_key': `YOUR_MERCHANT_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json track_id = 'TRACK_ID' url = f'https://api.oxapay.com/v1/payment/{track_id}' headers = { 'merchant_api_key': 'YOUR_MERCHANT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Oxapay Swap Calculate API Request Sample Codes Source: https://docs.oxapay.com/api-reference/swap Provides sample code snippets for making a POST request to the Oxapay Swap Calculate API endpoint using cURL, PHP, Node.js, and Python. These examples demonstrate how to send the required amount, from_currency, and to_currency parameters to calculate a currency swap. ```bash curl -X POST https://api.oxapay.com/v1/general/swap/calculate \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 12, "from_currency": "USDT", "to_currency": "TRX" }' ``` ```PHP 12, "from_currency" => "USDT", "to_currency" => "TRX" ]; $headers = [ 'Content-Type: application/json', 'general_api_key: YOUR_GENERAL_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'POST', 'content' => json_encode($data), ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```JavaScript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap/calculate'; const data = { amount: 12, from_currency: "USDT", to_currency: "TRX", }; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json', }; axios.post(url, data, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```Python import requests import json url = 'https://api.oxapay.com/v1/general/swap/calculate' data = { "amount": 12, "from_currency": "USDT", "to_currency": "TRX" } headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.post(url, data=json.dumps(data), headers=headers) result = response.json() print(result) ``` -------------------------------- ### Example JSON API Response for Cryptocurrency Swap List Source: https://docs.oxapay.com/api-reference/swap This snippet illustrates the typical structure of a successful API response, detailing a list of cryptocurrency pairs with their minimum swap amounts. It also includes general status information such as message, error object, HTTP status code, and API version. ```json { "data":{ "list": [ { "fromCurrency": "BTC", "toCurrency": "USDT", "minAmount": 0.0003 }, { "fromCurrency": "ETH", "toCurrency": "USDT", "minAmount": 0.005 }, { "fromCurrency": "BNB", "toCurrency": "USDT", "minAmount": 0.01 }, { "fromCurrency": "LTC", "toCurrency": "USDT", "minAmount": 0.05 }, { "fromCurrency": "TRX", "toCurrency": "USDT", "minAmount": 1 }, { "fromCurrency": "DOGE", "toCurrency": "USDT", "minAmount": 1 }, { "fromCurrency": "MATIC", "toCurrency": "USDT", "minAmount": 0.1 }, { "fromCurrency": "TON", "toCurrency": "USDT", "minAmount": 0.1 }, { "fromCurrency": "XMR", "toCurrency": "USDT", "minAmount": 0.01 }, { "fromCurrency": "BCH", "toCurrency": "USDT", "minAmount": 0.005 }, { "fromCurrency": "SHIB", "toCurrency": "USDT", "minAmount": 100000 }, { "fromCurrency": "SOL", "toCurrency": "USDT", "minAmount": 0.008 }, { "fromCurrency": "USDT", "toCurrency": "BTC", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "ETH", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "BNB", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "LTC", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "TRX", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "DOGE", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "MATIC", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "TON", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "XMR", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "BCH", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "SHIB", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "SOL", "minAmount": 1 } ] }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Retrieve Payout Information by Track ID Source: https://docs.oxapay.com/api-reference/payout Demonstrates how to make a GET request to the Oxapay Payout API's `/v1/payout/{track_id}` endpoint using cURL, PHP, Node.js, and Python. These examples show how to include the `payout_api_key` in the request headers to fetch specific payout details. ```bash curl -X GET https://api.oxapay.com/v1/payout/{track_id}\ -H "payout_api_key: YOUR_PAYOUT_API_KEY" \ -H "Content-Type: application/json" ``` ```php array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const track_id = 'TRACK_ID'; const url = `https://api.oxapay.com/v1/payout/${track_id}`; const headers = { 'payout_api_key': `YOUR_PAYOUT_API_KEY `, 'Content-Type': 'application/json' }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json track_id = 'TRACK_ID' url = f'https://api.oxapay.com/v1/payout/{track_id}' headers = { 'payout_api_key': 'YOUR_PAYOUT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Example JSON Response for Swap History Source: https://docs.oxapay.com/api-reference/swap Provides a sample JSON structure returned by the Oxapay API's /v1/general/swap endpoint. It details the `data` object containing a `list` of swap records (track_id, currencies, amounts, rates, date) and `meta` information (pagination), along with overall `message`, `error`, `status`, and `version` fields. ```JSON { "data": { "list": [ { "track_id": "393831199", "from_currency": "USDT", "to_currency": "BTC", "from_amount": 10.0000000000, "to_amount": 0.0001054000, "rate": 94876.66034156, "date": 1736508792 }, { "track_id": "315890329", "from_currency": "USDT", "to_currency": "BTC", "from_amount": 1.0000000000, "to_amount": 0.0000105200, "rate": 95057.03422053, "date": 1736503906 } ], "meta": { "page": 1, "last_page": 1, "total": 10 } }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Request Swap Rate using Python with Requests Source: https://docs.oxapay.com/api-reference/swap Python script demonstrating how to use the 'requests' library to make a POST call to the OxaPay Swap Rate API. It sets up the request body and headers, then prints the JSON response. ```python import requests import json url = 'https://api.oxapay.com/v1/general/swap/rate' data = { "from_currency": "USDT", "to_currency": "TRX" } headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.post(url, data=json.dumps(data), headers=headers) result = response.json() print(result) ``` -------------------------------- ### Perform a Currency Swap Request via Oxapay API Source: https://docs.oxapay.com/api-reference/swap This snippet demonstrates how to initiate a currency swap using the Oxapay API's POST /v1/general/swap endpoint. It provides examples in cURL, PHP, Node.js, and Python, showing how to include the required API key for authentication and specify the amount and currencies for the swap. ```bash curl -X POST https://api.oxapay.com/v1/general/swap \ -H "general_api_key: YOUR_GENERAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 0.5, "from_currency": "BTC", "to_currency": "USDT" }' ``` ```php 0.5, "from_currency" => "BTC", "to_currency" => "USDT" ]; $headers = [ 'Content-Type: application/json', 'general_api_key: YOUR_GENERAL_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'POST', 'content' => json_encode($data), ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/general/swap'; const data = { amount: 0.5, from_currency: "BTC", to_currency: "USDT" }; const headers = { 'general_api_key': `YOUR_GENERAL_API_KEY`, 'Content-Type': 'application/json' }; axios.post(url, data, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/general/swap' data = { "amount": 0.5, "from_currency": "BTC", "to_currency": "USDT" } headers = { 'general_api_key': 'YOUR_GENERAL_API_KEY', 'Content-Type': 'application/json' } response = requests.post(url, data=json.dumps(data), headers=headers) result = response.json() print(result) ``` -------------------------------- ### Request Accepted Currencies API with cURL, PHP, Node.js, and Python Source: https://docs.oxapay.com/api-reference/payment/accepted-currencies Demonstrates how to programmatically access the OxaPay 'Accepted Currencies' API endpoint using various popular programming languages. Each example illustrates setting the necessary 'merchant_api_key' header and handling the GET request to retrieve the list of accepted cryptocurrencies. ```bash curl -X GET https://api.oxapay.com/v1/payment/accepted-currencies \ -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \ -H "Content-Type: application/json" ``` ```php array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payment/accepted-currencies'; const headers = { 'merchant_api_key': `YOUR_MERCHANT_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payment/accepted-currencies' headers = { 'merchant_api_key': 'YOUR_MERCHANT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) result = response.json() print(result) ``` -------------------------------- ### Retrieve OxaPay Payment History via API Source: https://docs.oxapay.com/api-reference/payment/payment-history Demonstrates how to make a GET request to the OxaPay Payment History API endpoint using various programming languages. These examples show how to include necessary headers like 'merchant_api_key' and 'Content-Type', and how to pass query parameters for pagination (size and page). Replace 'YOUR_MERCHANT_API_KEY' with your actual API key. ```bash curl -X GET "https://api.oxapay.com/v1/payment/?size=20&page=1" \ -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \ -H "Content-Type: application/json" ``` ```php 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'merchant_api_key: YOUR_MERCHANT_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payment/'; const params = { size: 20, page: 1 }; const headers = { 'merchant_api_key': `YOUR_MERCHANT_API_KEY`, 'Content-Type': 'application/json', }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payment/' params = { 'size': 20, 'page': 1 } headers = { 'merchant_api_key': 'YOUR_MERCHANT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, params=params , headers=headers) result = response.json() print(result) ``` -------------------------------- ### API Documentation for OxaPay Swap Rate Endpoint Source: https://docs.oxapay.com/api-reference/swap Detailed API specification for the POST /v1/general/swap/rate endpoint, covering authentication, request parameters, and the expected JSON response structure for fetching real-time cryptocurrency swap rates. ```APIDOC Endpoint: POST https://api.oxapay.com/v1/general/swap/rate Description: Allows fetching real-time swap rates for cryptocurrency pairs. Authentication: Header: general_api_key (string, required): Your General API Key for authentication and authorization. Request Body: from_currency (string, required): Specify the currency symbol you want to swap from. to_currency (string, required): Specify the currency symbol you want to swap to. Response Schema (200 OK): { "data": { "rate": "decimal" // The swap rate between the "from_currency" and "to_currency" at the time of the request (e.g., 1 BTC = 94763.06000000 USDT). }, "message": "string", // A message containing additional information about the result of the request. "error": { "type": "string", "key": "string", "message": "string" } || {}, // An object that provides details about any errors that occurred. "status": "integer", // The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors). "version": "string" // The version of the API being used. } Example Response: { "data": { "rate": 94763.06000000 }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ``` -------------------------------- ### Fetch Static Address List from Oxapay API Source: https://docs.oxapay.com/api-reference/payment/static-address-list This snippet demonstrates how to make a GET request to the Oxapay '/v1/payment/static-address' endpoint to retrieve a paginated list of static addresses. It includes examples in cURL, PHP, Node.js (using Axios), and Python (using Requests). Parameters 'size' and 'page' are used for pagination. Remember to replace 'YOUR_MERCHANT_API_KEY' with your actual merchant API Key. ```bash curl -X GET "https://api.oxapay.com/v1/payment/static-address?size=20&page=1" \ -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \ -H "Content-Type: application/json" ``` ```php 20, 'page' => 1 ); $query = http_build_query($data); $url = $url . '?' . $query; $headers = [ 'Content-Type: application/json', 'merchant_api_key: YOUR_MERCHANT_API_KEY' ]; $options = array( 'http' => array( 'header' => implode("\r\n", $headers), 'method' => 'GET' ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); if ($response === FALSE) { die('Error occurred'); } $result = json_decode($response, true); var_dump($result); ?> ``` ```javascript const axios = require('axios'); const url = 'https://api.oxapay.com/v1/payment/static-address'; const params = { size: 20, page: 1 }; const headers = { 'merchant_api_key': `YOUR_MERCHANT_API_KEY`, 'Content-Type': 'application/json' }; axios.get(url, { params, headers }) .then((response) => { console.log(response.data); }) .catch((error) => { console.error(error); }); ``` ```python import requests import json url = 'https://api.oxapay.com/v1/payment/static-address' params = { 'size': 20, 'page': 1 } headers = { 'merchant_api_key': 'YOUR_MERCHANT_API_KEY', 'Content-Type': 'application/json' } response = requests.get(url, params=params , headers=headers) result = response.json() print(result) ``` -------------------------------- ### Example API Response for Supported Currency Pairs Source: https://docs.oxapay.com/api-reference/swap/swap-pairs This JSON object illustrates a typical successful response from an Oxapay API endpoint, containing a 'data' field with a 'list' of currency pairs. Each entry specifies 'fromCurrency', 'toCurrency', and 'minAmount', along with general response metadata like 'message', 'error', 'status', and 'version'. ```json { "data":{ "list": [ { "fromCurrency": "BTC", "toCurrency": "USDT", "minAmount": 0.0003 }, { "fromCurrency": "ETH", "toCurrency": "USDT", "minAmount": 0.005 }, { "fromCurrency": "BNB", "toCurrency": "USDT", "minAmount": 0.01 }, { "fromCurrency": "LTC", "toCurrency": "USDT", "minAmount": 0.05 }, { "fromCurrency": "TRX", "toCurrency": "USDT", "minAmount": 1 }, { "fromCurrency": "DOGE", "toCurrency": "USDT", "minAmount": 1 }, { "fromCurrency": "MATIC", "toCurrency": "USDT", "minAmount": 0.1 }, { "fromCurrency": "TON", "toCurrency": "USDT", "minAmount": 0.1 }, { "fromCurrency": "XMR", "toCurrency": "USDT", "minAmount": 0.01 }, { "fromCurrency": "BCH", "toCurrency": "USDT", "minAmount": 0.005 }, { "fromCurrency": "SHIB", "toCurrency": "USDT", "minAmount": 100000 }, { "fromCurrency": "SOL", "toCurrency": "USDT", "minAmount": 0.008 }, { "fromCurrency": "USDT", "toCurrency": "BTC", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "ETH", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "BNB", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "LTC", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "TRX", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "DOGE", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "MATIC", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "TON", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "XMR", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "BCH", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "SHIB", "minAmount": 1 }, { "fromCurrency": "USDT", "toCurrency": "SOL", "minAmount": 1 } ] }, "message": "Operation completed successfully!", "error": {}, "status": 200, "version": "1.0.0" } ```