Merchant Info — merchantInfo
Returns the merchant's basic profile and per-currency balances. Typically used to pull a balance snapshot before reconciliation, or to verify the configured default callback URL.
POST https://api.anonypay.io/api/merchant/merchantInfoAs with every business endpoint, the request body is the OAEP-encrypted ciphertext of the business JSON, and the full set of signature headers is required (ANONY-APP-ID / ANONY-TOKEN / ANONY-TIMESTAMP / ANONY-NONCE / ANONY-SIGN). See Encryption & Signing Protocol for the protocol details and getToken for obtaining a token.
Request Parameters
None. Send an empty JSON body ({}), encrypted and signed as usual.
Response Fields (after decryption)
| Field | Type | Description |
|---|---|---|
merchantId | int | Merchant ID |
merchantName | string | Merchant name |
callbackUrl | string | Default callback URL |
balances | array | Per-currency balances; each element is { currency, balance } |
balances element:
| Field | Type | Description |
|---|---|---|
currency | string | Currency symbol (see currency enum) |
balance | string | Balance for that currency |
Example decrypted data:
json
{
"merchantId": 10001,
"merchantName": "Example Merchant",
"callbackUrl": "https://merchant.example.com/anony/callback",
"balances": [
{ "currency": "trx.usdt", "balance": "12345.678900" },
{ "currency": "eth.usdt", "balance": "0" }
]
}Amount precision
Treat amount fields as strings to avoid floating-point precision issues.
Examples
php
require 'AnonyV2Client.php';
$client = new AnonyV2Client($appId, $serverPublicKeyB64, $merchantPrivateKeyB64);
$token = $client->getToken($secret);
$res = $client->post('merchantInfo', [], $token);
// $res['data'] is already signature-verified and decrypted
$balances = $res['data']['balances'];python
from anony_v2 import AnonyV2Client
import requests
c = AnonyV2Client(app_id, server_pub_b64, merchant_priv_b64)
# See the getToken page for obtaining a token
req = c.build_request({}, token) # no parameters, send empty JSON
r = requests.post(c.base_url + "merchantInfo", data=req["body"], headers=req["headers"])
body = r.json()
if body["code"] == 10000:
data = c.verify_response(body["data"], r.headers["ANONY-TIMESTAMP"],
r.headers["ANONY-NONCE"], r.headers["ANONY-SIGN"])
balances = data["balances"]js
const { AnonyV2Client } = require('./anony_v2');
const c = new AnonyV2Client(appId, serverPubB64, merchantPrivB64);
const token = await c.getToken(secret);
const req = c.buildRequest({}, token); // no parameters, send empty JSON
const r = await fetch(c.baseUrl + 'merchantInfo', { method: 'POST', body: req.body, headers: req.headers });
const body = await r.json();
if (body.code === 10000) {
const data = c.verifyResponse(body.data, r.headers.get('anony-timestamp'),
r.headers.get('anony-nonce'), r.headers.get('anony-sign'));
const balances = data.balances;
}Common Errors
| Symptom | Description |
|---|---|
tokenExpired | Token has expired — call getToken again |
signatureFailed | Signature, timestamp window, or nonce issue — see Error Codes |
Plain-text Oops | Source IP is not on the whitelist |
See Error Codes for the full list, and the Troubleshooting Guide for integration issues.
Related Pages
- Create Withdrawal Order createWithdrawOrder — check your balance with this endpoint before withdrawing
- Currencies & Fees getCurrencies — query per-currency fees and minimum limits
- Go-live Self-check selfcheck