REST API
Docs API
Business document API for invoices, bills, purchase orders, quotations, credit notes, shipping documents, payments, fulfillment, PDF output, and document lifecycle operations.
Generated from the Celerp 2.5.0 OpenAPI schema, 21 September 2026.
GET /docs
List Business Documents
Return business documents matching the documented filters and pagination options.
Parameters
| Name | In | Required | Type | Description |
|---|
limit | query | -- | integer, optional | Maximum number of records to return. |
offset | query | -- | integer | Number of matching records to skip before returning results. |
doc_type | query | -- | string, optional | Business document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes. |
status | query | -- | string, optional | Record or workflow status used to filter results or select the requested lifecycle state. |
status_in | query | -- | string, optional | Set of status values to include in the result. |
exclude_status | query | -- | string, optional | Status value to exclude from the result. |
date_from | query | -- | string, optional | Start date for the requested reporting or search period. |
date_to | query | -- | string, optional | End date for the requested reporting or search period. |
due_from | query | -- | string, optional | Earliest due date to include in the result. |
due_to | query | -- | string, optional | Latest due date to include in the result. |
q | query | -- | string, optional | Search text used to filter matching records. |
contact_id | query | -- | string, optional | Identifier of the customer, supplier, or other CRM contact. |
overdue_only | query | -- | boolean | Whether to return only overdue business documents. |
all_issued | query | -- | boolean | Whether to include all issued documents regardless of other open-state filters. |
unfulfilled_only | query | -- | boolean | Whether to return only documents with quantities still awaiting fulfillment. |
not_restocked | query | -- | boolean | Whether to return only documents whose returned inventory has not been restocked. |
not_stocked | query | -- | boolean | Whether to return only documents whose expected inventory has not been stocked. |
converted_to_type | query | -- | string, optional | Document type used to filter records that were converted to the specified target type. |
ids | query | -- | string, optional | Identifiers of the specific records to include. |
sort | query | -- | string, optional | Field or supported sort key used to order the result. |
dir | query | -- | string | Sort direction, typically ascending or descending. |
Responses
| Status | Description | Body |
|---|
200 | Returns the requested business documents. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs \
-H "Authorization: Bearer $TOKEN"
POST /docs
Create Business Document
Create a business document from the supplied request data.
Request body
| Field | Type | Required | Description |
|---|
doc_type | string | yes | Celerp business document type, such as invoice, purchase order, quotation, bill, or credit note when supported. |
ref_id | string, optional | -- | Human-readable document or list reference number. |
contact_id | string, optional | -- | Identifier of the customer, supplier, or CRM contact associated with the record. |
contact_name | string, optional | -- | Display name of the customer, supplier, or CRM contact. |
purchase_kind | string, optional | -- | Purchasing classification applied to the document when supported. |
line_items | array of LineItem | -- | Line items included in the document or inventory list. |
subtotal | number | -- | Subtotal before tax, discounts, and other document adjustments as applicable. |
tax | number | -- | Tax amount for the document or list. |
doc_taxes | array of TaxApplication | -- | Document-level tax entries applied in addition to line-level tax calculations. |
discount | number | -- | Discount amount or value applied to the document or list. |
shipping | number | -- | Shipping amount or shipping details associated with the document. |
total | number | -- | Final total amount for the document or list. |
payment_terms | string, optional | -- | Payment terms assigned to the document. |
due_date | string, optional | -- | Due date for payment, delivery, or scheduled completion as applicable. |
currency | string, optional | -- | Currency code used for amounts in this record. |
conversion_rate | number, optional | -- | Exchange rate used to convert the document currency to the company's base currency. |
notes | string, optional | -- | Optional notes associated with the record or operation. |
reference | string, optional | -- | Reference |
terms_template | string, optional | -- | Terms Template |
terms_text | string, optional | -- | Terms Text |
customer_note | string, optional | -- | Customer Note |
expected_delivery | string, optional | -- | Expected delivery date recorded on the business document. |
valid_until | string, optional | -- | Expiration or validity date for the quotation or document. |
carrier | string, optional | -- | Shipping carrier name. |
tracking | string, optional | -- | Shipment tracking number or reference. |
from_location_id | string, optional | -- | Identifier of the source inventory location. |
to_address | object, optional | -- | Destination or shipping address for the document. |
original_doc_id | string, optional | -- | Identifier of the original document related to this document. |
reason | string, optional | -- | Human-readable reason for the lifecycle change, cancellation, void, or other operation. |
status | string | -- | Always draft. Documents are created as drafts and move through finalize, send, and payment actions; number, payment amounts, and lifecycle dates are set by the server. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the created business document or creation result. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Draft Documents
Delete multiple draft business documents in one request. Documents that are no longer drafts are skipped.
Parameters
| Name | In | Required | Type | Description |
|---|
doc_ids | query | yes | string | Identifiers of the business documents to process. |
Responses
| Status | Description | Body |
|---|
200 | Returns the IDs of the deleted drafts and how many were deleted. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/bulk-draft \
-H "Authorization: Bearer $TOKEN"
POST /docs/bulk-payment
Record Bulk Document Payment
Record payments for multiple eligible business documents in one request.
Request body
| Field | Type | Required | Description |
|---|
doc_ids | array of string | yes | Identifiers of the business documents included in the operation. |
amount | number | yes | Monetary amount for the transaction or operation. |
payment_date | string | yes | Accounting date of the payment. |
method | string, optional | -- | Payment method used for the transaction. |
bank_account | string, optional | -- | Bank or card account used for the payment. |
reference | string, optional | -- | External or human-readable reference for the transaction. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns how the payment was allocated across documents, which documents were skipped, the total allocated and any amount left over. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Documents to CSV
Export business documents to CSV.
Parameters
| Name | In | Required | Type | Description |
|---|
cols | query | -- | string, optional | Comma-separated column names to export, in the order they should appear. Omit for the default columns. |
doc_type | query | -- | string, optional | Business document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes. |
status | query | -- | string, optional | Record or workflow status used to filter results or select the requested lifecycle state. |
status_in | query | -- | string, optional | Set of status values to include in the result. |
exclude_status | query | -- | string, optional | Status value to exclude from the result. |
date_from | query | -- | string, optional | Start date for the requested reporting or search period. |
date_to | query | -- | string, optional | End date for the requested reporting or search period. |
due_from | query | -- | string, optional | Earliest due date to include in the result. |
due_to | query | -- | string, optional | Latest due date to include in the result. |
q | query | -- | string, optional | Search text used to filter matching records. |
contact_id | query | -- | string, optional | Identifier of the customer, supplier, or other CRM contact. |
overdue_only | query | -- | boolean | Whether to return only overdue business documents. |
all_issued | query | -- | boolean | Whether to include all issued documents regardless of other open-state filters. |
unfulfilled_only | query | -- | boolean | Whether to return only documents with quantities still awaiting fulfillment. |
not_restocked | query | -- | boolean | Whether to return only documents whose returned inventory has not been restocked. |
not_stocked | query | -- | boolean | Whether to return only documents whose expected inventory has not been stocked. |
converted_to_type | query | -- | string, optional | Document type used to filter records that were converted to the specified target type. |
ids | query | -- | string, optional | Identifiers of the specific records to include. |
sort | query | -- | string, optional | Field or supported sort key used to order the result. |
dir | query | -- | string | Sort direction, typically ascending or descending. |
Responses
| Status | Description | Body |
|---|
200 | Returns the generated file or download response. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/export/csv \
-H "Authorization: Bearer $TOKEN"
POST /docs/import
Import Business Document
Import one document from a Celerp interchange record. Re-sending the same record does not create a duplicate.
Request body
| Field | Type | Required | Description |
|---|
entity_id | string | yes | Identifier of the business record. |
event_type | string | yes | Business event type represented by the imported record. |
data | object | yes | Business data contained in the imported record. |
source | string | yes | Origin or source system recorded for the imported data. |
idempotency_key | string | yes | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
source_ts | string, optional | -- | Timestamp from the source system for the imported record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the document ID and event ID. `idempotency_hit` is true when the same record was already imported. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Documents
Import multiple business documents in one request.
Request body
| Field | Type | Required | Description |
|---|
records | array of DocImportRecord | yes | List of records included in the batch request. |
upsert | boolean | -- | Whether matching imported records may update existing records. |
Responses
| Status | Description | Body |
|---|
200 | Returns how many records were created, skipped or failed, with the reason for each failure. | celerp_docs__routes__BatchImportResult |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/import/batch \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/numbered
Docs Numbered
The ids of the documents numbered exactly ``number``.
Parameters
| Name | In | Required | Type | Description |
|---|
number | query | yes | string | -- |
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/numbered \
-H "Authorization: Bearer $TOKEN"
GET /docs/sequences
Get Document Numbering Sequences
Return document numbering sequences.
Responses
| Status | Description | Body |
|---|
200 | Returns the requested document numbering sequences result. | array of object |
Example
curl -X GET http://localhost:8000/docs/sequences \
-H "Authorization: Bearer $TOKEN"
PATCH /docs/sequences/{doc_type}
Update Document Numbering Sequence
Update document numbering sequence with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|
doc_type | path | yes | string | Business document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes. |
Request body
| Field | Type | Required | Description |
|---|
prefix | string, optional | -- | Text prefix used when generating document numbers. |
pattern | string, optional | -- | Numbering pattern used to generate document references. |
next | integer, optional | -- | Next sequence number to use. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated document numbering sequence or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Shipping Document from Source Documents
Create shipping document from source documents from the supplied request data.
Request body
| Field | Type | Required | Description |
|---|
doc_ids | array of string | yes | Identifiers of the business documents included in the operation. |
Responses
| Status | Description | Body |
|---|
200 | Returns the created shipping document from source documents or creation result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/shipment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /docs/summary
Get Business Document Summary
Return business document summary.
Parameters
| Name | In | Required | Type | Description |
|---|
doc_type | query | -- | string, optional | Business document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes. |
status | query | -- | string, optional | Record or workflow status used to filter results or select the requested lifecycle state. |
status_in | query | -- | string, optional | Set of status values to include in the result. |
exclude_status | query | -- | string, optional | Status value to exclude from the result. |
date_from | query | -- | string, optional | Start date for the requested reporting or search period. |
date_to | query | -- | string, optional | End date for the requested reporting or search period. |
due_from | query | -- | string, optional | Earliest due date to include in the result. |
due_to | query | -- | string, optional | Latest due date to include in the result. |
q | query | -- | string, optional | Search text used to filter matching records. |
contact_id | query | -- | string, optional | Identifier of the customer, supplier, or other CRM contact. |
overdue_only | query | -- | boolean | Whether to return only overdue business documents. |
all_issued | query | -- | boolean | Whether to include all issued documents regardless of other open-state filters. |
unfulfilled_only | query | -- | boolean | Whether to return only documents with quantities still awaiting fulfillment. |
not_restocked | query | -- | boolean | Whether to return only documents whose returned inventory has not been restocked. |
not_stocked | query | -- | boolean | Whether to return only documents whose expected inventory has not been stocked. |
converted_to_type | query | -- | string, optional | Document type used to filter records that were converted to the specified target type. |
ids | query | -- | string, optional | Identifiers of the specific records to include. |
sort | query | -- | string, optional | Field or supported sort key used to order the result. |
dir | query | -- | string | Sort direction, typically ascending or descending. |
Responses
| Status | Description | Body |
|---|
200 | Returns the requested business document summary result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/summary \
-H "Authorization: Bearer $TOKEN"
GET /docs/{entity_id}
Get Business Document
Return business document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the requested business document result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id \
-H "Authorization: Bearer $TOKEN"
PATCH /docs/{entity_id}
Update Business Document
Update business document with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
fields_changed | object | -- | Fields and replacement values to apply to the existing record. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
expected_version | integer, optional | -- | Version of the record the caller last read. When given, the update is rejected with 409 if the record has changed since. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated business document or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Draft Business Document
Delete a draft document. Finalized documents cannot be deleted; void them instead.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns `deleted: true` once the draft is removed. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/apply-to-invoice
Apply Credit Note to Invoice
Apply a credit note's balance to an open invoice, reducing what the customer owes.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
target_doc_id | string | yes | Identifier of the target business document. |
amount | number | yes | Monetary amount for the transaction or operation. |
date | string, optional | -- | Business or accounting date for the operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Close a memo once every line has been sold, kept or returned. A memo with lines still out cannot be closed. Reopen reverses it.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Human-readable reason for the lifecycle change, cancellation, void, or other operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Credit Note
Refund a credit note's balance to the customer as money paid out.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
amount | number | yes | Monetary amount for the transaction or operation. |
date | string | yes | Business or accounting date for the operation. |
method | string, optional | -- | Payment method used for the transaction. |
bank_account | string, optional | -- | Bank or card account used for the payment. |
reference | string, optional | -- | External or human-readable reference for the transaction. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Create a new document from this one, such as an invoice from a quotation or a bill from a purchase order.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the event ID and the ID of the new document. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/convert \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/files
Upload Document File
Upload a file and attach it to a document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the event ID and the stored file's details. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/files \
-H "Authorization: Bearer $TOKEN"
GET /docs/{entity_id}/files/{file_id}
Download Document File
Download a file attached to a doc (invoice, bill, etc.).
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|
200 | Returns the generated file or download response. | -- |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document File
Delete a file attached to a document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated document record. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document File Description
Update document file description with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated document file description or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document File
Set the tag on a file attached to a document, such as receipt or contract.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated document record. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Finalize a draft document. It gets its number and posts to the ledger, and can no longer be edited freely.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the event ID and the document's assigned number. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/finalize \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/fulfill-lines
Fulfill Document Lines
Mark selected lines as fulfilled, taking their items out of stock.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
line_entity_ids | array of string | yes | Identifiers of the document or list lines included in the operation. |
Responses
| Status | Description | Body |
|---|
200 | Returns the event ID and the document's new fulfillment status. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document Notes
Return document notes matching the documented filters and pagination options.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the requested document notes. | array of object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id/notes \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/notes
Add Document Note
Add a note to a document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
note | string | yes | Note text to add or update. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the event ID and the new note ID. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document Note
Update document note with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
note_id | path | yes | string | Identifier of the note. |
Request body
| Field | Type | Required | Description |
|---|
note | string | yes | Note text to add or update. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated document note or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document Note
Delete a note from a document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
note_id | path | yes | string | Identifier of the note. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/notes/:note_id \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/payment
Record Document Payment
Record a payment received or made against a document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
amount | number | yes | Monetary amount for the transaction or operation. |
payment_date | string | yes | Accounting date of the payment. |
currency | string, optional | -- | Currency code used for amounts in this record. |
method | string, optional | -- | Payment method used for the transaction. |
reference | string, optional | -- | External or human-readable reference for the transaction. |
bank_account | string, optional | -- | Bank or card account used for the payment. |
conversion_rate | number, optional | -- | Exchange rate used to convert the document currency to the company's base currency. |
source_doc_id | string, optional | -- | Identifier of the source document associated with the payment or refund. |
target_doc_id | string, optional | -- | Identifier of the target business document. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 entered by mistake. Unlike voiding, which posts a reversal that shows in the bank ledger, deleting removes the payment and its journal entry from all reports.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
payment_index | path | yes | integer | Zero-based or API-defined index identifying the payment entry on the document. |
Request body
| Field | Type | Required | Description |
|---|
delete_reason | string, optional | -- | Reason the recorded payment is being deleted as a data-entry correction. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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
Generate Document PDF
Return a PDF of the document with 'Powered by Celerp' footer branding.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns the generated file or download response. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/docs/:entity_id/pdf \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/receive
Receive Purchase Order or Bill
Receive the goods on a purchase order or bill into stock.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
location_id | string | yes | Identifier of the inventory or business location. |
received_items | array of ReceivedItem | yes | Items and quantities received against the purchasing document. |
notes | string, optional | -- | Optional notes associated with the record or operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Goods Receipt
Undo receiving goods on a bill. The inventory items created by the receipt are removed and the inventory and accounts payable entry is reversed.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns `undone: true` and the IDs of the inventory items that were removed. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/receive \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/receive-return
Receive Returned Goods
Receive goods returned on a credit note back into stock. Item costs come from the original invoice when there is one, not from the request.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
items | array of ReturnReceivedItem | yes | Items included in the return, reconciliation, or other multi-item operation. |
notes | string, optional | -- | Optional notes associated with the record or operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the inventory items received back into stock and the total cost of goods sold reversed. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Returned-Goods Receipt
Undo receiving returned goods on a credit note. The inventory items created by the return are removed and the cost of goods sold entry is reversed.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Responses
| Status | Description | Body |
|---|
200 | Returns `undone: true` and the IDs of the inventory items that were removed. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/docs/:entity_id/receive-return \
-H "Authorization: Bearer $TOKEN"
POST /docs/{entity_id}/refund
Record Document Refund
Record a refund against a document.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
payment_index | integer | yes | Payment Index |
amount | number | yes | Amount |
payment_date | string | yes | Payment Date |
currency | string, optional | -- | Currency |
method | string, optional | -- | Method |
reference | string, optional | -- | Reference |
reason | string, optional | -- | Reason |
idempotency_key | string, optional | -- | Idempotency Key |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Change a document's display number. The number must be unique in the company. Void documents cannot be renumbered.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
ref_id | string | yes | Human-readable document or list reference number. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated document record. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Undo a Close: restore the memo to the status it held before closing.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Human-readable reason for the lifecycle change, cancellation, void, or other operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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}/reprice
Reprice Document
Update the price of every catalog item line on a draft document from a price list, in one step. If any line cannot be repriced, nothing changes.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
price_list | string | yes | Price List |
expected_version | integer | yes | Expected Version |
Responses
| Status | Description | Body |
|---|
200 | Returns the event ID, the new version, the lines repriced and skipped, and the price list used. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/reprice \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /docs/{entity_id}/reserve-lines
Reserve Document Lines
Set selected lines reserved/available on an invoice or memo (ledger-neutral).
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
line_entity_ids | array of string | yes | Identifiers of the document or list lines included in the operation. |
new_status | string | yes | Reservation state to assign to the selected document or list lines. |
Responses
| Status | Description | Body |
|---|
200 | Returns the updated reservation state of each selected line. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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
Return consignment items to the supplier and take them out of stock.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
items | array of ReturnItem | yes | Items included in the return, reconciliation, or other multi-item operation. |
notes | string, optional | -- | Optional notes associated with the record or operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document Fulfillment
Undo fulfillment on selected lines of a memo or invoice, putting the items back in stock. For bills, use undo receipt instead.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
line_entity_ids | array of string | yes | Identifiers of the document or list lines included in the operation. |
quantities | object, optional | -- | Quantities to revert for the selected lines. |
weights | object, optional | -- | Weights to revert for the selected lines when weight-based inventory is used. |
pieces | object, optional | -- | Piece counts to revert for the selected lines when piece-based inventory is used. |
Responses
| Status | Description | Body |
|---|
200 | Returns the document's new fulfillment status, the lines reverted, and whether it is now partially returned. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document to Draft
Return a finalized document to draft so it can be edited.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Human-readable reason for the lifecycle change, cancellation, void, or other operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Send a document to the contact by email, or mark it as sent.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
sent_via | string, optional | -- | Delivery channel used to send the document or list. |
sent_to | string, optional | -- | Primary recipient address or destination. |
cc | string, optional | -- | Carbon-copy recipients for the outbound message. |
bcc | string, optional | -- | Blind-carbon-copy recipients for the outbound message. |
subject | string, optional | -- | Subject line for the outbound message. |
message | string, optional | -- | Message body sent with the document or list. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Restore a voided document to its previous status.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Human-readable reason for the lifecycle change, cancellation, void, or other operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Business Document
Void a document. Its ledger entries are reversed and it stays on record.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
reason | string, optional | -- | Human-readable reason for the lifecycle change, cancellation, void, or other operation. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | 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 Document Payment
Void a payment. A reversing entry is posted and the payment stays on record.
Parameters
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | Identifier of the requested Celerp record. |
Request body
| Field | Type | Required | Description |
|---|
payment_index | integer | yes | Index identifying the payment entry on the document. |
void_reason | string, optional | -- | Reason the payment is being voided. |
refund_date | string, optional | -- | Accounting date of the refund associated with the void. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/docs/:entity_id/void-payment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'