Version 2.1.1792967583 · latest Download OpenAPI Markdown

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.

ordersBillingAuthentication: User (some parameters admin only)4 endpoints

List orders

GET/api/v2/orders
Authentication: User (some parameters admin only)

Query parameters

FieldTypeRequiredDescription
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. Ignored for tenant credentials, which only see their own tenant's data
typestring— Filter by order type (recharge/deduct/payment/package, etc.).
statusstring— Filter by status.
Values ["unpaid","paid"]
startstring— Order time from (inclusive), RFC 3339.
endstring— Order time until (exclusive), RFC 3339.

Order amount statistics

GET/api/v2/orders/stats
Authentication: User (some parameters admin only)

Query parameters

FieldTypeRequiredDescription
tenant_idinteger— Admin only: filter by tenant. Ignored for tenant credentials, which only see their own tenant's data
typestring— Filter by order type (recharge/deduct/payment/package, etc.).
statusstring— Filter by status.
Values ["unpaid","paid"]
startstring— Order time from (inclusive), RFC 3339.
endstring— Order time until (exclusive), RFC 3339.
group_bystring— Aggregation granularity, default day.
Values ["day","month","year"]
utc_offset_minutesinteger— Deprecated and kept only for compatibility with old callers (the range is still validated). Days, months and years are always split in the platform time zone (Asia/Shanghai), the same day boundary as today's traffic; this parameter no longer shifts them.

Get order

GET/api/v2/orders/{id}
Authentication: User (some parameters admin only)

Update order remark

PUT/api/v2/orders/{id}
Authentication: Admin only

Request body application/json

FieldTypeRequiredDescription
desstringRequired Description

Orders object

FieldTypeRequiredDescription
amount_centsinteger— Amount in cents; negative for deductions.
archivedboolean— Moved into the archive table by the archiving task (read-only).
created_atstring— Created at
read-only
dataobject— Extra data (such as package purchase details).
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.
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