API overview
The EalSuite API lets an integration create, update, list, and share the same records a user works with in EalSuite: sales and purchase documents, payments and other journals, file attachments, and lookup data such as contacts, items, taxes, and series.
Calls run as the user who owns the personal access token. That user needs permission for the action and access to the branch in SelectedBranchId. Product rules still apply (transaction lock, credit limit, deleted or disabled items, and similar).
Base URL: https://yoursite.ealsuite.com/?app=ealsuite_api/v1
Replace yoursite.ealsuite.com with your workspace host. Only version v1 is accepted. Any other version segment returns Unknown API version.
What you can call
| Area | Typical work |
|---|---|
| Sales | Invoices, sales orders, quotes, and share links |
| Purchases | Purchase bills, purchase orders, and debit notes |
| Transactions | Payments, transfers, expenses, deposits, and journals |
| Documents | Upload params, a signed upload URL, then confirm the file on a bill |
| Lookups | Customers, suppliers, items, users, series, taxes, currencies, projects, and other ids you send on a create or update |
Use a lookup first when a create call needs an id (customer_id, item_id, serial_code_id, and similar). Create returns a numeric id in result. Send that id as record_id to edit the same bill, or as payment id to pay it.
Quick start
- In EalSuite open Settings → View Profile → Personal access tokens and create a token. The full value is shown once.
- Send it as
Authorization: Bearer <token>. - Send
SelectedBranchIdon every call exceptGET /me. - Send
Content-Type: application/jsonwhen the request has a body.
Authorization: Bearer <personal_access_token>
SelectedBranchId: <numeric_branch_id>
Content-Type: application/json
A first read that does not need a branch header:
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/me
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/me' \
-H 'Authorization: Bearer <personal_access_token>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/me", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
},
});
const data = await response.json();
console.log(data);
Every success or error body uses the same envelope: success, message, and result. List calls also return page_info with a cursor. Details are in Authentication, Responses, and Pagination.
Conventions
- Dates on bills use the branch date format unless an endpoint says otherwise.
- All record ids are numbers. See Identifiers.
- List endpoints share
page_token,page_size(default 50, max 250),sort_by,sort_order,search_field,search_query, andfilters. - Write calls for bills, payments, and documents return an
X-Request-Idresponse header. Lookups and auth or routing errors do not. - A missing or expired token returns
Invalid or expired token. A role that cannot run the action returnsPermission Denied. The same message is returned when self-data is on and the record is outside the caller's own records (linked data, when enabled, also allows records tied to the caller's contacts). Endpoint sections list extra messages for that call.
Use the left menu to open a resource. The right panel lists HTTP paths and the first JSON example from that section.
Contents
Basics
Sales
Purchases
Transactions
Documents
Lookups
- Serial codes
- Cheques
- Items
- Contacts
- Users
- Config
- Form details
- Custom field options
- Additional expense categories
- Chart of accounts
- Projects
- Service requests
- Cost centers
- Terms
- Payment terms
- Tax options
- Currencies
Authentication
Every request uses a personal access token for the calling user. Most calls also send the branch the call should run in.
Create a token in EalSuite: Settings → View Profile → Personal access tokens. The full token is shown once at creation. Expiration presets are 7, 30, 60, 90, or 365 days. Changing the user's password revokes every personal access token for that user.
v1 tokens use the user's full role permissions. Scoped tokens are not available in this version.
Headers
Authorization: Bearer <personal_access_token>
SelectedBranchId: <numeric_branch_id>
Content-Type: application/json
SelectedBranchId is required on every request except GET /me. The branch applies to that request only; it does not change the user's saved current branch. The user must be allowed to access that branch.
GET /me does not use SelectedBranchId. It runs in the user's saved current branch. A missing or invalid saved current branch returns Branch not found.
A revoked or expired token returns Invalid or expired token. A missing or unknown SelectedBranchId (on routes that require it) returns Branch not found. A user who cannot access the branch returns User is not authorized to access this branch.
Responses
Success:
{
"success": true,
"message": "Operation successful",
"result": {}
}
Error:
{
"success": false,
"message": "Error description",
"result": ""
}
result holds the payload on success. On error it is an empty string. The message describes what failed.
Errors
| Condition | Message |
|---|---|
| Token missing, revoked, or expired | Invalid or expired token |
SelectedBranchId missing or unknown (not GET /me) | Branch not found |
Saved current branch missing or invalid (GET /me) | Branch not found |
| User cannot access the branch | User is not authorized to access this branch |
| Body is not JSON | Invalid JSON body |
| JSON body is not an object | JSON body must be an object |
Version is not v1 | Unknown API version |
| Path does not match a resource | Unknown API resource or method |
| HTTP method is not allowed for the path | Method not allowed. Allowed: … |
| Role does not allow the action, or self-data excludes the record | Permission Denied |
| Unexpected failure | Unable to process requested operations at the moment. |
Unknown path and disallowed HTTP method are rejected before token and branch checks.
Endpoint sections list additional messages for that call. Bill and payment calls can also fail for product rules such as transaction lock, credit limit, or an amount that exceeds the balance due. Those responses use the same error envelope and a specific message.
Request IDs
These calls return an X-Request-Id response header on both success and failure:
POST /invoicePOST /invoice/share-linkPOST /credit-notePOST /sales-orderPOST /sales-order/share-linkPOST /sales-order/statusPOST /quotePOST /quote/share-linkPOST /quote/statusPOST /purchase-billPOST /purchase-bill/share-linkPOST /debit-notePOST /paymentPOST /transferPOST /expensePOST /depositPOST /journalPOST /document/upload-urlPOST /document
Lookups (GET), authentication failures, and routing errors do not return X-Request-Id.
Pagination
List endpoints for invoices, purchase bills, purchase orders, sales orders, quotes, credit notes, debit notes, payments, deposits, expenses, journals, transfers, and custom field options use the same cursor pagination.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page_token | string | No | — | Opaque cursor from page_info.next_page_token |
page_size | integer | No | 50 | Records per page. Maximum 250 |
sort_by | string | No | Resource default | One of the sort fields listed on that endpoint |
sort_order | string | No | desc | asc or desc |
search_field | string | No | — | Field for a contains search. Must be one of that list's sort or filter fields |
search_query | string | No | — | Search text |
filters[field] | object | No | — | Filter with operator and an optional value |
Each list endpoint names its default sort_by, allowed sort fields, and allowed filter fields. Results follow that module's access, including a role limited to the user's own records or to linked records.
page_token
Send page_info.next_page_token unchanged to read the next page. Keep the same sort_by, sort_order, search_field, search_query, page_size, and filters on that request.
"page_info": {
"next_page_token": "...",
"has_next_page": true,
"has_prev_page": false,
"page_size": 50
}
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_token=<next_page_token>
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_token=<next_page_token>' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_token=<next_page_token>", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
A changed query returns Query context changed. Restart from page 1. A bad token returns page_token signature invalid (tampered).
page_size
Default is 50. A value below 1 is treated as 50. A value above 250 returns page_size exceeds maximum (250).
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_size=25
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_size=25' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_size=25", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
sort_by
One of that list's sort fields. Any other field returns sort_by field not allowed.
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&sort_by=purchasebill_date
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&sort_by=purchasebill_date' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&sort_by=purchasebill_date", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
sort_order
asc or desc. Any other value is treated as desc.
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&sort_order=asc
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&sort_order=asc' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&sort_order=asc", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
search_field and search_query
Set both. The match is a contains search. search_field must be one of that list's sort or filter fields. Any other field returns search_field is not allowed.
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&search_field=purchasebill_code&search_query=PB-
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&search_field=purchasebill_code&search_query=PB-' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&search_field=purchasebill_code&search_query=PB-", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
filters
Each filter is filters[field][operator] and filters[field][value]. Several fields are combined. The same parameter may instead be one JSON object. A string that is not valid JSON is ignored.
Every filter needs operator. Omit value for Is Empty and Is Not Empty.
| Type | Fields | Operators |
|---|---|---|
| text | *_status, *_code | Contains, Does Not Contains, Is, Is Not, Starts With, Ends With, Is Empty, Is Not Empty |
| date | *_date | Is, Is Before, Is After, Is on or before, Is on or after, Is within, Is Empty, Is Not Empty |
| number | *_userid, *_sale_agent, *_created_by, *_project_id | =, !=, >, <, >=, <=, Is Empty, Is Not Empty |
| decimal | *_total | =, !=, >, <, >=, <=, Is Empty, Is Not Empty |
Date values are YYYY-MM-DD. Is within takes value[from] and value[to], or a from,to string.
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&filters[purchasebill_status][operator]=Is&filters[purchasebill_status][value]=Unpaid&filters[purchasebill_total][operator]=>=&filters[purchasebill_total][value]=1000
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&filters[purchasebill_status][operator]=Is&filters[purchasebill_status][value]=Unpaid&filters[purchasebill_total][operator]=>=&filters[purchasebill_total][value]=1000' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&filters[purchasebill_status][operator]=Is&filters[purchasebill_status][value]=Unpaid&filters[purchasebill_total][operator]=>=&filters[purchasebill_total][value]=1000", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Errors
Filter field '…' is not allowedFilter for field '…' must include an 'operator'Invalid operator '…' for field '…' (type: …)
Money fields on list records are formatted strings, for example "$1,250.00".
Identifiers
All ids in this API are numbers.
| Record | Id you send | Id you receive |
|---|---|---|
| Invoice, sales order, quote, purchase bill, purchase order | On edit and on a share link, record_id. On a status change, sales_order_id or quote_id | Create returns the numeric bill id in result |
| Payment | Bill id in id | Numeric payment journal id in result |
| Transfer | On edit, transaction_id | result.id, with result.code |
| Contact, bank account, cheque, serial code, user, category | Numeric id from the matching lookup | Numeric id |
| Item | Numeric id from item search | Numeric id |
| Document | file_id on confirm. record_id is the bill id | file_id from upload URL, id after confirm |
| Bill line | item_id is the item id | — |
Use the create result as record_id when editing that bill or creating a share link, and as id when paying it.