PlatiBara / API
Partner API
Add Alipay and WeChat Pay payouts to your product: create an order over the API, pay for it in USDT, receive status webhooks and talk to our team in the order chat — text and files (QR codes, payment screenshots, error photos).
Endpoint and auth
Base URL: https://crm.anypayanyday.online/pb/partner/v1. Every request is signed:
X-API-Key, X-Timestamp and
X-Signature = hex(HMAC_SHA256(secret, timestamp + "\n" + METHOD + "\n" + path + "\n" + sha256(body))).
import hashlib, hmac, json, time, httpx
API = "https://crm.anypayanyday.online/pb/partner/v1"
KEY, SECRET = "pb_live_…", "…"
def call(method, path, payload=None):
body = json.dumps(payload, ensure_ascii=False, separators=(",", ":")).encode() if payload is not None else b""
ts = str(int(time.time()))
base = f"{ts}\n{method}\n/pb/partner/v1{path}\n{hashlib.sha256(body).hexdigest()}"
sign = hmac.new(SECRET.encode(), base.encode(), hashlib.sha256).hexdigest()
return httpx.request(method, API + path, content=body or None, headers={
"X-API-Key": KEY, "X-Timestamp": ts, "X-Signature": sign, "Content-Type": "application/json"})
print(call("GET", "/ping").json())
Methods
| Method | Path |
|---|---|
GET | /ping |
GET | /rate?amount_cny=3000 |
GET | /balance |
POST | /orders |
GET | /orders/{id} |
GET | /orders?updated_since=2026-09-20T10:00:00Z |
GET | /orders/{id}/messages?after=0 |
POST | /orders/{id}/messages |
POST | /orders/{id}/payments |
POST | /orders/{id}/recipient |
POST | /orders/{id}/cancel |
GET | /files/{id} |
Your account
Every partner gets a dedicated USDT TRC20 address — your funds are never mixed with end-customer or other partners' money.
By default each order is debited from your balance the moment it is created, so the deal starts instantly with no transfer to wait for
and no amount matching. Check the balance, the address and the last operations with GET /balance or in the cabinet.
Not enough funds — the order is not created and you get 402 insufficient_funds with your balance and deposit address.
Deposits are free of charge for partners. Prefer a per-deal transfer? Send "pay": "transfer" and the response carries
the PlatiBara payment address, the exact amount and the deadline — send exactly that amount in one payment and we match it to your order.
The field paid_with always says which mode was used.
Create an order
POST /orders
{
"method": "alipay", // alipay | wechat
"pay": "balance", // balance (по умолчанию) — списать со счёта; transfer — перевод под эту сделку
"amount_cny": 3000, // сумма в юанях, минимум 100
"qr_base64": "iVBORw0KGgo…", // QR получателя: jpg, png или webp в base64 (или вместо него recipient_account)
"external_id": "ADV-5512", // ваш номер заказа: повтор вернёт ту же заявку
"recipient_name": "Li Wei", // обязательно от 20 000 ¥ и для Alipay без QR
"recipient_account": "li@qq.com", // обязательно от 20 000 ¥; без QR — ID кошелька или телефон получателя
"client_name": "Иван Петров", // ваш клиент — попадёт в заявку и в чат
"client_phone": "+79990001122",
"comment": "заказ 5512, поставщик Yiwu"
}
{
"ok": true,
"order_id": 1024,
"external_id": "ADV-5512",
"status": "received",
"paid_with": "balance",
"method": "alipay",
"amount_cny": 3000.0,
"rate": 6.56,
"usdt_due": 457.32,
"usdt_paid": 0.0, // сколько уже засчитано частями (только при pay: transfer)
"usdt_remaining": 0.0, // сколько осталось доплатить
"pay": {"from": "balance", "amount": 457.32},
// при "pay": "transfer" вместо этого приходят реквизиты:
// "pay": {"coin": "USDT", "network": "TRON (TRC20)", "amount": 457.32,
// "address": "TRsnaQpX6VJNg6XsUtzcD331H6X2N88BUh", "expires_at": "2026-09-20T18:45:00+03:00"},
"recipient": {"type": "qr", "name": "Li Wei", "account": "li@qq.com"}, // type: qr | account
"test": false,
"created_at": "2026-09-20T17:45:00+03:00"
}
Pay to a wallet ID instead of a QR
No QR from the recipient? Send recipient_account (Alipay / WeChat ID or phone number) instead of qr_base64.
Alipay also needs recipient_name; for WeChat it is optional. Everything else — amounts, rate, statuses, webhooks, chat — is the same.
Responses carry recipient.type: account or qr.
POST /orders
{
"method": "alipay", // alipay | wechat
"amount_cny": 3000,
"recipient_account": "13800138000", // ID кошелька (Alipay / WeChat ID) или телефон получателя
"recipient_name": "Li Wei", // Alipay: обязательно; WeChat: по желанию
"external_id": "ADV-5513"
}
Partial payments and top-ups
For "pay": "transfer" orders. A small deviation from the exact amount is tolerated. If the payer sends less, or pays in
several transfers to the same order address, report each transfer with POST /orders/{id}/payments and its TxID:
it is credited to that order at any amount once TRON confirms it. Until the full amount is in, the order is partial
(usdt_remaining shows what is left, the deadline extends by another 3 hours after each part, up to 24h from creation, and
order.payment_partial fires). Overpayment is credited to your balance; if the order expires or you cancel it, the parts received
return to your balance (refunded_to_balance in the webhook). A transfer for an already closed order gets 409 order_closed — write to api@platibara.world with the txid.
In the sandbox pass any 64-hex txid plus "amount"; the part is credited in ~5 seconds.
POST /orders/1024/payments
{ "txid": "9f2c…64 hex-символа…" } // хеш вашего перевода USDT TRC20 на адрес заявки
// ответ: заявка с актуальными суммами
{ "ok": true, "accepted": true, "status": "waiting",
"usdt_due": 457.32, "usdt_paid": 0.0, "usdt_remaining": 457.32, … }
// после подтверждения сети (и вебхук order.payment_partial):
{ "status": "partial", "usdt_paid": 200.0, "usdt_remaining": 257.32,
"pay": {"amount": 257.32, "address": "TRsnaQ…", "expires_at": "…продлён на 3 часа…"}, … }
If a payment fails
If the payout cannot be made (recipient not found, limit, wrong details) you get order.problem and status problem;
the problem block says whether new details are needed (need_details) and links the error screenshot
(error_file_id, GET /files/{id}). No money is lost: the payment stays with the order until you decide.
- Fix it —
POST /orders/{id}/recipientwith a new QR (qr_base64), account and/or name. Our manager checks it and sends the order to payment again:order.resent, thenorder.paid. - Drop it —
POST /orders/{id}/cancel: the order is cancelled and the payment goes straight back to your balance (usdt_to_balance,order.cancelled). If part was already paid out, only the rest is returned. - No reply — if new details are needed and within 60 minutes of the failure you neither send them nor write in the chat,
the order is cancelled automatically and the payment returns to your balance (
order.cancelledwith"reason": "no_reply"andrefunded_to_balance). A reminder comes after 30 minutes (notice: reply_wait). - On request we can switch you to automatic mode: a failed payment cancels the order and refunds your balance at once (new details then go in a new order).
Webhooks
You set the endpoint and the webhook secret yourself in the partner cabinet. The webhook secret is separate from the API key, so rotating a key never breaks your receiver. We POST and expect any 2xx within 20 seconds.
POST ваш webhook_url
X-Event: order.paid
X-Timestamp: 1789927607
X-Signature: 6f1c… // hex(HMAC_SHA256(секрет вебхука, timestamp + "\n" + sha256(тело)))
{
"event": "order.paid",
"at": "2026-09-20T18:02:11+03:00",
"order": { "order_id": 1024, "status": "done", "usdt_received": 457.32, … }
}
| event |
|---|
order.created |
order.payment_partial |
order.payment_received |
order.paid |
order.problem |
order.resent |
order.cancelled |
order.expired |
balance.deposit |
ping |
message.new |
# проверка подписи вебхука (секрет вебхука — из кабинета партнёра)
import hashlib, hmac
def verify(headers, raw_body, webhook_secret):
base = headers["X-Timestamp"] + "\n" + hashlib.sha256(raw_body).hexdigest()
want = hmac.new(webhook_secret.encode(), base.encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest(want, headers["X-Signature"])
No 2xx — we retry up to 8 times with growing delays (1, 2, 4… minutes). The same event may arrive twice, so handle
them idempotently: message.new by message.id, other events by the order state in order
(order.problem, order.resent, order.payment_partial can repeat for one order); order of events is not guaranteed and GET /orders/{id} is the source of truth.
The cabinet shows a delivery log, a retry button and a «test webhook» button that sends a signed ping.
Prefer polling? Use GET /orders?updated_since=… and GET /orders/{id}/messages?after=….
Progress notices. At every step and every delay we post a ready-to-show text to the order chat in your cabinet language
(message.new, "role": "support", code in notice): received, offline
(payer is offline, back in working hours 9:00–22:00 GMT+3), checking, delay / delay_offline
(after 20 min, then every 30, up to three times), need_details (new recipient details needed — reason translated, error
screenshot in file_id), problem, reply_wait, details_got, resent,
partial, paid, cancelled. Regular messages have no notice field.
Sandbox
A pb_test_… key uses the same endpoints and signature, but no money moves. The order behaves like a real one:
after ~15 seconds we mark your transfer as received (order.payment_received), ~15 seconds later the payout desk
closes it (order.paid, status done). Chat, files, idempotency and webhooks work exactly as in production.
Failed payment in the sandbox: add "sandbox_fail": true to POST /orders (test key only). After the demo payment the order
gets order.problem; send POST /orders/{id}/recipient and you get order.resent in ~10 s and order.paid ~15 s later —
or cancel it and the demo payment returns to your demo balance.
Sandbox orders are kept apart: they never enter our operators' work queue, never reach the payment desk and never touch your balance. Switching to the live key changes nothing in your code — same endpoints, same signature, same fields.
A pb_live_… key works alongside the test one. You issue and rotate both yourself in the partner cabinet at
crm.anypayanyday.online, where you also see orders, chat and your commission statement.
Full Russian documentation: platibara.world/api.