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

NameInRequiredTypeDescription
limitquery--integer, optionalMaximum number of records to return.
offsetquery--integerNumber of matching records to skip before returning results.
doc_typequery--string, optionalBusiness document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes.
statusquery--string, optionalRecord or workflow status used to filter results or select the requested lifecycle state.
status_inquery--string, optionalSet of status values to include in the result.
exclude_statusquery--string, optionalStatus value to exclude from the result.
date_fromquery--string, optionalStart date for the requested reporting or search period.
date_toquery--string, optionalEnd date for the requested reporting or search period.
due_fromquery--string, optionalEarliest due date to include in the result.
due_toquery--string, optionalLatest due date to include in the result.
qquery--string, optionalSearch text used to filter matching records.
contact_idquery--string, optionalIdentifier of the customer, supplier, or other CRM contact.
overdue_onlyquery--booleanWhether to return only overdue business documents.
all_issuedquery--booleanWhether to include all issued documents regardless of other open-state filters.
unfulfilled_onlyquery--booleanWhether to return only documents with quantities still awaiting fulfillment.
not_restockedquery--booleanWhether to return only documents whose returned inventory has not been restocked.
not_stockedquery--booleanWhether to return only documents whose expected inventory has not been stocked.
converted_to_typequery--string, optionalDocument type used to filter records that were converted to the specified target type.
idsquery--string, optionalIdentifiers of the specific records to include.
sortquery--string, optionalField or supported sort key used to order the result.
dirquery--stringSort direction, typically ascending or descending.

Responses

StatusDescriptionBody
200Returns the requested business documents.object
422The 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

FieldTypeRequiredDescription
doc_typestringyesCelerp business document type, such as invoice, purchase order, quotation, bill, or credit note when supported.
ref_idstring, optional--Human-readable document or list reference number.
contact_idstring, optional--Identifier of the customer, supplier, or CRM contact associated with the record.
contact_namestring, optional--Display name of the customer, supplier, or CRM contact.
purchase_kindstring, optional--Purchasing classification applied to the document when supported.
line_itemsarray of LineItem--Line items included in the document or inventory list.
subtotalnumber--Subtotal before tax, discounts, and other document adjustments as applicable.
taxnumber--Tax amount for the document or list.
doc_taxesarray of TaxApplication--Document-level tax entries applied in addition to line-level tax calculations.
discountnumber--Discount amount or value applied to the document or list.
shippingnumber--Shipping amount or shipping details associated with the document.
totalnumber--Final total amount for the document or list.
payment_termsstring, optional--Payment terms assigned to the document.
due_datestring, optional--Due date for payment, delivery, or scheduled completion as applicable.
currencystring, optional--Currency code used for amounts in this record.
conversion_ratenumber, optional--Exchange rate used to convert the document currency to the company's base currency.
notesstring, optional--Optional notes associated with the record or operation.
referencestring, optional--Reference
terms_templatestring, optional--Terms Template
terms_textstring, optional--Terms Text
customer_notestring, optional--Customer Note
expected_deliverystring, optional--Expected delivery date recorded on the business document.
valid_untilstring, optional--Expiration or validity date for the quotation or document.
carrierstring, optional--Shipping carrier name.
trackingstring, optional--Shipment tracking number or reference.
from_location_idstring, optional--Identifier of the source inventory location.
to_addressobject, optional--Destination or shipping address for the document.
original_doc_idstring, optional--Identifier of the original document related to this document.
reasonstring, optional--Human-readable reason for the lifecycle change, cancellation, void, or other operation.
statusstring--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_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the created business document or creation result.object
422The 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

NameInRequiredTypeDescription
doc_idsqueryyesstringIdentifiers of the business documents to process.

Responses

StatusDescriptionBody
200Returns the IDs of the deleted drafts and how many were deleted.object
422The 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

FieldTypeRequiredDescription
doc_idsarray of stringyesIdentifiers of the business documents included in the operation.
amountnumberyesMonetary amount for the transaction or operation.
payment_datestringyesAccounting date of the payment.
methodstring, optional--Payment method used for the transaction.
bank_accountstring, optional--Bank or card account used for the payment.
referencestring, optional--External or human-readable reference for the transaction.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns how the payment was allocated across documents, which documents were skipped, the total allocated and any amount left over.object
422The 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

NameInRequiredTypeDescription
colsquery--string, optionalComma-separated column names to export, in the order they should appear. Omit for the default columns.
doc_typequery--string, optionalBusiness document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes.
statusquery--string, optionalRecord or workflow status used to filter results or select the requested lifecycle state.
status_inquery--string, optionalSet of status values to include in the result.
exclude_statusquery--string, optionalStatus value to exclude from the result.
date_fromquery--string, optionalStart date for the requested reporting or search period.
date_toquery--string, optionalEnd date for the requested reporting or search period.
due_fromquery--string, optionalEarliest due date to include in the result.
due_toquery--string, optionalLatest due date to include in the result.
qquery--string, optionalSearch text used to filter matching records.
contact_idquery--string, optionalIdentifier of the customer, supplier, or other CRM contact.
overdue_onlyquery--booleanWhether to return only overdue business documents.
all_issuedquery--booleanWhether to include all issued documents regardless of other open-state filters.
unfulfilled_onlyquery--booleanWhether to return only documents with quantities still awaiting fulfillment.
not_restockedquery--booleanWhether to return only documents whose returned inventory has not been restocked.
not_stockedquery--booleanWhether to return only documents whose expected inventory has not been stocked.
converted_to_typequery--string, optionalDocument type used to filter records that were converted to the specified target type.
idsquery--string, optionalIdentifiers of the specific records to include.
sortquery--string, optionalField or supported sort key used to order the result.
dirquery--stringSort direction, typically ascending or descending.

Responses

StatusDescriptionBody
200Returns the generated file or download response.--
422The 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

FieldTypeRequiredDescription
entity_idstringyesIdentifier of the business record.
event_typestringyesBusiness event type represented by the imported record.
dataobjectyesBusiness data contained in the imported record.
sourcestringyesOrigin or source system recorded for the imported data.
idempotency_keystringyesClient-supplied idempotency key identifying this operation so the same request can be retried safely.
source_tsstring, optional--Timestamp from the source system for the imported record.

Responses

StatusDescriptionBody
200Returns the document ID and event ID. `idempotency_hit` is true when the same record was already imported.object
422The 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

FieldTypeRequiredDescription
recordsarray of DocImportRecordyesList of records included in the batch request.
upsertboolean--Whether matching imported records may update existing records.

Responses

StatusDescriptionBody
200Returns how many records were created, skipped or failed, with the reason for each failure.celerp_docs__routes__BatchImportResult
422The 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

NameInRequiredTypeDescription
numberqueryyesstring--
doc_typequery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

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

StatusDescriptionBody
200Returns 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

NameInRequiredTypeDescription
doc_typepathyesstringBusiness document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes.

Request body

FieldTypeRequiredDescription
prefixstring, optional--Text prefix used when generating document numbers.
patternstring, optional--Numbering pattern used to generate document references.
nextinteger, optional--Next sequence number to use.

Responses

StatusDescriptionBody
200Returns the updated document numbering sequence or update result.object
422The 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

FieldTypeRequiredDescription
doc_idsarray of stringyesIdentifiers of the business documents included in the operation.

Responses

StatusDescriptionBody
200Returns the created shipping document from source documents or creation result.object
422The 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

NameInRequiredTypeDescription
doc_typequery--string, optionalBusiness document type used to filter or select documents, such as invoices, bills, purchase orders, quotations, or credit notes.
statusquery--string, optionalRecord or workflow status used to filter results or select the requested lifecycle state.
status_inquery--string, optionalSet of status values to include in the result.
exclude_statusquery--string, optionalStatus value to exclude from the result.
date_fromquery--string, optionalStart date for the requested reporting or search period.
date_toquery--string, optionalEnd date for the requested reporting or search period.
due_fromquery--string, optionalEarliest due date to include in the result.
due_toquery--string, optionalLatest due date to include in the result.
qquery--string, optionalSearch text used to filter matching records.
contact_idquery--string, optionalIdentifier of the customer, supplier, or other CRM contact.
overdue_onlyquery--booleanWhether to return only overdue business documents.
all_issuedquery--booleanWhether to include all issued documents regardless of other open-state filters.
unfulfilled_onlyquery--booleanWhether to return only documents with quantities still awaiting fulfillment.
not_restockedquery--booleanWhether to return only documents whose returned inventory has not been restocked.
not_stockedquery--booleanWhether to return only documents whose expected inventory has not been stocked.
converted_to_typequery--string, optionalDocument type used to filter records that were converted to the specified target type.
idsquery--string, optionalIdentifiers of the specific records to include.
sortquery--string, optionalField or supported sort key used to order the result.
dirquery--stringSort direction, typically ascending or descending.

Responses

StatusDescriptionBody
200Returns the requested business document summary result.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns the requested business document result.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
fields_changedobject--Fields and replacement values to apply to the existing record.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.
expected_versioninteger, optional--Version of the record the caller last read. When given, the update is rejected with 409 if the record has changed since.

Responses

StatusDescriptionBody
200Returns the updated business document or update result.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns `deleted: true` once the draft is removed.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
target_doc_idstringyesIdentifier of the target business document.
amountnumberyesMonetary amount for the transaction or operation.
datestring, optional--Business or accounting date for the operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
reasonstring, optional--Human-readable reason for the lifecycle change, cancellation, void, or other operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
amountnumberyesMonetary amount for the transaction or operation.
datestringyesBusiness or accounting date for the operation.
methodstring, optional--Payment method used for the transaction.
bank_accountstring, optional--Bank or card account used for the payment.
referencestring, optional--External or human-readable reference for the transaction.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns the event ID and the ID of the new document.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns the event ID and the stored file's details.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the generated file or download response.--
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the updated document record.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the updated document file description or update result.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the updated document record.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns the event ID and the document's assigned number.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
line_entity_idsarray of stringyesIdentifiers of the document or list lines included in the operation.

Responses

StatusDescriptionBody
200Returns the event ID and the document's new fulfillment status.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns the requested document notes.array of object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
notestringyesNote text to add or update.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the event ID and the new note ID.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
note_idpathyesstringIdentifier of the note.

Request body

FieldTypeRequiredDescription
notestringyesNote text to add or update.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the updated document note or update result.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
note_idpathyesstringIdentifier of the note.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
amountnumberyesMonetary amount for the transaction or operation.
payment_datestringyesAccounting date of the payment.
currencystring, optional--Currency code used for amounts in this record.
methodstring, optional--Payment method used for the transaction.
referencestring, optional--External or human-readable reference for the transaction.
bank_accountstring, optional--Bank or card account used for the payment.
conversion_ratenumber, optional--Exchange rate used to convert the document currency to the company's base currency.
source_doc_idstring, optional--Identifier of the source document associated with the payment or refund.
target_doc_idstring, optional--Identifier of the target business document.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.
payment_indexpathyesintegerZero-based or API-defined index identifying the payment entry on the document.

Request body

FieldTypeRequiredDescription
delete_reasonstring, optional--Reason the recorded payment is being deleted as a data-entry correction.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns the generated file or download response.--
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
location_idstringyesIdentifier of the inventory or business location.
received_itemsarray of ReceivedItemyesItems and quantities received against the purchasing document.
notesstring, optional--Optional notes associated with the record or operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns `undone: true` and the IDs of the inventory items that were removed.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
itemsarray of ReturnReceivedItemyesItems included in the return, reconciliation, or other multi-item operation.
notesstring, optional--Optional notes associated with the record or operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the inventory items received back into stock and the total cost of goods sold reversed.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Responses

StatusDescriptionBody
200Returns `undone: true` and the IDs of the inventory items that were removed.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
payment_indexintegeryesPayment Index
amountnumberyesAmount
payment_datestringyesPayment Date
currencystring, optional--Currency
methodstring, optional--Method
referencestring, optional--Reference
reasonstring, optional--Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
ref_idstringyesHuman-readable document or list reference number.

Responses

StatusDescriptionBody
200Returns the updated document record.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
reasonstring, optional--Human-readable reason for the lifecycle change, cancellation, void, or other operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
price_liststringyesPrice List
expected_versionintegeryesExpected Version

Responses

StatusDescriptionBody
200Returns the event ID, the new version, the lines repriced and skipped, and the price list used.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
line_entity_idsarray of stringyesIdentifiers of the document or list lines included in the operation.
new_statusstringyesReservation state to assign to the selected document or list lines.

Responses

StatusDescriptionBody
200Returns the updated reservation state of each selected line.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
itemsarray of ReturnItemyesItems included in the return, reconciliation, or other multi-item operation.
notesstring, optional--Optional notes associated with the record or operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
line_entity_idsarray of stringyesIdentifiers of the document or list lines included in the operation.
quantitiesobject, optional--Quantities to revert for the selected lines.
weightsobject, optional--Weights to revert for the selected lines when weight-based inventory is used.
piecesobject, optional--Piece counts to revert for the selected lines when piece-based inventory is used.

Responses

StatusDescriptionBody
200Returns the document's new fulfillment status, the lines reverted, and whether it is now partially returned.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
reasonstring, optional--Human-readable reason for the lifecycle change, cancellation, void, or other operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
sent_viastring, optional--Delivery channel used to send the document or list.
sent_tostring, optional--Primary recipient address or destination.
ccstring, optional--Carbon-copy recipients for the outbound message.
bccstring, optional--Blind-carbon-copy recipients for the outbound message.
subjectstring, optional--Subject line for the outbound message.
messagestring, optional--Message body sent with the document or list.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
reasonstring, optional--Human-readable reason for the lifecycle change, cancellation, void, or other operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
reasonstring, optional--Human-readable reason for the lifecycle change, cancellation, void, or other operation.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
entity_idpathyesstringIdentifier of the requested Celerp record.

Request body

FieldTypeRequiredDescription
payment_indexintegeryesIndex identifying the payment entry on the document.
void_reasonstring, optional--Reason the payment is being voided.
refund_datestring, optional--Accounting date of the refund associated with the void.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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 '{ ... }'