OxaPay Docs
Legacy
Legacy
  • Introduction
  • Getting Started
  • Integrations
    • Payment Links
    • Donations
    • Merchant API
    • Payout API
    • Plugins
      • WooCommerce
      • WISECP
      • Clientexec
      • Blesta
      • WHMCS
      • PrestaShop
      • Easy Digital Downloads
      • Paid Memberships Pro
      • Gravity Forms
      • Restrict Content Pro
    • Merchant and Payout Service with API
  • API Reference
    • Creating an Invoice
    • Creating White-Label Payment
    • Creating Static Wallet
    • Revoking Static Wallet
    • Static Wallets List
    • Payment Information
    • Payment History
    • Accepted Coins
    • Price
    • Creating Payout
    • Payout Information
    • Payout History
    • Account Balance
    • Exchange Rate
    • Exchange Calculate
    • Exchange Pairs
    • Exchange Request
    • Exchange History
    • Supported Currencies
    • Supported Fiat Currencies
    • Supported Networks
    • System Status
    • Result code table
    • Merchant status table
    • Payout status table
  • Webhook
  • Use Cases
  • Troubleshooting
Powered by GitBook
On this page
  1. API Reference

Account Balance

PreviousPayout HistoryNextExchange Rate

Last updated 4 months ago

This endpoint is used to get details about all wallets related to a user. The response contains a list of currencies with their corresponding amounts.

POST https://api.oxapay.com/api/balance

Request Body

Name
Type
Description

key*

string

Your payout API key for authentication and authorization.

currency

string

Specify a specific to get the balance for that currency. If not provided, the response will contain the balance for all available currencies.

{
  "result": integer, // The result code indicates the success or failure of the request.
  "message": string, // A message providing additional information about the result.
  "data": object array // An array of objects containing the balances for each currency. Each key is the currency symbol, and its value is the corresponding amount in that currency.
}

Please note that the response will contain the balance for each currency as a string value. You may need to parse or convert these values to the appropriate data type based on your application's requirements.

Please note that a successful request will return a result code 100. In case of any issues or validation problems, refer to the corresponding for further details.

Example codes

curl -X POST https://api.oxapay.com/api/balance \
     -d 'key=YOUR_PAYOUT_API_KEY'
<?php

$url = 'https://api.oxapay.com/api/balance';

$data = array(
    'key' => 'YOUR_PAYOUT_API_KEY'
);

$options = array(
    'http' => array(
        'header' => 'Content-Type: application/json',
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);

$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response);
var_dump($result);
?>
const axios = require('axios');
const url = 'https://api.oxapay.com/api/balance';
const data = JSON.stringify({
    key: 'YOUR_PAYOUT_API_KEY'
});

axios.post(url, data)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
import requests
import json

url = 'https://api.oxapay.com/api/balance'
data = {
    'key': 'YOUR_PAYOUT_API_KEY'
}
response = requests.post(url, data=json.dumps(data))
result = response.json()
print(result)

Now the API key is included in the request body, and you can proceed to use the appropriate code snippet based on your preferred programming language.

result codes
currency