API reference · version 1
Settings
Reference data to fill documents: branches, accounts, tax codes, bank accounts, custom fields.
- GET
/branchesList branches - GET
/accountsList ledger accounts - GET
/tax-codesList tax codes - GET
/bank-accountsList bank and cash accounts - GET
/custom-fieldsList custom fields
List branches
GET/api/v1/branches
The company's branches the member may use. Send branchId on documents to choose one (default: the head office).
Example
curl "https://your-workspace.omnibooks.online/api/v1/branches" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"data": [
{
"id": "cmabc123def456",
"code": "C-0042",
"name": "Gulf Star Trading LLC",
"isHeadOffice": false,
"isActive": true
}
]
}Answer fields
| Field | Type | Description |
|---|---|---|
| datarequired | array of object | |
| data[].idrequired | string | An OmniBooks id. |
| data[].coderequired | string | Left out = the next free number. |
| data[].namerequired | string | Display name. |
| data[].isHeadOfficerequired | boolean | |
| data[].isActiverequired | boolean |
List ledger accounts
GET/api/v1/accounts
The chart of accounts. Lines without an item need a postable account (isPostable); control accounts (receivables, payables, inventory) can't be used on lines directly.
Query parameters
| Field | Type | Description |
|---|---|---|
| type | string | ASSET, LIABILITY, EQUITY, REVENUE or EXPENSE.at most 40 characters |
| postable | enum | one of true, false |
Example
curl "https://your-workspace.omnibooks.online/api/v1/accounts" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"data": [
{
"id": "cmabc123def456",
"code": "C-0042",
"name": "Gulf Star Trading LLC",
"type": "text",
"currency": "OMR",
"isPostable": true,
"isControl": false,
"isActive": true
}
]
}Answer fields
| Field | Type | Description |
|---|---|---|
| datarequired | array of object | |
| data[].idrequired | string | An OmniBooks id. |
| data[].coderequired | string | Left out = the next free number. |
| data[].namerequired | string | Display name. |
| data[].typerequired | string | GOODS or SERVICE. |
| data[].currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| data[].isPostablerequired | boolean | |
| data[].isControlrequired | boolean | |
| data[].isActiverequired | boolean |
List tax codes
GET/api/v1/tax-codes
Tax codes for document lines (taxCodeId). A code is used only between its effective dates.
Example
curl "https://your-workspace.omnibooks.online/api/v1/tax-codes" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"data": [
{
"id": "cmabc123def456",
"code": "C-0042",
"name": "Gulf Star Trading LLC",
"rate": "5",
"type": "text",
"isActive": true,
"effectiveFrom": null,
"effectiveTo": null
}
]
}Answer fields
| Field | Type | Description |
|---|---|---|
| datarequired | array of object | |
| data[].idrequired | string | An OmniBooks id. |
| data[].coderequired | string | Left out = the next free number. |
| data[].namerequired | string | Display name. |
| data[].raterequired | string | Percent, e.g. "5". |
| data[].typerequired | string | GOODS or SERVICE. |
| data[].isActiverequired | boolean | |
| data[].effectiveFromrequired | string | A calendar date, YYYY-MM-DD.may be null |
| data[].effectiveTorequired | string | A calendar date, YYYY-MM-DD.may be null |
List bank and cash accounts
GET/api/v1/bank-accounts
Bank and cash accounts. Record payments with the accountId as bankAccountId.
Example
curl "https://your-workspace.omnibooks.online/api/v1/bank-accounts" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"data": [
{
"id": "cmabc123def456",
"name": "Gulf Star Trading LLC",
"kind": "INVOICE",
"currency": "OMR",
"accountId": "cmabc123def456",
"branchId": "cmabc123def456",
"isActive": true
}
]
}Answer fields
| Field | Type | Description |
|---|---|---|
| datarequired | array of object | |
| data[].idrequired | string | An OmniBooks id. |
| data[].namerequired | string | Display name. |
| data[].kindrequired | string | INVOICE, CREDIT_NOTE or DEBIT_NOTE (a debit note adds to an invoice already issued). |
| data[].currencyrequired | string | ISO 4217 code; left out = the contact's currency, else the company's base currency. |
| data[].accountIdrequired | string | The ledger account: send it as bankAccountId when recording a payment. |
| data[].branchIdrequired | string | An OmniBooks id. |
| data[].isActiverequired | boolean |
List custom fields
GET/api/v1/custom-fields
The company's active custom fields. Records carry their values in customFields by key; send the same object on create and update (only the keys you send change; an empty value clears one).
Query parameters
| Field | Type | Description |
|---|---|---|
| entity | enum | one of CONTACT, PRODUCT, SALES_DOCUMENT, PURCHASE_DOCUMENT, SALES_ORDER, PURCHASE_ORDER, CRM_LEAD, CRM_DEAL, EMPLOYEE |
Example
curl "https://your-workspace.omnibooks.online/api/v1/custom-fields" \
-H "Authorization: Bearer $OMNIBOOKS_KEY"{
"data": [
{
"entity": "text",
"key": "delivery_slot",
"label": "Delivery slot",
"type": "text",
"options": [
"text"
],
"decimals": 1,
"required": false,
"lockWhenPosted": false
}
]
}Answer fields
| Field | Type | Description |
|---|---|---|
| datarequired | array of object | |
| data[].entityrequired | string | CONTACT, PRODUCT, SALES_DOCUMENT, PURCHASE_DOCUMENT, SALES_ORDER, PURCHASE_ORDER, CRM_LEAD, CRM_DEAL or EMPLOYEE. |
| data[].keyrequired | string | |
| data[].labelrequired | string | |
| data[].typerequired | string | TEXT, LONG_TEXT, NUMBER, DECIMAL, DATE, CHECKBOX, SELECT, MULTI_SELECT, URL, EMAIL or PHONE. |
| data[].optionsrequired | array of string | may be null |
| data[].decimalsrequired | number | may be null |
| data[].requiredrequired | boolean | |
| data[].lockWhenPostedrequired | boolean |