REST API

Docs API

Create and manage invoices, purchase orders, quotations, and credit notes.

Generated from the Celerp 2.4.0 OpenAPI schema, 16 September 2026.

GET /docs

List Docs

Parameters

NameInRequiredTypeDescription
doc_typequery--string, optional--
statusquery--string, optional--
status_inquery--string, optional--
exclude_statusquery--string, optional--
date_fromquery--string, optional--
date_toquery--string, optional--
due_fromquery--string, optional--
due_toquery--string, optional--
qquery--string, optional--
contact_idquery--string, optional--
limitquery--integer, optional--
offsetquery--integer--
overdue_onlyquery--boolean--
all_issuedquery--boolean--
unfulfilled_onlyquery--boolean--
not_restockedquery--boolean--
not_stockedquery--boolean--
converted_to_typequery--string, optional--
idsquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs \
  -H "Authorization: Bearer $TOKEN"

POST /docs

Create Doc

Request body

FieldTypeRequiredDescription
doc_typestringyesDoc Type
ref_idstring, optional--Ref Id
contact_idstring, optional--Contact Id
contact_namestring, optional--Contact Name
purchase_kindstring, optional--Purchase Kind
line_itemsarray of LineItem--Line Items
subtotalnumber--Subtotal
taxnumber--Tax
doc_taxesarray of TaxApplication--Doc Taxes
discountnumber--Discount
shippingnumber--Shipping
totalnumber--Total
payment_termsstring, optional--Payment Terms
due_datestring, optional--Due Date
currencystring, optional--Currency
conversion_ratenumber, optional--Conversion Rate
notesstring, optional--Notes
expected_deliverystring, optional--Expected Delivery
valid_untilstring, optional--Valid Until
carrierstring, optional--Carrier
trackingstring, optional--Tracking
from_location_idstring, optional--From Location Id
to_addressobject, optional--To Address
original_doc_idstring, optional--Original Doc Id
reasonstring, optional--Reason
statusstring--Status
amount_paidnumber--Amount Paid
amount_outstandingnumber, optional--Amount Outstanding
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /docs/bulk-draft

Bulk Delete Drafts

Delete multiple draft documents in one request. Non-draft docs are skipped (not an error). A document that has posted to the books refuses the whole batch and nothing is deleted. A successful bulk delete reloads the page, so a partly done one has nowhere left to say what it skipped, and the reader would be left believing every ticked document is gone.

Parameters

NameInRequiredTypeDescription
doc_idsqueryyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/bulk-draft \
  -H "Authorization: Bearer $TOKEN"

POST /docs/bulk-payment

Bulk Payment

Request body

FieldTypeRequiredDescription
doc_idsarray of stringyesDoc Ids
amountnumberyesAmount
payment_datestringyesPayment Date
methodstring, optional--Method
bank_accountstring, optional--Bank Account
referencestring, optional--Reference
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/bulk-payment \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /docs/export/csv

Export Docs Csv

Parameters

NameInRequiredTypeDescription
qquery--string, optional--
doc_typequery--string, optional--
statusquery--string, optional--

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs/export/csv \
  -H "Authorization: Bearer $TOKEN"

POST /docs/import

Import Doc

Request body

FieldTypeRequiredDescription
entity_idstringyesEntity Id
event_typestringyesEvent Type
dataobjectyesData
sourcestringyesSource
idempotency_keystringyesIdempotency Key
source_tsstring, optional--Source Ts

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/import \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/import/batch

Batch Import Docs

Request body

FieldTypeRequiredDescription
recordsarray of DocImportRecordyesRecords
upsertboolean--Upsert

Responses

StatusDescriptionBody
200Successful Responsecelerp_docs__routes__BatchImportResult
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/import/batch \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /docs/sequences

Get Sequences

Responses

StatusDescriptionBody
200Successful Responsearray of object

Example

curl -X GET http://localhost:8000/docs/sequences \
  -H "Authorization: Bearer $TOKEN"

PATCH /docs/sequences/{doc_type}

Patch Sequence

Parameters

NameInRequiredTypeDescription
doc_typepathyesstring--

Request body

FieldTypeRequiredDescription
prefixstring, optional--Prefix
patternstring, optional--Pattern
nextinteger, optional--Next

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/docs/sequences/:doc_type \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/shipment

Create Shipment From Docs

Create ONE draft shipping document (list_type="shipping_doc") from one or more issued invoices / consignment-out memos - the "now I have to ship it" step, single order or consolidated box alike. Copies contact, ship-to, currency, and every document's lines in selection order. Quantities and unit values carry over (the unit value doubles as the customs value on the Commercial Invoice); discounts and taxes do not - shipment paperwork is not an accounting document. A shipment goes to one consignee in one currency, so mixed customers or currencies are rejected. The shipment posts no journal entry and moves no stock; fulfillment stays on the source documents, referenced via source_docs.

Request body

FieldTypeRequiredDescription
doc_idsarray of stringyesDoc Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/shipment \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /docs/summary

Get Doc Summary

Parameters

NameInRequiredTypeDescription
doc_typequery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs/summary \
  -H "Authorization: Bearer $TOKEN"

GET /docs/{entity_id}

Get Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs/:entity_id \
  -H "Authorization: Bearer $TOKEN"

PATCH /docs/{entity_id}

Patch Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
fields_changedobject--Fields Changed
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/docs/:entity_id \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /docs/{entity_id}

Delete Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/:entity_id \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/apply-to-invoice

Apply Cn To Invoice

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
target_doc_idstringyesTarget Doc Id
amountnumberyesAmount
datestring, optional--Date
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/apply-to-invoice \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/close

Close Doc

Terminal Close for a resolved memo: the paper leaves the "partially fulfilled" limbo once every stone has been sold, kept, or returned to stock. Reversible via /reopen. Memo-only, live-status-only, and refused with a product count while any line is still out at the customer (memo_out).

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
reasonstring, optional--Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/close \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/cn-refund

Refund Cn

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
amountnumberyesAmount
datestringyesDate
methodstring, optional--Method
bank_accountstring, optional--Bank Account
referencestring, optional--Reference
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/cn-refund \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/convert

Convert Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/convert \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/files

Upload Doc File

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/files \
  -H "Authorization: Bearer $TOKEN"

GET /docs/{entity_id}/files/{file_id}

Download Doc File

Download a file attached to a doc (invoice, bill, etc.).

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
file_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs/:entity_id/files/:file_id \
  -H "Authorization: Bearer $TOKEN"

DELETE /docs/{entity_id}/files/{file_id}

Delete Doc File

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
file_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/:entity_id/files/:file_id \
  -H "Authorization: Bearer $TOKEN"

PATCH /docs/{entity_id}/files/{file_id}/description

Update Doc File Description

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
file_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/docs/:entity_id/files/:file_id/description \
  -H "Authorization: Bearer $TOKEN"

PATCH /docs/{entity_id}/files/{file_id}/tag

Tag Doc File

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
file_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/docs/:entity_id/files/:file_id/tag \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/finalize

Finalize Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/finalize \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/fulfill-lines

Fulfill Lines

Fulfill specific line items by entity_id. Valid for memo and invoice docs only. Inbound doc types (bill, consignment_in) must use POST /receive instead.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
line_entity_idsarray of stringyesLine Entity Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/fulfill-lines \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /docs/{entity_id}/notes

List Doc Notes

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responsearray of object
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs/:entity_id/notes \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/notes

Add Doc Note

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
notestringyesNote
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/notes \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

PATCH /docs/{entity_id}/notes/{note_id}

Update Doc Note

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
note_idpathyesstring--

Request body

FieldTypeRequiredDescription
notestringyesNote
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/docs/:entity_id/notes/:note_id \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /docs/{entity_id}/notes/{note_id}

Delete Doc Note

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
note_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/:entity_id/notes/:note_id \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/payment

Record a payment on a document

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
amountnumberyesAmount
payment_datestringyesPayment Date
currencystring, optional--Currency
methodstring, optional--Method
referencestring, optional--Reference
bank_accountstring, optional--Bank Account
conversion_ratenumber, optional--Conversion Rate
source_doc_idstring, optional--Source Doc Id
target_doc_idstring, optional--Target Doc Id
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/payment \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /docs/{entity_id}/payments/{payment_index}

Delete Payment

Delete a payment entirely (data-entry error correction). Unlike void-payment (which creates a reversal JE visible in the bank ledger as a refund), delete tombstones the payment on the doc projection and voids the original JE so it disappears from all reports. Use only for payments that were never real. Blocked if the payment JE has been reconciled in a closed reconciliation session. If reconciled in an open session, the JE is automatically un-matched first.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
payment_indexpathyesinteger--

Request body

FieldTypeRequiredDescription
delete_reasonstring, optional--Delete Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/:entity_id/payments/:payment_index \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /docs/{entity_id}/pdf

Get Doc Pdf

Return a PDF of the document with 'Powered by Celerp' footer branding.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/docs/:entity_id/pdf \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/receive

Receive Po

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
location_idstringyesLocation Id
received_itemsarray of ReceivedItemyesReceived Items
notesstring, optional--Notes
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/receive \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /docs/{entity_id}/receive

Undo Receive

Undo a goods-received on a bill. Disposes all inventory items created by the receive and reverses the AP/Inventory JE. Clears received_items and received_item_ids on the bill projection.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/:entity_id/receive \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/receive-return

Receive Return

Receive returned goods on a credit note. Item values are resolved server-side (not trusted from the UI): - Case 1: CN has original_doc_id -> fetch original invoice, match by SKU, use its values. - Case 2: No original_doc_id -> query sold inventory by SKU (LIFO), use those values. Creates new inventory items (status=available) and a reversing COGS JE.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
itemsarray of ReturnReceivedItemyesItems
notesstring, optional--Notes
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/receive-return \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /docs/{entity_id}/receive-return

Undo Receive Return

Undo a receive-return on a credit note. Deletes all inventory items created by the return and reverses the COGS JE. Clears return_received_items on the CN projection.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/docs/:entity_id/receive-return \
  -H "Authorization: Bearer $TOKEN"

POST /docs/{entity_id}/refund

Refund Payment

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
amountnumberyesAmount
payment_datestringyesPayment Date
currencystring, optional--Currency
methodstring, optional--Method
referencestring, optional--Reference
bank_accountstring, optional--Bank Account
conversion_ratenumber, optional--Conversion Rate
source_doc_idstring, optional--Source Doc Id
target_doc_idstring, optional--Target Doc Id
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/refund \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/renumber

Renumber Doc

Change the display number (ref_id / doc_number) of any non-void document. The internal entity_id (storage key) is never changed. Only the ref_id field in the document state is updated. Uniqueness is enforced across all doc ref_ids in the company (state scan, not entity_id lookup). Voided documents are immutable records and cannot be renumbered.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
ref_idstringyesRef Id

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/renumber \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/reopen

Reopen Doc

Undo a Close: restore the memo to the status it held before closing.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
reasonstring, optional--Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/reopen \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/reserve-lines

Reserve Lines

Set selected lines reserved/available on an invoice or memo (ledger-neutral).

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
line_entity_idsarray of stringyesLine Entity Ids
new_statusstringyesNew Status

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/reserve-lines \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/return-items

Return Consignment Items

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
itemsarray of ReturnItemyesItems
notesstring, optional--Notes
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/return-items \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/revert-lines

Revert Lines

Revert fulfillment for specific line items. Valid for memo and invoice docs only. Inbound doc types (bill, consignment_in) must use DELETE /receive instead.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
line_entity_idsarray of stringyesLine Entity Ids
quantitiesobject, optional--Quantities
weightsobject, optional--Weights
piecesobject, optional--Pieces

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/revert-lines \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/revert-to-draft

Revert Doc To Draft

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
reasonstring, optional--Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/revert-to-draft \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/send

Send Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
sent_viastring, optional--Sent Via
sent_tostring, optional--Sent To
ccstring, optional--Cc
bccstring, optional--Bcc
subjectstring, optional--Subject
messagestring, optional--Message
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/send \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/unvoid

Unvoid Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
reasonstring, optional--Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/unvoid \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/void

Void Doc

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
reasonstring, optional--Reason
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/void \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /docs/{entity_id}/void-payment

Void Payment

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
payment_indexintegeryesPayment Index
void_reasonstring, optional--Void Reason
refund_datestring, optional--Refund Date
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/docs/:entity_id/void-payment \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'