For the complete documentation index, see llms.txt. This page is also available as Markdown.

Account Balance

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 currency 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 result codes 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);
?>

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.

Last updated