API / Method reference / Billing
Billing
Balance history, purchases and top-up links.
Base URL:
https://sourhost.net/api/v1·Auth: Authorization: Bearer sh_live_…GET
/account/transactionsBalance history
Top-ups and charges.
Scope:
billing:readExample request
curl "https://sourhost.net/api/v1/account/transactions" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
GET
/account/purchasesPurchases
Scope:
billing:readExample request
curl "https://sourhost.net/api/v1/account/purchases" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
POST
/account/topup/liqpayTop-up link
Creates a LiqPay payment that the user pays on the LiqPay page; the request itself charges nothing.
Scope:
billing:topupParameters
amountUahrequired | body · number | Amount in UAH |
Example request
curl -X POST "https://sourhost.net/api/v1/account/topup/liqpay" \
-H "Authorization: Bearer $SOURHOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amountUah":500}'Response
HTTP
HTTP/2 200 OK
{
"checkoutUrl": "https://www.liqpay.ua/api/3/checkout",
"data": "eyJ…",
"signature": "Zm…",
"orderId": "topup_8b1f2c",
"sandbox": false
}GET
/account/topup/liqpay/:orderIdTop-up status
Scope:
billing:readParameters
orderIdrequired | path · string | Payment ID from the top-up answer |
Example request
curl "https://sourhost.net/api/v1/account/topup/liqpay/topup_8b1f2c" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
Common errors
Any method can answer with these. More on errors
| 400 | bad_request | Invalid body or parameters |
| 401 | token_invalid | The token is wrong, revoked or expired |
| 403 | token_scope_missing | The token lacks the scope |
| 403 | token_project_forbidden | The project or service is outside the token’s limits |
| 404 | not_found | No such project, service or object |
| 429 | token_rate_limited | Too many requests, see Retry-After |
| 503 | upstream_unavailable | The panel or node didn't answer — retry later |