Version 2.4.7.20261116085428 · latest

Orders orders

Orders created by recharges, deductions, online payments and package purchases; tenants see only their own, admins can see all tenants, and only the remark can be edited.

Pick an endpoint to see its example call on the right.

BillingAuthentication: User (some parameters admin only)4 endpoints

Authentication

Send the X-API-Key header (create a key on the API Keys page; the key is shown only once at creation). An Authorization: Bearer token obtained by logging in also works.

X-API-Key

Authentication failures return 401; forbidden returns 403 (code such as insufficient_scope).

Conventions

Paging uses page (from 1) and page_size; sort with sort=field or sort=-field.

Times are RFC 3339 (UTC); amounts are in cents.

Writes return 200/201/204 on success; duplicates of a unique key return 409.

GET/api/v2/ordersList orders

Authentication: User (some parameters admin only)

Query parameters

FieldTypeDescription
pageinteger Page number, starting from 1
Default 1
page_sizeinteger Items per page
Default 20
sortstring Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id`
tenant_idinteger Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data
tenant_idsstring Admin only: only these tenants, comma-separated positive integers, at most 200 after deduplication (more, or a malformed value, returns 422); a single ID works too. Filters only and does not switch the request scope; combined with tenant_id and other filters as an intersection. A tenant credential sending a non-empty value gets 403
typestring Filter by order type (recharge/deduct/payment/package, etc.).
pay_typestring Filter by payment method (admin/balance/alipay/wxpay/usdt, etc.).
statusstring Filter by status.
Values ["unpaid","paid"]
currencystring Filter by currency (ISO 4217); omitted = all currencies, amounts converted to the base currency at the order-time rate.
startstring Order time from (inclusive), RFC 3339.
endstring Order time until (exclusive), RFC 3339.
GET/api/v2/orders/statsOrder amount statistics

Authentication: User (some parameters admin only)

Query parameters

FieldTypeDescription
tenant_idinteger Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data
tenant_idsstring Admin only: only these tenants, comma-separated positive integers, at most 200 after deduplication (more, or a malformed value, returns 422); a single ID works too. Filters only and does not switch the request scope; combined with tenant_id and other filters as an intersection. A tenant credential sending a non-empty value gets 403
typestring Filter by order type (recharge/deduct/payment/package, etc.).
pay_typestring Filter by payment method (admin/balance/alipay/wxpay/usdt, etc.).
statusstring Filter by status.
Values ["unpaid","paid"]
currencystring Filter by currency (ISO 4217); omitted = all currencies, amounts converted to the base currency at the order-time rate.
startstring Order time from (inclusive), RFC 3339.
endstring Order time until (exclusive), RFC 3339.
group_bystring Aggregation granularity, default day.
Values ["day","month","year"]
GET/api/v2/orders/{id}Get order

Authentication: User (some parameters admin only)

PUT/api/v2/orders/{id}Update order remark

Authentication: Admin only

Request body application/json

FieldTypeDescription
desRequiredstring Description

Orders object

FieldTypeDescription
amount_centsinteger Amount in cents; negative for deductions.
archivedboolean Moved into the archive table by the archiving task (read-only).
by_pay_typeOrderStatsPayType[] Subtotals per payment method and direction (ascending by method, credit before debit; same type/status/time/tenant filters; same amount basis as items, so the total equals the items total); unpaid orders have an empty payment method.
created_atstring Created at
read-only
currencystring Currency of the amount (ISO 4217).
dataobject Extra data (such as package purchase details); a top-up paying a shortfall carries intent (state pending/running/done/failed; code/reason explain a failure; user_package_id is the package fulfilled when done).
desstring Description
group_bystring Aggregation granularity: day, month or year.
Values ["day","month","year"]
idinteger Record ID
read-only
itemsOrderStatsItem[] Items on this page
ledger_idinteger ID of the linked ledger entry; null if none.
mch_order_nostring Merchant order number (the gateway-side order number); null for non-online payments.
paid_atstring Payment time; null if unpaid.
pay_typestring admin/balance/alipay/wxpay, etc.; empty = unpaid.
rate_to_basestring Rate at order time: 1 unit of this currency = ? base currency (decimal string, 8 places); later rate changes do not affect it.
statusstring Order status: unpaid or paid.
Values ["unpaid","paid"]
tenant_idinteger Owner tenant (user) ID
read-only
transaction_idstring Gateway-side transaction ID; empty if unpaid.
typestring recharge (admin recharge) / deduct (admin deduction) / payment (online payment) / package (package purchase), etc.
updated_atstring Updated at
read-only

Responses and errors

Success returns the resource JSON directly (HTTP 2xx); failures return application/problem+json (code, detail, plus errors on validation failures); lists carry items + total.

Success
{
  "id": 1,
  "name": "example"
}
List
{
  "items": [
    {
      "id": 1
    }
  ],
  "page": 1,
  "page_size": 20,
  "total": 1
}
Error
{
  "code": "validation_failed",
  "detail": "Invalid request parameters",
  "errors": [
    {
      "code": "required",
      "field": "/name",
      "message": "name is required"
    }
  ],
  "request_id": "0123456789abcdef",
  "status": 422,
  "title": "Unprocessable Entity",
  "type": "about:blank"
}
Get started

Try the live demo

Open the live demo, or contact us for a quote and the install command