API reference · version 1
Invoices
Sales invoices, credit notes and debit notes.
- GET
/invoicesList invoices - GET
/invoices/{id}Get a sales invoice, credit note or debit note - POST
/invoicesCreate a draft sales invoice, credit note or debit note - PUT
/invoices/{id}Replace a draft - DELETE
/invoices/{id}Delete a draft - POST
/invoices/{id}/postPost a draft - POST
/invoices/{id}/voidVoid a posted document
List invoices
GET/api/v1/invoices
Sales invoices, credit notes and debit notes, newest first. Drafts have no number until they are posted.
Query parameters
| Field | Type | Description |
|---|---|---|
| limit | integer | Records per page, 1–100 (default 25).≥ 1 · ≤ 100 · default 25 |
| cursor | string | The nextCursor of the previous page.at most 64 characters |
| updatedSince | string | Only records changed at or after this instant (records without a change time: created). |
| status | enum | one of DRAFT, POSTED, VOID |
| kind | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| contactId | string | The customer or supplier (GET /contacts).at most 64 characters |
| number | string | The document number exactly (ignoring capitals), e.g. INV-2026-00042.at most 64 characters |
| from | string | Issue date from.pattern ^\d{4}-\d{2}-\d{2}$ |
| to | string | Issue date to.pattern ^\d{4}-\d{2}-\d{2}$ |
Example
curl "https://your-workspace.omnibooks.online/api/v1/invoices?status=POSTED&limit=50" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"data": [
{
"id": "cmabc123def456",
"number": "INV-2026-00042",
"kind": "INVOICE",
"status": "POSTED",
"contactId": "cmabc123def456",
"contactName": "Gulf Star Trading LLC",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"supplyDate": null,
"reference": null,
"notes": null,
"currency": "OMR",
"exchangeRate": "1",
"pricesIncludeTax": false,
"subtotal": "105.000",
"taxTotal": "105.000",
"total": "105.000",
"amountDue": "105.000",
"totalBase": "105.000",
"originalDocumentId": null,
"salesOrderId": null,
"purchaseOrderId": null,
"branchId": "cmabc123def456",
"customFields": {
"delivery_slot": "Morning"
},
"lines": [
{
"lineNumber": 1,
"productId": "cmabc123def456",
"description": "Ceramic floor tile 60×60",
"quantity": "105.000",
"unitPrice": "105.000",
"discountPercent": "text",
"unitCode": "H87",
"accountId": "cmabc123def456",
"taxCodeId": "cmabc123def456",
"netAmount": "105.000",
"taxAmount": "105.000",
"totalAmount": "105.000"
}
],
"postedAt": "2026-11-30T08:16:00.000Z",
"voidedAt": null,
"createdAt": "2026-11-30T08:15:00.000Z",
"updatedAt": "2026-11-30T08:15:00.000Z"
}
],
"nextCursor": null
}Answer fields
| Field | Type | Description |
|---|---|---|
| datarequired | array of object | |
| data[].idrequired | string | An OmniBooks id. |
| data[].numberrequired | string | Given at posting; null for drafts.may be null |
| data[].kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| data[].statusrequired | enum | one of DRAFT, POSTED, VOID |
| data[].contactIdrequired | string | An OmniBooks id. |
| data[].contactNamerequired | string | |
| data[].issueDaterequired | string | A calendar date, YYYY-MM-DD. |
| data[].dueDaterequired | string | A calendar date, YYYY-MM-DD. |
| data[].supplyDaterequired | string | A calendar date, YYYY-MM-DD.may be null |
| data[].referencerequired | string | Your reference (the customer's PO number, the supplier's invoice number).may be null |
| data[].notesrequired | string | Notes; on sales documents they are printed.may be null |
| data[].currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| data[].exchangeRaterequired | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies. |
| data[].pricesIncludeTaxrequired | boolean | Unit prices include tax. |
| data[].subtotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].taxTotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].totalrequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].amountDuerequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].totalBaserequired | string | The total in the company's base currency. |
| data[].originalDocumentIdrequired | string | Credit and debit notes: the invoice or bill they adjust.may be null |
| data[].salesOrderIdrequired | string | An OmniBooks id.may be null |
| data[].purchaseOrderIdrequired | string | An OmniBooks id.may be null |
| data[].branchIdrequired | string | An OmniBooks id. |
| data[].customFieldsrequired | object (by key) | The company's custom fields, by key (GET /custom-fields lists them). Empty fields are left out. |
| data[].linesrequired | array of object | The lines, in order. |
| data[].lines[].lineNumberrequired | number | |
| data[].lines[].productIdrequired | string | An OmniBooks id.may be null |
| data[].lines[].descriptionrequired | string | What is sold or bought, as printed. |
| data[].lines[].quantityrequired | string | A decimal quantity as a string. |
| data[].lines[].unitPricerequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].lines[].discountPercentrequired | string | Line discount, percent. |
| data[].lines[].unitCoderequired | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram. |
| data[].lines[].accountIdrequired | string | An OmniBooks id. |
| data[].lines[].taxCodeIdrequired | string | An OmniBooks id.may be null |
| data[].lines[].netAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].lines[].taxAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].lines[].totalAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| data[].postedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| data[].voidedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| data[].createdAtrequired | string | An instant, ISO 8601 in UTC. |
| data[].updatedAtrequired | string | An instant, ISO 8601 in UTC. |
| nextCursorrequired | string | Pass as cursor for the next page; null on the last page.may be null |
Get a sales invoice, credit note or debit note
GET/api/v1/invoices/{id}
One document with its lines and custom fields.
Path
| Field | Type | Description |
|---|---|---|
| idrequired | string | The record's id. |
Example
curl "https://your-workspace.omnibooks.online/api/v1/invoices/<id>" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"id": "cmabc123def456",
"number": "INV-2026-00042",
"kind": "INVOICE",
"status": "POSTED",
"contactId": "cmabc123def456",
"contactName": "Gulf Star Trading LLC",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"supplyDate": null,
"reference": null,
"notes": null,
"currency": "OMR",
"exchangeRate": "1",
"pricesIncludeTax": false,
"subtotal": "105.000",
"taxTotal": "105.000",
"total": "105.000",
"amountDue": "105.000",
"totalBase": "105.000",
"originalDocumentId": null,
"salesOrderId": null,
"purchaseOrderId": null,
"branchId": "cmabc123def456",
"customFields": {
"delivery_slot": "Morning"
},
"lines": [
{
"lineNumber": 1,
"productId": "cmabc123def456",
"description": "Ceramic floor tile 60×60",
"quantity": "105.000",
"unitPrice": "105.000",
"discountPercent": "text",
"unitCode": "H87",
"accountId": "cmabc123def456",
"taxCodeId": "cmabc123def456",
"netAmount": "105.000",
"taxAmount": "105.000",
"totalAmount": "105.000"
}
],
"postedAt": "2026-11-30T08:16:00.000Z",
"voidedAt": null,
"createdAt": "2026-11-30T08:15:00.000Z",
"updatedAt": "2026-11-30T08:15:00.000Z"
}Answer fields
| Field | Type | Description |
|---|---|---|
| idrequired | string | An OmniBooks id. |
| numberrequired | string | Given at posting; null for drafts.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| statusrequired | enum | one of DRAFT, POSTED, VOID |
| contactIdrequired | string | An OmniBooks id. |
| contactNamerequired | string | |
| issueDaterequired | string | A calendar date, YYYY-MM-DD. |
| dueDaterequired | string | A calendar date, YYYY-MM-DD. |
| supplyDaterequired | string | A calendar date, YYYY-MM-DD.may be null |
| referencerequired | string | Your reference (the customer's PO number, the supplier's invoice number).may be null |
| notesrequired | string | Notes; on sales documents they are printed.may be null |
| currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| exchangeRaterequired | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies. |
| pricesIncludeTaxrequired | boolean | Unit prices include tax. |
| subtotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| taxTotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| totalrequired | string | A decimal amount as a string, e.g. "105.000". |
| amountDuerequired | string | A decimal amount as a string, e.g. "105.000". |
| totalBaserequired | string | The total in the company's base currency. |
| originalDocumentIdrequired | string | Credit and debit notes: the invoice or bill they adjust.may be null |
| salesOrderIdrequired | string | An OmniBooks id.may be null |
| purchaseOrderIdrequired | string | An OmniBooks id.may be null |
| branchIdrequired | string | An OmniBooks id. |
| customFieldsrequired | object (by key) | The company's custom fields, by key (GET /custom-fields lists them). Empty fields are left out. |
| linesrequired | array of object | The lines, in order. |
| lines[].lineNumberrequired | number | |
| lines[].productIdrequired | string | An OmniBooks id.may be null |
| lines[].descriptionrequired | string | What is sold or bought, as printed. |
| lines[].quantityrequired | string | A decimal quantity as a string. |
| lines[].unitPricerequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].discountPercentrequired | string | Line discount, percent. |
| lines[].unitCoderequired | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram. |
| lines[].accountIdrequired | string | An OmniBooks id. |
| lines[].taxCodeIdrequired | string | An OmniBooks id.may be null |
| lines[].netAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].taxAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].totalAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| postedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| voidedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| createdAtrequired | string | An instant, ISO 8601 in UTC. |
| updatedAtrequired | string | An instant, ISO 8601 in UTC. |
Create a draft sales invoice, credit note or debit note
POST/api/v1/invoices
Creates a draft. Lines on stock-tracked items need the item; lines without one need an account. Amounts are worked out by OmniBooks (send prices, not totals). Raise from a sales order with salesOrderId and each line's soLineId; a credit or debit note names the invoice in originalDocumentId. Post it with POST /invoices/{id}/post. Custom fields go in customFields by key; a document from an order takes the order's values when you send none.
Body
| Field | Type | Description |
|---|---|---|
| customFields | object (by key) | Custom field values by key (GET /custom-fields). Only the keys you send change; an empty value clears one; unknown keys are refused.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| contactIdrequired | string | The customer or supplier (GET /contacts).at least 1 characters · at most 64 characters |
| contactPersonId | string | The person to address it to (one of the contact's people); left out = the contact's primary person.at most 64 characters · may be null |
| billingAddressId | string | One of the contact's addresses; left out = the contact's main address.at most 64 characters · may be null |
| deliveryAddressId | string | Delivery address; left out = the contact's default delivery address.at most 64 characters · may be null |
| issueDaterequired | string | YYYY-MM-DD. Must be in an open accounting period. |
| dueDaterequired | string | YYYY-MM-DD. |
| supplyDate | string | YYYY-MM-DD, when the supply date differs from the issue date.may be null |
| creditReasonCode | string | Credit and debit notes: the reason code (e-invoicing).at most 8 characters · may be null |
| reference | string | Your reference (the customer's PO number, the supplier's invoice number).at most 80 characters · may be null |
| notes | string | Notes; on sales documents they are printed.at most 2000 characters · may be null |
| originalDocumentId | string | Credit and debit notes: the invoice or bill being adjusted.at most 64 characters · may be null |
| isOpeningBalance | boolean | An opening balance carried over from an earlier system (no tax, no stock).default false |
| warehouseId | string | Where stock moves from or to; left out = the branch's default warehouse.at most 64 characters · may be null |
| purchaseOrderId | string | Bills: the purchase order being billed.at most 64 characters · may be null |
| salesOrderId | string | Invoices: the sales order being invoiced.at most 64 characters · may be null |
| branchId | string | GET /branches; left out = the head office (or the documents' branch).at most 64 characters · may be null |
| currency | string | ISO 4217 code; left out = the contact's currency, else the company's base currency.at most 3 characters · may be null |
| exchangeRate | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies.at most 24 characters · may be null |
| pricesIncludeTax | boolean | Unit prices include tax.default false |
| withholdingSection | string | India: the TDS section of the withholding.at most 12 characters · may be null |
| withholdingRate | string | Bills: tax withheld from the supplier, percent.at most 8 characters · may be null |
| linesrequired | array of object | The lines, in order.at most 200 items |
| lines[].descriptionrequired | string | What is sold or bought, as printed.at most 500 characters |
| lines[].quantityrequired | string | Decimal string.at most 24 characters |
| lines[].unitPricerequired | string | Decimal string, in the document's currency.at most 24 characters |
| lines[].discountPercent | string | Line discount, percent.at most 12 characters · may be null |
| lines[].accountIdrequired | string | Ledger account (GET /accounts): the item's sales, purchase or inventory account, or any postable account for a line without an item.at most 64 characters |
| lines[].taxCodeId | string | GET /tax-codes; left out = no tax.at most 64 characters · may be null |
| lines[].descriptionAr | string | Arabic description, printed on bilingual documents.at most 500 characters · may be null |
| lines[].itemType | string | G (goods) or S (services), for e-invoices that need it.at most 1 characters · may be null |
| lines[].classificationCode | string | HS, HSN/SAC or the tax authority's item code, where e-invoicing needs one.at most 40 characters · may be null |
| lines[].unitCode | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram.at most 8 characters · may be null |
| lines[].marginCost | string | Profit margin scheme: the item's cost.at most 24 characters · may be null |
| lines[].productId | string | The item (GET /items). Needed for stock-tracked goods.at most 64 characters · may be null |
| lines[].poLineId | string | Bills from a purchase order: the order line.at most 64 characters · may be null |
| lines[].soLineId | string | Invoices from a sales order: the order line.at most 64 characters · may be null |
| lines[].departmentId | string | Dimension: department.at most 64 characters · may be null |
| lines[].projectId | string | Dimension: project.at most 64 characters · may be null |
| lines[].costCenterId | string | Dimension: cost centre.at most 64 characters · may be null |
| lines[].allocationRuleId | string | Dimension: an allocation rule that splits the line.at most 64 characters · may be null |
| lines[].batches | array of object | Batch-tracked items: batch numbers and quantities.at most 50 items · may be null |
| lines[].batches[].batchId | string | at most 64 characters · may be null |
| lines[].batches[].number | string | at most 60 characters · may be null |
| lines[].batches[].expiryDate | string | may be null |
| lines[].batches[].manufactureDate | string | may be null |
| lines[].batches[].quantityrequired | string | Decimal string.at most 24 characters |
| lines[].batches[].serials | array of string | at most 2000 items · may be null |
Example
curl -X POST "https://your-workspace.omnibooks.online/api/v1/invoices" \
-H "Authorization: Bearer $OMNIBOOKS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"kind": "INVOICE",
"contactId": "cmcontact123",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"reference": "PO-4471",
"lines": [
{
"productId": "cmitem123",
"description": "Ceramic floor tile 60×60",
"quantity": "200",
"unitPrice": "18.000",
"accountId": "cmaccount4100",
"taxCodeId": "cmtaxvat5"
}
],
"customFields": {
"delivery_slot": "Morning"
}
}'{
"id": "cmabc123def456",
"number": "INV-2026-00042",
"kind": "INVOICE",
"status": "POSTED",
"contactId": "cmabc123def456",
"contactName": "Gulf Star Trading LLC",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"supplyDate": null,
"reference": null,
"notes": null,
"currency": "OMR",
"exchangeRate": "1",
"pricesIncludeTax": false,
"subtotal": "105.000",
"taxTotal": "105.000",
"total": "105.000",
"amountDue": "105.000",
"totalBase": "105.000",
"originalDocumentId": null,
"salesOrderId": null,
"purchaseOrderId": null,
"branchId": "cmabc123def456",
"customFields": {
"delivery_slot": "Morning"
},
"lines": [
{
"lineNumber": 1,
"productId": "cmabc123def456",
"description": "Ceramic floor tile 60×60",
"quantity": "105.000",
"unitPrice": "105.000",
"discountPercent": "text",
"unitCode": "H87",
"accountId": "cmabc123def456",
"taxCodeId": "cmabc123def456",
"netAmount": "105.000",
"taxAmount": "105.000",
"totalAmount": "105.000"
}
],
"postedAt": "2026-11-30T08:16:00.000Z",
"voidedAt": null,
"createdAt": "2026-11-30T08:15:00.000Z",
"updatedAt": "2026-11-30T08:15:00.000Z"
}Answer fields
| Field | Type | Description |
|---|---|---|
| idrequired | string | An OmniBooks id. |
| numberrequired | string | Given at posting; null for drafts.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| statusrequired | enum | one of DRAFT, POSTED, VOID |
| contactIdrequired | string | An OmniBooks id. |
| contactNamerequired | string | |
| issueDaterequired | string | A calendar date, YYYY-MM-DD. |
| dueDaterequired | string | A calendar date, YYYY-MM-DD. |
| supplyDaterequired | string | A calendar date, YYYY-MM-DD.may be null |
| referencerequired | string | Your reference (the customer's PO number, the supplier's invoice number).may be null |
| notesrequired | string | Notes; on sales documents they are printed.may be null |
| currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| exchangeRaterequired | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies. |
| pricesIncludeTaxrequired | boolean | Unit prices include tax. |
| subtotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| taxTotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| totalrequired | string | A decimal amount as a string, e.g. "105.000". |
| amountDuerequired | string | A decimal amount as a string, e.g. "105.000". |
| totalBaserequired | string | The total in the company's base currency. |
| originalDocumentIdrequired | string | Credit and debit notes: the invoice or bill they adjust.may be null |
| salesOrderIdrequired | string | An OmniBooks id.may be null |
| purchaseOrderIdrequired | string | An OmniBooks id.may be null |
| branchIdrequired | string | An OmniBooks id. |
| customFieldsrequired | object (by key) | The company's custom fields, by key (GET /custom-fields lists them). Empty fields are left out. |
| linesrequired | array of object | The lines, in order. |
| lines[].lineNumberrequired | number | |
| lines[].productIdrequired | string | An OmniBooks id.may be null |
| lines[].descriptionrequired | string | What is sold or bought, as printed. |
| lines[].quantityrequired | string | A decimal quantity as a string. |
| lines[].unitPricerequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].discountPercentrequired | string | Line discount, percent. |
| lines[].unitCoderequired | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram. |
| lines[].accountIdrequired | string | An OmniBooks id. |
| lines[].taxCodeIdrequired | string | An OmniBooks id.may be null |
| lines[].netAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].taxAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].totalAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| postedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| voidedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| createdAtrequired | string | An instant, ISO 8601 in UTC. |
| updatedAtrequired | string | An instant, ISO 8601 in UTC. |
Errors this endpoint may answer
422 CURRENCY_INVALID: The currency differs from the order it is raised from.422 PERIOD_CLOSED: The issue date is in a closed period.
Replace a draft
PUT/api/v1/invoices/{id}
Replaces a draft completely (send every field and every line, as for create). Posted documents can't change: void them or issue a credit note.
Path
| Field | Type | Description |
|---|---|---|
| idrequired | string | The record's id. |
Body
| Field | Type | Description |
|---|---|---|
| customFields | object (by key) | Custom field values by key (GET /custom-fields). Only the keys you send change; an empty value clears one; unknown keys are refused.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| contactIdrequired | string | The customer or supplier (GET /contacts).at least 1 characters · at most 64 characters |
| contactPersonId | string | The person to address it to (one of the contact's people); left out = the contact's primary person.at most 64 characters · may be null |
| billingAddressId | string | One of the contact's addresses; left out = the contact's main address.at most 64 characters · may be null |
| deliveryAddressId | string | Delivery address; left out = the contact's default delivery address.at most 64 characters · may be null |
| issueDaterequired | string | YYYY-MM-DD. Must be in an open accounting period. |
| dueDaterequired | string | YYYY-MM-DD. |
| supplyDate | string | YYYY-MM-DD, when the supply date differs from the issue date.may be null |
| creditReasonCode | string | Credit and debit notes: the reason code (e-invoicing).at most 8 characters · may be null |
| reference | string | Your reference (the customer's PO number, the supplier's invoice number).at most 80 characters · may be null |
| notes | string | Notes; on sales documents they are printed.at most 2000 characters · may be null |
| originalDocumentId | string | Credit and debit notes: the invoice or bill being adjusted.at most 64 characters · may be null |
| isOpeningBalance | boolean | An opening balance carried over from an earlier system (no tax, no stock).default false |
| warehouseId | string | Where stock moves from or to; left out = the branch's default warehouse.at most 64 characters · may be null |
| purchaseOrderId | string | Bills: the purchase order being billed.at most 64 characters · may be null |
| salesOrderId | string | Invoices: the sales order being invoiced.at most 64 characters · may be null |
| branchId | string | GET /branches; left out = the head office (or the documents' branch).at most 64 characters · may be null |
| currency | string | ISO 4217 code; left out = the contact's currency, else the company's base currency.at most 3 characters · may be null |
| exchangeRate | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies.at most 24 characters · may be null |
| pricesIncludeTax | boolean | Unit prices include tax.default false |
| withholdingSection | string | India: the TDS section of the withholding.at most 12 characters · may be null |
| withholdingRate | string | Bills: tax withheld from the supplier, percent.at most 8 characters · may be null |
| linesrequired | array of object | The lines, in order.at most 200 items |
| lines[].descriptionrequired | string | What is sold or bought, as printed.at most 500 characters |
| lines[].quantityrequired | string | Decimal string.at most 24 characters |
| lines[].unitPricerequired | string | Decimal string, in the document's currency.at most 24 characters |
| lines[].discountPercent | string | Line discount, percent.at most 12 characters · may be null |
| lines[].accountIdrequired | string | Ledger account (GET /accounts): the item's sales, purchase or inventory account, or any postable account for a line without an item.at most 64 characters |
| lines[].taxCodeId | string | GET /tax-codes; left out = no tax.at most 64 characters · may be null |
| lines[].descriptionAr | string | Arabic description, printed on bilingual documents.at most 500 characters · may be null |
| lines[].itemType | string | G (goods) or S (services), for e-invoices that need it.at most 1 characters · may be null |
| lines[].classificationCode | string | HS, HSN/SAC or the tax authority's item code, where e-invoicing needs one.at most 40 characters · may be null |
| lines[].unitCode | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram.at most 8 characters · may be null |
| lines[].marginCost | string | Profit margin scheme: the item's cost.at most 24 characters · may be null |
| lines[].productId | string | The item (GET /items). Needed for stock-tracked goods.at most 64 characters · may be null |
| lines[].poLineId | string | Bills from a purchase order: the order line.at most 64 characters · may be null |
| lines[].soLineId | string | Invoices from a sales order: the order line.at most 64 characters · may be null |
| lines[].departmentId | string | Dimension: department.at most 64 characters · may be null |
| lines[].projectId | string | Dimension: project.at most 64 characters · may be null |
| lines[].costCenterId | string | Dimension: cost centre.at most 64 characters · may be null |
| lines[].allocationRuleId | string | Dimension: an allocation rule that splits the line.at most 64 characters · may be null |
| lines[].batches | array of object | Batch-tracked items: batch numbers and quantities.at most 50 items · may be null |
| lines[].batches[].batchId | string | at most 64 characters · may be null |
| lines[].batches[].number | string | at most 60 characters · may be null |
| lines[].batches[].expiryDate | string | may be null |
| lines[].batches[].manufactureDate | string | may be null |
| lines[].batches[].quantityrequired | string | Decimal string.at most 24 characters |
| lines[].batches[].serials | array of string | at most 2000 items · may be null |
Example
curl -X PUT "https://your-workspace.omnibooks.online/api/v1/invoices/<id>" \
-H "Authorization: Bearer $OMNIBOOKS_KEY" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "cmabc123def456",
"number": "INV-2026-00042",
"kind": "INVOICE",
"status": "POSTED",
"contactId": "cmabc123def456",
"contactName": "Gulf Star Trading LLC",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"supplyDate": null,
"reference": null,
"notes": null,
"currency": "OMR",
"exchangeRate": "1",
"pricesIncludeTax": false,
"subtotal": "105.000",
"taxTotal": "105.000",
"total": "105.000",
"amountDue": "105.000",
"totalBase": "105.000",
"originalDocumentId": null,
"salesOrderId": null,
"purchaseOrderId": null,
"branchId": "cmabc123def456",
"customFields": {
"delivery_slot": "Morning"
},
"lines": [
{
"lineNumber": 1,
"productId": "cmabc123def456",
"description": "Ceramic floor tile 60×60",
"quantity": "105.000",
"unitPrice": "105.000",
"discountPercent": "text",
"unitCode": "H87",
"accountId": "cmabc123def456",
"taxCodeId": "cmabc123def456",
"netAmount": "105.000",
"taxAmount": "105.000",
"totalAmount": "105.000"
}
],
"postedAt": "2026-11-30T08:16:00.000Z",
"voidedAt": null,
"createdAt": "2026-11-30T08:15:00.000Z",
"updatedAt": "2026-11-30T08:15:00.000Z"
}Answer fields
| Field | Type | Description |
|---|---|---|
| idrequired | string | An OmniBooks id. |
| numberrequired | string | Given at posting; null for drafts.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| statusrequired | enum | one of DRAFT, POSTED, VOID |
| contactIdrequired | string | An OmniBooks id. |
| contactNamerequired | string | |
| issueDaterequired | string | A calendar date, YYYY-MM-DD. |
| dueDaterequired | string | A calendar date, YYYY-MM-DD. |
| supplyDaterequired | string | A calendar date, YYYY-MM-DD.may be null |
| referencerequired | string | Your reference (the customer's PO number, the supplier's invoice number).may be null |
| notesrequired | string | Notes; on sales documents they are printed.may be null |
| currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| exchangeRaterequired | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies. |
| pricesIncludeTaxrequired | boolean | Unit prices include tax. |
| subtotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| taxTotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| totalrequired | string | A decimal amount as a string, e.g. "105.000". |
| amountDuerequired | string | A decimal amount as a string, e.g. "105.000". |
| totalBaserequired | string | The total in the company's base currency. |
| originalDocumentIdrequired | string | Credit and debit notes: the invoice or bill they adjust.may be null |
| salesOrderIdrequired | string | An OmniBooks id.may be null |
| purchaseOrderIdrequired | string | An OmniBooks id.may be null |
| branchIdrequired | string | An OmniBooks id. |
| customFieldsrequired | object (by key) | The company's custom fields, by key (GET /custom-fields lists them). Empty fields are left out. |
| linesrequired | array of object | The lines, in order. |
| lines[].lineNumberrequired | number | |
| lines[].productIdrequired | string | An OmniBooks id.may be null |
| lines[].descriptionrequired | string | What is sold or bought, as printed. |
| lines[].quantityrequired | string | A decimal quantity as a string. |
| lines[].unitPricerequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].discountPercentrequired | string | Line discount, percent. |
| lines[].unitCoderequired | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram. |
| lines[].accountIdrequired | string | An OmniBooks id. |
| lines[].taxCodeIdrequired | string | An OmniBooks id.may be null |
| lines[].netAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].taxAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].totalAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| postedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| voidedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| createdAtrequired | string | An instant, ISO 8601 in UTC. |
| updatedAtrequired | string | An instant, ISO 8601 in UTC. |
Errors this endpoint may answer
422 IMMUTABLE: The document is posted.
Delete a draft
DELETE/api/v1/invoices/{id}
Deletes a draft. Posted documents are voided instead.
Path
| Field | Type | Description |
|---|---|---|
| idrequired | string | The record's id. |
Example
curl -X DELETE "https://your-workspace.omnibooks.online/api/v1/invoices/<id>" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"Answers 204 with no body.
Post a draft
POST/api/v1/invoices/{id}/post
Posts the draft: it gets its number, its journal is written and stock moves. Where an e-invoicing connection is set up, the e-invoice is queued for the tax authority or provider, as from the screen. Approval policies apply: a document that needs approval is refused until it is approved in OmniBooks.
Path
| Field | Type | Description |
|---|---|---|
| idrequired | string | The record's id. |
Body
| Field | Type | Description |
|---|---|---|
| matchApprovalReason | string | Bills: the reason for accepting a three-way match exception (needs purchases.approve on the member).at most 500 characters |
Example
curl -X POST "https://your-workspace.omnibooks.online/api/v1/invoices/<id>/post" \
-H "Authorization: Bearer $OMNIBOOKS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"id": "cmabc123def456",
"number": "INV-2026-00042",
"kind": "INVOICE",
"status": "POSTED",
"contactId": "cmabc123def456",
"contactName": "Gulf Star Trading LLC",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"supplyDate": null,
"reference": null,
"notes": null,
"currency": "OMR",
"exchangeRate": "1",
"pricesIncludeTax": false,
"subtotal": "105.000",
"taxTotal": "105.000",
"total": "105.000",
"amountDue": "105.000",
"totalBase": "105.000",
"originalDocumentId": null,
"salesOrderId": null,
"purchaseOrderId": null,
"branchId": "cmabc123def456",
"customFields": {
"delivery_slot": "Morning"
},
"lines": [
{
"lineNumber": 1,
"productId": "cmabc123def456",
"description": "Ceramic floor tile 60×60",
"quantity": "105.000",
"unitPrice": "105.000",
"discountPercent": "text",
"unitCode": "H87",
"accountId": "cmabc123def456",
"taxCodeId": "cmabc123def456",
"netAmount": "105.000",
"taxAmount": "105.000",
"totalAmount": "105.000"
}
],
"postedAt": "2026-11-30T08:16:00.000Z",
"voidedAt": null,
"createdAt": "2026-11-30T08:15:00.000Z",
"updatedAt": "2026-11-30T08:15:00.000Z",
"warnings": [
"text"
]
}Answer fields
| Field | Type | Description |
|---|---|---|
| idrequired | string | An OmniBooks id. |
| numberrequired | string | Given at posting; null for drafts.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| statusrequired | enum | one of DRAFT, POSTED, VOID |
| contactIdrequired | string | An OmniBooks id. |
| contactNamerequired | string | |
| issueDaterequired | string | A calendar date, YYYY-MM-DD. |
| dueDaterequired | string | A calendar date, YYYY-MM-DD. |
| supplyDaterequired | string | A calendar date, YYYY-MM-DD.may be null |
| referencerequired | string | Your reference (the customer's PO number, the supplier's invoice number).may be null |
| notesrequired | string | Notes; on sales documents they are printed.may be null |
| currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| exchangeRaterequired | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies. |
| pricesIncludeTaxrequired | boolean | Unit prices include tax. |
| subtotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| taxTotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| totalrequired | string | A decimal amount as a string, e.g. "105.000". |
| amountDuerequired | string | A decimal amount as a string, e.g. "105.000". |
| totalBaserequired | string | The total in the company's base currency. |
| originalDocumentIdrequired | string | Credit and debit notes: the invoice or bill they adjust.may be null |
| salesOrderIdrequired | string | An OmniBooks id.may be null |
| purchaseOrderIdrequired | string | An OmniBooks id.may be null |
| branchIdrequired | string | An OmniBooks id. |
| customFieldsrequired | object (by key) | The company's custom fields, by key (GET /custom-fields lists them). Empty fields are left out. |
| linesrequired | array of object | The lines, in order. |
| lines[].lineNumberrequired | number | |
| lines[].productIdrequired | string | An OmniBooks id.may be null |
| lines[].descriptionrequired | string | What is sold or bought, as printed. |
| lines[].quantityrequired | string | A decimal quantity as a string. |
| lines[].unitPricerequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].discountPercentrequired | string | Line discount, percent. |
| lines[].unitCoderequired | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram. |
| lines[].accountIdrequired | string | An OmniBooks id. |
| lines[].taxCodeIdrequired | string | An OmniBooks id.may be null |
| lines[].netAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].taxAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].totalAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| postedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| voidedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| createdAtrequired | string | An instant, ISO 8601 in UTC. |
| updatedAtrequired | string | An instant, ISO 8601 in UTC. |
| warningsrequired | array of string |
Errors this endpoint may answer
422 APPROVAL_REQUIRED: An approval policy applies and the document is not approved.422 EINVOICE_NOT_READY: Strict e-invoicing is on and details are missing.
Void a posted document
POST/api/v1/invoices/{id}/void
Voids a posted document: its journal is reversed on the date given and its stock movements are mirrored. Documents with payments or credits applied must have them removed first.
Path
| Field | Type | Description |
|---|---|---|
| idrequired | string | The record's id. |
Body
| Field | Type | Description |
|---|---|---|
| reasonrequired | string | Why (kept in the audit log).at least 3 characters · at most 500 characters |
| date | string | The void's date (default: today). The reversal posts on it.pattern ^\d{4}-\d{2}-\d{2}$ |
Example
curl -X POST "https://your-workspace.omnibooks.online/api/v1/invoices/<id>/void" \
-H "Authorization: Bearer $OMNIBOOKS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"id": "cmabc123def456",
"number": "INV-2026-00042",
"kind": "INVOICE",
"status": "POSTED",
"contactId": "cmabc123def456",
"contactName": "Gulf Star Trading LLC",
"issueDate": "2026-11-30",
"dueDate": "2026-12-30",
"supplyDate": null,
"reference": null,
"notes": null,
"currency": "OMR",
"exchangeRate": "1",
"pricesIncludeTax": false,
"subtotal": "105.000",
"taxTotal": "105.000",
"total": "105.000",
"amountDue": "105.000",
"totalBase": "105.000",
"originalDocumentId": null,
"salesOrderId": null,
"purchaseOrderId": null,
"branchId": "cmabc123def456",
"customFields": {
"delivery_slot": "Morning"
},
"lines": [
{
"lineNumber": 1,
"productId": "cmabc123def456",
"description": "Ceramic floor tile 60×60",
"quantity": "105.000",
"unitPrice": "105.000",
"discountPercent": "text",
"unitCode": "H87",
"accountId": "cmabc123def456",
"taxCodeId": "cmabc123def456",
"netAmount": "105.000",
"taxAmount": "105.000",
"totalAmount": "105.000"
}
],
"postedAt": "2026-11-30T08:16:00.000Z",
"voidedAt": null,
"createdAt": "2026-11-30T08:15:00.000Z",
"updatedAt": "2026-11-30T08:15:00.000Z"
}Answer fields
| Field | Type | Description |
|---|---|---|
| idrequired | string | An OmniBooks id. |
| numberrequired | string | Given at posting; null for drafts.may be null |
| kindrequired | enum | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued).one of INVOICE, CREDIT_NOTE, DEBIT_NOTE |
| statusrequired | enum | one of DRAFT, POSTED, VOID |
| contactIdrequired | string | An OmniBooks id. |
| contactNamerequired | string | |
| issueDaterequired | string | A calendar date, YYYY-MM-DD. |
| dueDaterequired | string | A calendar date, YYYY-MM-DD. |
| supplyDaterequired | string | A calendar date, YYYY-MM-DD.may be null |
| referencerequired | string | Your reference (the customer's PO number, the supplier's invoice number).may be null |
| notesrequired | string | Notes; on sales documents they are printed.may be null |
| currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| exchangeRaterequired | string | Base currency per unit of currency; left out = the rate on the date from Settings → Currencies. |
| pricesIncludeTaxrequired | boolean | Unit prices include tax. |
| subtotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| taxTotalrequired | string | A decimal amount as a string, e.g. "105.000". |
| totalrequired | string | A decimal amount as a string, e.g. "105.000". |
| amountDuerequired | string | A decimal amount as a string, e.g. "105.000". |
| totalBaserequired | string | The total in the company's base currency. |
| originalDocumentIdrequired | string | Credit and debit notes: the invoice or bill they adjust.may be null |
| salesOrderIdrequired | string | An OmniBooks id.may be null |
| purchaseOrderIdrequired | string | An OmniBooks id.may be null |
| branchIdrequired | string | An OmniBooks id. |
| customFieldsrequired | object (by key) | The company's custom fields, by key (GET /custom-fields lists them). Empty fields are left out. |
| linesrequired | array of object | The lines, in order. |
| lines[].lineNumberrequired | number | |
| lines[].productIdrequired | string | An OmniBooks id.may be null |
| lines[].descriptionrequired | string | What is sold or bought, as printed. |
| lines[].quantityrequired | string | A decimal quantity as a string. |
| lines[].unitPricerequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].discountPercentrequired | string | Line discount, percent. |
| lines[].unitCoderequired | string | UN/ECE unit code, e.g. H87 piece, KGM kilogram. |
| lines[].accountIdrequired | string | An OmniBooks id. |
| lines[].taxCodeIdrequired | string | An OmniBooks id.may be null |
| lines[].netAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].taxAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| lines[].totalAmountrequired | string | A decimal amount as a string, e.g. "105.000". |
| postedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| voidedAtrequired | string | An instant, ISO 8601 in UTC.may be null |
| createdAtrequired | string | An instant, ISO 8601 in UTC. |
| updatedAtrequired | string | An instant, ISO 8601 in UTC. |