API / Method reference / Billing

Billing

Balance history, purchases and top-up links.

GET/account/transactions

Balance history

Top-ups and charges.

Scope: billing:read
Example request
curl "https://sourhost.net/api/v1/account/transactions" \
  -H "Authorization: Bearer $SOURHOST_TOKEN"
Response
204 Empty response
GET/account/purchases

Purchases

Scope: billing:read
Example request
curl "https://sourhost.net/api/v1/account/purchases" \
  -H "Authorization: Bearer $SOURHOST_TOKEN"
Response
204 Empty response
POST/account/topup/liqpay

Top-up link

Creates a LiqPay payment that the user pays on the LiqPay page; the request itself charges nothing.

Scope: billing:topup
Parameters
amountUahrequiredbody · numberAmount 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/:orderId

Top-up status

Scope: billing:read
Parameters
orderIdrequiredpath · stringPayment 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

400bad_requestInvalid body or parameters
401token_invalidThe token is wrong, revoked or expired
403token_scope_missingThe token lacks the scope
403token_project_forbiddenThe project or service is outside the token’s limits
404not_foundNo such project, service or object
429token_rate_limitedToo many requests, see Retry-After
503upstream_unavailableThe panel or node didn't answer — retry later