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
| Parameter | Type | Required | Description |
|---|---|---|---|
per_page | integer | No | Results per page, 1 to 100. Default 20. See pagination. |
page | integer | No | Page number. |
filter[id], filter[name], filter[description] | string | No | Partial match on the field. See filtering and sorting. |
sort | string | No | One 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": {}
}
}
}
| Attribute | Type | Description |
|---|---|---|
id | integer | Order ID. |
name | string | Order name. |
user_id | integer | The customer's user ID. |
description | string | Order description. |
total | number | Amount charged. |
status | string | One of pending, processing, processed, failed, expired. |
product_id | integer | The product that was ordered. |
type | string | One of new, upgrade, renewal. Older orders with no type return "?". |
threat_index | integer | Fraud score from 0 to 100, or -1 when not scored. |
created_at, updated_at | string | ISO 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
| Parameter | Type | Required | Description |
|---|---|---|---|
per_page | integer | No | Results per page, 1 to 100. Default 20. See pagination. |
page | integer | No | Page number. |
filter[number] | string | No | Partial match on the invoice number. |
filter[user] | string | No | Partial match on the customer's username or email address. |
filter[status] | string | No | Exact match on the order's status (pending, processing, processed, failed, expired). |
sort | string | No | One 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": {}
}
}
}
| Attribute | Type | Description |
|---|---|---|
id | integer | Invoice ID. Used to download the PDF. |
uuid | string | Invoice UUID. |
number | string or null | Invoice number. Invoices generated by the Panel use INV- followed by the order ID padded to six digits, for example INV-000012. |
order_id | integer | The order this invoice is for. |
total | number or null | The order's total. If the order no longer exists, the total saved in the invoice snapshot. |
status | string or null | The order's status, or null if the order no longer exists. |
user.id | integer or null | The customer's user ID, or null if the order or user no longer exists. |
user.username | string or null | The customer's username. Falls back to the username saved in the invoice snapshot. |
user.email | string or null | The customer's email. Falls back to the email saved in the invoice snapshot. |
generated_at | string or null | ISO 8601 time the PDF was generated. |
created_at | string | ISO 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
| Status | When |
|---|---|
404 | No 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.