Skip to main content

Orders & Invoices

These endpoints list billing orders and invoices, and download an invoice's PDF. Orders and invoices are created by the billing system when customers buy or renew servers; the Application API cannot create or change them.

List orders​

GET /api/application/billing/orders

Admin permission: billing.orders

Returns a paginated list of orders.

curl "https://panel.example.com/api/application/billing/orders?sort=-created_at" \
-H "Authorization: Bearer $API_KEY" \
-H "Accept: application/json"

Query parameters​

ParameterTypeRequiredDescription
per_pageintegerNoResults per page, 1 to 100. Default 20. See pagination.
pageintegerNoPage number.
filter[id], filter[name], filter[description]stringNoPartial match on the field. See filtering and sorting.
sortstringNoOne of id, name, total, type, created_at, threat_index, optionally prefixed with -.

Response​

200 OK

{
"object": "list",
"data": [
{
"object": "order",
"attributes": {
"id": 12,
"name": "Minecraft Starter",
"user_id": 2,
"description": "New server order",
"total": 4.99,
"status": "processed",
"product_id": 1,
"type": "new",
"threat_index": -1,
"created_at": "2026-11-20T10:15:00+00:00",
"updated_at": "2026-11-20T10:16:02+00:00"
}
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 20,
"current_page": 1,
"total_pages": 1,
"links": {}
}
}
}
AttributeTypeDescription
idintegerOrder ID.
namestringOrder name.
user_idintegerThe customer's user ID.
descriptionstringOrder description.
totalnumberAmount charged.
statusstringOne of pending, processing, processed, failed, expired.
product_idintegerThe product that was ordered.
typestringOne of new, upgrade, renewal. Older orders with no type return "?".
threat_indexintegerFraud score from 0 to 100, or -1 when not scored.
created_at, updated_atstringISO 8601 timestamps.

List invoices​

GET /api/application/billing/invoices

Admin permission: billing.invoices

Returns a paginated list of invoices. Unless another sort is given, newest invoices come first (created_at descending). When you pass sort, created_at descending is applied after it as a tie-breaker.

Query parameters​

ParameterTypeRequiredDescription
per_pageintegerNoResults per page, 1 to 100. Default 20. See pagination.
pageintegerNoPage number.
filter[number]stringNoPartial match on the invoice number.
filter[user]stringNoPartial match on the customer's username or email address.
filter[status]stringNoExact match on the order's status (pending, processing, processed, failed, expired).
sortstringNoOne of id, number, generated_at, created_at, optionally prefixed with -.

Response​

200 OK

{
"object": "list",
"data": [
{
"object": "invoice",
"attributes": {
"id": 7,
"uuid": "4b8e2c1a-9d3f-4a6e-b7c5-1f2e3d4c5b6a",
"number": "INV-000012",
"order_id": 12,
"total": 4.99,
"status": "processed",
"user": {
"id": 2,
"username": "jane",
"email": "jane@example.com"
},
"generated_at": "2026-11-20T10:16:05+00:00",
"created_at": "2026-11-20T10:16:05+00:00"
}
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 20,
"current_page": 1,
"total_pages": 1,
"links": {}
}
}
}
AttributeTypeDescription
idintegerInvoice ID. Used to download the PDF.
uuidstringInvoice UUID.
numberstring or nullInvoice number. Invoices generated by the Panel use INV- followed by the order ID padded to six digits, for example INV-000012.
order_idintegerThe order this invoice is for.
totalnumber or nullThe order's total. If the order no longer exists, the total saved in the invoice snapshot.
statusstring or nullThe order's status, or null if the order no longer exists.
user.idinteger or nullThe customer's user ID, or null if the order or user no longer exists.
user.usernamestring or nullThe customer's username. Falls back to the username saved in the invoice snapshot.
user.emailstring or nullThe customer's email. Falls back to the email saved in the invoice snapshot.
generated_atstring or nullISO 8601 time the PDF was generated.
created_atstringISO 8601 timestamp.

Download an invoice​

GET /api/application/billing/invoices/{invoice}/download

Admin permission: billing.invoices

Downloads the invoice's stored PDF. {invoice} is the invoice's numeric id.

Response​

200 OK. The body is the raw PDF file, not JSON. The response headers are:

Content-Type: application/pdf
Content-Disposition: attachment; filename=INV-000012.pdf
Content-Length: 48213

Content-Type is the MIME type the storage disk detects for the stored file, which is application/pdf for invoices the Panel generated. The file name is the invoice number followed by .pdf.

curl "https://panel.example.com/api/application/billing/invoices/7/download" \
-H "Authorization: Bearer $API_KEY" \
-o INV-000012.pdf

Errors​

StatusWhen
404No invoice has this ID.

If the invoice record exists but its PDF file is missing from the storage disk, the response is not a clean 404. The exact result depends on the storage disk's configuration.