REST API
Docs API
Create and manage invoices, purchase orders, quotations, and credit notes.
Generated from the Celerp 2.4.0 OpenAPI schema, 16 September 2026.
GET /docs
List Docs
Parameters
| Name | In | Required | Type | Description |
|---|
doc_type | query | -- | string, optional | -- |
status | query | -- | string, optional | -- |
status_in | query | -- | string, optional | -- |
exclude_status | query | -- | string, optional | -- |
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
due_from | query | -- | string, optional | -- |
due_to | query | -- | string, optional | -- |
q | query | -- | string, optional | -- |
contact_id | query | -- | string, optional | -- |
limit | query | -- | integer, optional | -- |
offset | query | -- | integer | -- |
overdue_only | query | -- | boolean | -- |
all_issued | query | -- | boolean | -- |
unfulfilled_only | query | -- | boolean | -- |
not_restocked | query | -- | boolean | -- |
not_stocked | query | -- | boolean | -- |
converted_to_type | query | -- | string, optional | -- |
ids | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs \
-H "Authorization: Bearer $TOKEN"
POST /docs
Create Doc
Request body
| Field | Type | Required | Description |
|---|
doc_type | string | yes | Doc Type |
ref_id | string, optional | -- | Ref Id |
contact_id | string, optional | -- | Contact Id |
contact_name | string, optional | -- | Contact Name |
purchase_kind | string, optional | -- | Purchase Kind |
line_items | array of LineItem | -- | Line Items |
subtotal | number | -- | Subtotal |
tax | number | -- | Tax |
doc_taxes | array of TaxApplication | -- | Doc Taxes |
discount | number | -- | Discount |
shipping | number | -- | Shipping |
total | number | -- | Total |
payment_terms | string, optional | -- | Payment Terms |
due_date | string, optional | -- | Due Date |
currency | string, optional | -- | Currency |
conversion_rate | number, optional | -- | Conversion Rate |
notes | string, optional | -- | Notes |
expected_delivery | string, optional | -- | Expected Delivery |
valid_until | string, optional | -- | Valid Until |
carrier | string, optional | -- | Carrier |
tracking | string, optional | -- | Tracking |
from_location_id | string, optional | -- | From Location Id |
to_address | object, optional | -- | To Address |
original_doc_id | string, optional | -- | Original Doc Id |
reason | string, optional | -- | Reason |
status | string | -- | Status |
amount_paid | number | -- | Amount Paid |
amount_outstanding | number, optional | -- | Amount Outstanding |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
DELETE /docs/bulk-draft
Bulk Delete Drafts
Delete multiple draft documents in one request. Non-draft docs are skipped (not an error).
A document that has posted to the books refuses the whole batch and nothing is
deleted. A successful bulk delete reloads the page, so a partly done one has
nowhere left to say what it skipped, and the reader would be left believing
every ticked document is gone.
Parameters
| Name | In | Required | Type | Description |
|---|
doc_ids | query | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/bulk-draft \
-H "Authorization: Bearer $TOKEN"
POST /docs/bulk-payment
Bulk Payment
Request body
| Field | Type | Required | Description |
|---|
doc_ids | array of string | yes | Doc Ids |
amount | number | yes | Amount |
payment_date | string | yes | Payment Date |
method | string, optional | -- | Method |
bank_account | string, optional | -- | Bank Account |
reference | string, optional | -- | Reference |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/bulk-payment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/export/csv
Export Docs Csv
Parameters
| Name | In | Required | Type | Description |
|---|
q | query | -- | string, optional | -- |
doc_type | query | -- | string, optional | -- |
status | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/export/csv \
-H "Authorization: Bearer $TOKEN"
POST /docs/import
Import Doc
Request body
| Field | Type | Required | Description |
|---|
entity_id | string | yes | Entity Id |
event_type | string | yes | Event Type |
data | object | yes | Data |
source | string | yes | Source |
idempotency_key | string | yes | Idempotency Key |
source_ts | string, optional | -- | Source Ts |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/import \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/import/batch
Batch Import Docs
Request body
| Field | Type | Required | Description |
|---|
records | array of DocImportRecord | yes | Records |
upsert | boolean | -- | Upsert |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | celerp_docs__routes__BatchImportResult |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/import/batch \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/sequences
Get Sequences
Responses
| Status | Description | Body |
|---|
200 | Successful Response | array of object |
Example
curl -X GET http://localhost:8000/docs/sequences \
-H "Authorization: Bearer $TOKEN"
PATCH /docs/sequences/{doc_type}
Patch Sequence
Parameters
| Name | In | Required | Type | Description |
|---|
doc_type | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
prefix | string, optional | -- | Prefix |
pattern | string, optional | -- | Pattern |
next | integer, optional | -- | Next |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/docs/sequences/:doc_type \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/shipment
Create Shipment From Docs
Create ONE draft shipping document (list_type="shipping_doc") from one or
more issued invoices / consignment-out memos - the "now I have to ship it"
step, single order or consolidated box alike.
Copies contact, ship-to, currency, and every document's lines in selection
order. Quantities and unit values carry over (the unit value doubles as the
customs value on the Commercial Invoice); discounts and taxes do not -
shipment paperwork is not an accounting document. A shipment goes to one
consignee in one currency, so mixed customers or currencies are rejected.
The shipment posts no journal entry and moves no stock; fulfillment stays on
the source documents, referenced via source_docs.
Request body
| Field | Type | Required | Description |
|---|
doc_ids | array of string | yes | Doc Ids |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/shipment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/summary
Get Doc Summary
Parameters
| Name | In | Required | Type | Description |
|---|
doc_type | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/summary \
-H "Authorization: Bearer $TOKEN"
GET /docs/{entity_id}
Get Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id \
-H "Authorization: Bearer $TOKEN"
PATCH /docs/{entity_id}
Patch Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
fields_changed | object | -- | Fields Changed |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/docs/:entity_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
DELETE /docs/{entity_id}
Delete Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/apply-to-invoice
Apply Cn To Invoice
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
target_doc_id | string | yes | Target Doc Id |
amount | number | yes | Amount |
date | string, optional | -- | Date |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/apply-to-invoice \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/close
Close Doc
Terminal Close for a resolved memo: the paper leaves the "partially
fulfilled" limbo once every stone has been sold, kept, or returned to stock.
Reversible via /reopen. Memo-only, live-status-only, and refused with a
product count while any line is still out at the customer (memo_out).
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/close \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/cn-refund
Refund Cn
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
amount | number | yes | Amount |
date | string | yes | Date |
method | string, optional | -- | Method |
bank_account | string, optional | -- | Bank Account |
reference | string, optional | -- | Reference |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/cn-refund \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/convert
Convert Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/convert \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/files
Upload Doc File
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/files \
-H "Authorization: Bearer $TOKEN"
GET /docs/{entity_id}/files/{file_id}
Download Doc File
Download a file attached to a doc (invoice, bill, etc.).
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
file_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id/files/:file_id \
-H "Authorization: Bearer $TOKEN"
DELETE /docs/{entity_id}/files/{file_id}
Delete Doc File
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
file_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/files/:file_id \
-H "Authorization: Bearer $TOKEN"
PATCH /docs/{entity_id}/files/{file_id}/description
Update Doc File Description
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
file_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/docs/:entity_id/files/:file_id/description \
-H "Authorization: Bearer $TOKEN"
PATCH /docs/{entity_id}/files/{file_id}/tag
Tag Doc File
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
file_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/docs/:entity_id/files/:file_id/tag \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/finalize
Finalize Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/finalize \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/fulfill-lines
Fulfill Lines
Fulfill specific line items by entity_id. Valid for memo and invoice docs only.
Inbound doc types (bill, consignment_in) must use POST /receive instead.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
line_entity_ids | array of string | yes | Line Entity Ids |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/fulfill-lines \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/{entity_id}/notes
List Doc Notes
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | array of object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id/notes \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/notes
Add Doc Note
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
note | string | yes | Note |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/notes \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
PATCH /docs/{entity_id}/notes/{note_id}
Update Doc Note
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
note_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
note | string | yes | Note |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/docs/:entity_id/notes/:note_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
DELETE /docs/{entity_id}/notes/{note_id}
Delete Doc Note
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
note_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/notes/:note_id \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/payment
Record a payment on a document
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
amount | number | yes | Amount |
payment_date | string | yes | Payment Date |
currency | string, optional | -- | Currency |
method | string, optional | -- | Method |
reference | string, optional | -- | Reference |
bank_account | string, optional | -- | Bank Account |
conversion_rate | number, optional | -- | Conversion Rate |
source_doc_id | string, optional | -- | Source Doc Id |
target_doc_id | string, optional | -- | Target Doc Id |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/payment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
DELETE /docs/{entity_id}/payments/{payment_index}
Delete Payment
Delete a payment entirely (data-entry error correction).
Unlike void-payment (which creates a reversal JE visible in the bank ledger as a
refund), delete tombstones the payment on the doc projection and voids the original
JE so it disappears from all reports. Use only for payments that were never real.
Blocked if the payment JE has been reconciled in a closed reconciliation session.
If reconciled in an open session, the JE is automatically un-matched first.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
payment_index | path | yes | integer | -- |
Request body
| Field | Type | Required | Description |
|---|
delete_reason | string, optional | -- | Delete Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/payments/:payment_index \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/{entity_id}/pdf
Get Doc Pdf
Return a PDF of the document with 'Powered by Celerp' footer branding.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id/pdf \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/receive
Receive Po
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
location_id | string | yes | Location Id |
received_items | array of ReceivedItem | yes | Received Items |
notes | string, optional | -- | Notes |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/receive \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
DELETE /docs/{entity_id}/receive
Undo Receive
Undo a goods-received on a bill.
Disposes all inventory items created by the receive and reverses the AP/Inventory JE.
Clears received_items and received_item_ids on the bill projection.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/receive \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/receive-return
Receive Return
Receive returned goods on a credit note.
Item values are resolved server-side (not trusted from the UI):
- Case 1: CN has original_doc_id -> fetch original invoice, match by SKU, use its values.
- Case 2: No original_doc_id -> query sold inventory by SKU (LIFO), use those values.
Creates new inventory items (status=available) and a reversing COGS JE.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
items | array of ReturnReceivedItem | yes | Items |
notes | string, optional | -- | Notes |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/receive-return \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
DELETE /docs/{entity_id}/receive-return
Undo Receive Return
Undo a receive-return on a credit note.
Deletes all inventory items created by the return and reverses the COGS JE.
Clears return_received_items on the CN projection.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/receive-return \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/refund
Refund Payment
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
amount | number | yes | Amount |
payment_date | string | yes | Payment Date |
currency | string, optional | -- | Currency |
method | string, optional | -- | Method |
reference | string, optional | -- | Reference |
bank_account | string, optional | -- | Bank Account |
conversion_rate | number, optional | -- | Conversion Rate |
source_doc_id | string, optional | -- | Source Doc Id |
target_doc_id | string, optional | -- | Target Doc Id |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/refund \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/renumber
Renumber Doc
Change the display number (ref_id / doc_number) of any non-void document.
The internal entity_id (storage key) is never changed. Only the ref_id field
in the document state is updated. Uniqueness is enforced across all doc
ref_ids in the company (state scan, not entity_id lookup).
Voided documents are immutable records and cannot be renumbered.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
ref_id | string | yes | Ref Id |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/renumber \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/reopen
Reopen Doc
Undo a Close: restore the memo to the status it held before closing.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/reopen \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/reserve-lines
Reserve Lines
Set selected lines reserved/available on an invoice or memo (ledger-neutral).
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
line_entity_ids | array of string | yes | Line Entity Ids |
new_status | string | yes | New Status |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/reserve-lines \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/return-items
Return Consignment Items
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
items | array of ReturnItem | yes | Items |
notes | string, optional | -- | Notes |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/return-items \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/revert-lines
Revert Lines
Revert fulfillment for specific line items. Valid for memo and invoice docs only.
Inbound doc types (bill, consignment_in) must use DELETE /receive instead.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
line_entity_ids | array of string | yes | Line Entity Ids |
quantities | object, optional | -- | Quantities |
weights | object, optional | -- | Weights |
pieces | object, optional | -- | Pieces |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/revert-lines \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/revert-to-draft
Revert Doc To Draft
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/revert-to-draft \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/send
Send Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
sent_via | string, optional | -- | Sent Via |
sent_to | string, optional | -- | Sent To |
cc | string, optional | -- | Cc |
bcc | string, optional | -- | Bcc |
subject | string, optional | -- | Subject |
message | string, optional | -- | Message |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/send \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/unvoid
Unvoid Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/unvoid \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/void
Void Doc
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/void \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/void-payment
Void Payment
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
payment_index | integer | yes | Payment Index |
void_reason | string, optional | -- | Void Reason |
refund_date | string, optional | -- | Refund Date |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/void-payment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'