API Reference
Customer Invoices
/api/v1/console/accounting/customer-invoices JWT API KeyThe branch's receivable register
`outstanding_only` answers the question the register exists for — what is still owed — server-side, so two clients cannot reconstruct it two slightly different ways.
- Capability (any)
view_glormanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Query parameters
| Status string | One of `draft | issued | paid | void`. Optional. |
| From string (date) | Inclusive lower bound on the invoice's Baghdad business day. |
| ToExclusive string (date) | Exclusive upper bound on the invoice's Baghdad business day. |
| OutstandingOnly boolean | Only invoices still owed — `issued` with `paidIqd < totalIqd`. <br>Kept as a flag rather than left to the caller's own filtering because "what is still owed to us" is the one question this register exists to answer, and a client that had to reconstruct it from `status` plus two money columns would each reconstruct it slightly differently. |
| IncludeDeleted boolean | Include tombstoned invoices (FR-ACC-092). Honoured only for a caller holding `manage_accounting`; a read-only GL viewer never sees retired rows. |
| Page integer (int32) | — |
| PerPage integer (int32) | — |
| Search string | Free-text filter. Its meaning is per-resource and documented on the endpoint. |
| Skip integer (int32) | Rows to skip, derived — never sent by the caller on this surface. |
| Sort string | A snake_case column key from the endpoint's allow-list (`created_at`, `gross_total`, `status` …). Absent or blank → the endpoint's default order. |
| Dir string | `asc` (the default when Panoptes.Application.Common.SortableRequest.Sort is present) or `desc`. Ignored without a sort. |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers
/api/v1/console/accounting/customer-invoices JWT API KeyDraft an invoice.,
The request carries no subtotal, no tax figure and no total: every money figure is derived server-side from the lines, and a wire shape that cannot express a total can never disagree with the figure the ledger posts.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Request body
{
"customerName": "string",
"customerTaxId": "string",
"businessDate": "2026-11-27",
"dueDate": "2026-11-27",
"currencyCode": "string",
"notes": "string",
"lines": [
{
"description": "string",
"quantity": 0,
"unitPriceIqd": 0,
"taxCodeId": "00000000-0000-0000-0000-000000000000",
"sourceOrderId": "00000000-0000-0000-0000-000000000000"
}
]
}| customerName string | — |
| customerTaxId string | The customer's tax registration, as it must appear on the printed document. |
| businessDate string (date) | The Baghdad business day the document is dated on. Defaults to today's business day. <br>It is a System.DateOnly and never a raw instant: the Baghdad day runs 03:00 → 03:00 local, and a document dated by a UTC timestamp lands in the wrong period for every invoice written between midnight and 03:00 (INV-024). |
| dueDate string (date) | When the balance falls due. Null means on receipt (the business date). |
| currencyCode string | The currency the invoice is billed in. Null means the branch's base currency, which is every invoice on a shipped install. Frozen at create — see Panoptes.Application.DTOs.Requests.Accounting.UpdateCustomerInvoiceRequest for why it is not editable afterwards. |
| notes string | — |
| lines CustomerInvoiceLineInput[] | Between 1 and 100 lines (FR-ACC-044). |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"customerName": "string",
"customerTaxId": "string",
"businessDate": "2026-11-27",
"dueDate": "2026-11-27",
"currencyCode": "string",
"notes": "string",
"lines": [
{
"description": "string",
"quantity": 0,
"unitPriceIqd": 0,
"taxCodeId": "00000000-0000-0000-0000-000000000000",
"sourceOrderId": "00000000-0000-0000-0000-000000000000"
}
]
}'Request body (JSON)
Headers
/api/v1/console/accounting/customer-invoices/{id} JWT API KeyOne invoice with its billed lines.,
Another branch's invoice reads as `NOT_FOUND`, never `FORBIDDEN`.
- Capability (any)
view_glormanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Path parameters
| idrequired string (uuid) | — |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Headers
/api/v1/console/accounting/customer-invoices/{id} JWT API KeyAmend a draft
Refused once issued: the ledger holds an entry and the customer holds a copy, so the correction route is void-and-re-issue, the same reversal-not-mutation discipline the journal itself keeps.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"customerName": "string",
"customerTaxId": "string",
"businessDate": "2026-11-27",
"dueDate": "2026-11-27",
"notes": "string",
"lines": [
{
"description": "string",
"quantity": 0,
"unitPriceIqd": 0,
"taxCodeId": "00000000-0000-0000-0000-000000000000",
"sourceOrderId": "00000000-0000-0000-0000-000000000000"
}
]
}| customerName string | — |
| customerTaxId string | — |
| businessDate string (date) | The Baghdad business day. Null leaves the draft's existing date untouched. |
| dueDate string (date) | When the balance falls due. Null means on receipt (the business date). |
| notes string | — |
| lines CustomerInvoiceLineInput[] | Between 1 and 100 lines. The existing set is replaced, not merged. |
Responses
curl -X PUT "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"customerName": "string",
"customerTaxId": "string",
"businessDate": "2026-11-27",
"dueDate": "2026-11-27",
"notes": "string",
"lines": [
{
"description": "string",
"quantity": 0,
"unitPriceIqd": 0,
"taxCodeId": "00000000-0000-0000-0000-000000000000",
"sourceOrderId": "00000000-0000-0000-0000-000000000000"
}
]
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/accounting/customer-invoices/{id} JWT API KeyTombstone an invoice entered in error
Refused for any invoice that reached the ledger — that one is corrected by a reversal, which is what the void endpoint is for. The reason is required and is recorded.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"reason": "string"
}| reason string | — |
Responses
curl -X DELETE "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Headers
/api/v1/console/accounting/customer-invoices/{id}/issue JWT API KeyIssue a draft and post its ledger side in the same transaction.,
receivable for the total, CR revenue for the subtotal, CR VAT payable for the tax when non-zero — dated the invoice's own business day, so issuing into a locked period is `PERIOD_LOCKED` rather than quietly redated.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.- Idempotency
- Send an
Idempotency-Keyheader (a UUID you mint). A retry with the same key replays the first answer.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"memo": "string"
}| memo string | Free text carried onto the journal entry. Optional. |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}/issue" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"memo": "string"
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/accounting/customer-invoices/{id}/payments JWT API KeyRecord a cash or bank receipt.,
Dated today's business day, not the invoice's — money arrives when it arrives. Over-collection is refused under a per-invoice advisory lock, and a cash receipt deposits into the safe in the same transaction.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.- Idempotency
- Send an
Idempotency-Keyheader (a UUID you mint). A retry with the same key replays the first answer.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"amountIqd": 0,
"method": "string",
"reference": "string"
}| amountIqd integer (int64) | Minor units of the invoice's currency, `>= 1` and at most the outstanding balance. |
| method string | `cash` or `bank` — a closed two-value vocabulary (FR-ACC-047). <br>Deliberately not the merchant-extensible `PaymentMethod` table the point of sale uses: this value decides <b>which account the ledger debits</b> (1010 or 1030), so a rail a merchant could add at runtime would be a rail the poster has no account for. |
| reference string | A cheque number, transfer reference or teller's note. Optional. |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}/payments" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"amountIqd": 0,
"method": "string",
"reference": "string"
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/accounting/customer-invoices/{id}/pdf JWT API KeyThe invoice as a PDF (`?lang=ar|en`), Arabic-first
- Capability (any)
view_glormanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Path parameters
| idrequired string (uuid) | — |
Query parameters
| Lang string | — |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}/pdf" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Query parameters
Headers
/api/v1/console/accounting/customer-invoices/{id}/void JWT API KeyVoid an invoice
A draft voids with no entry, because none ever existed. An issued invoice voids by posting a reversing entry dated the void day, which is what keeps it voidable after its issue month locks. Refused outright while any receipt stands.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.- Idempotency
- Send an
Idempotency-Keyheader (a UUID you mint). A retry with the same key replays the first answer.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"reason": "string"
}| reason string | Why it is being voided. Recorded on the audit row. |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/{id}/void" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"reason": "string"
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/accounting/customer-invoices/billable-orders JWT API KeyPOS orders that can still be billed on account — the "create from orders" picker
An order on a live (non-void) invoice, or a cancelled or refunded one, is not listed.
- Capability (any)
view_glormanage_accountingand alsomanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Query parameters
| From string (date) | — |
| To string (date) | — |
| Page integer (int32) | — |
| PerPage integer (int32) | — |
| Search string | Free-text filter. Its meaning is per-resource and documented on the endpoint. |
| Skip integer (int32) | Rows to skip, derived — never sent by the caller on this surface. |
| Sort string | A snake_case column key from the endpoint's allow-list (`created_at`, `gross_total`, `status` …). Absent or blank → the endpoint's default order. |
| Dir string | `asc` (the default when Panoptes.Application.Common.SortableRequest.Sort is present) or `desc`. Ignored without a sort. |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/billable-orders" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers
/api/v1/console/accounting/customer-invoices/statement JWT API KeyA customer's statement: opening, movements, closing and aging
- Capability (any)
view_glormanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Query parameters
| Customer string | The customer name exactly as invoiced (case-insensitive). |
| From string (date) | — |
| To string (date) | — |
| Lang string | `ar` (default) or `en`, for the PDF. |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/statement" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers
/api/v1/console/accounting/customer-invoices/statement/pdf JWT API KeyThe customer statement as a PDF (`?lang=ar|en`)
- Capability (any)
view_glormanage_accounting- API key scope
cap:view_glorcap:manage_accounting(the key's owner must also hold the capability)- Plan feature
accountingmust be on the branch's plan, or the call answers 403.
Query parameters
| Customer string | The customer name exactly as invoiced (case-insensitive). |
| From string (date) | — |
| To string (date) | — |
| Lang string | `ar` (default) or `en`, for the PDF. |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/accounting/customer-invoices/statement/pdf" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers