Skip to main content

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​

AreaTypical work
SalesInvoices, sales orders, quotes, and share links
PurchasesPurchase bills, purchase orders, and debit notes
TransactionsPayments, transfers, expenses, deposits, and journals
DocumentsUpload params, a signed upload URL, then confirm the file on a bill
LookupsCustomers, 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​

  1. In EalSuite open Settings → View Profile → Personal access tokens and create a token. The full value is shown once.
  2. Send it as Authorization: Bearer <token>.
  3. Send SelectedBranchId on every call except GET /me.
  4. Send Content-Type: application/json when 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 -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/me' \
-H 'Authorization: Bearer <personal_access_token>'

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, and filters.
  • Write calls for bills, payments, and documents return an X-Request-Id response 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 returns Permission 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


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​

ConditionMessage
Token missing, revoked, or expiredInvalid 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 branchUser is not authorized to access this branch
Body is not JSONInvalid JSON body
JSON body is not an objectJSON body must be an object
Version is not v1Unknown API version
Path does not match a resourceUnknown API resource or method
HTTP method is not allowed for the pathMethod not allowed. Allowed: …
Role does not allow the action, or self-data excludes the recordPermission Denied
Unexpected failureUnable 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 /invoice
  • POST /invoice/share-link
  • POST /credit-note
  • POST /sales-order
  • POST /sales-order/share-link
  • POST /sales-order/status
  • POST /quote
  • POST /quote/share-link
  • POST /quote/status
  • POST /purchase-bill
  • POST /purchase-bill/share-link
  • POST /debit-note
  • POST /payment
  • POST /transfer
  • POST /expense
  • POST /deposit
  • POST /journal
  • POST /document/upload-url
  • POST /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.

ParameterTypeRequiredDefaultDescription
page_tokenstringNo—Opaque cursor from page_info.next_page_token
page_sizeintegerNo50Records per page. Maximum 250
sort_bystringNoResource defaultOne of the sort fields listed on that endpoint
sort_orderstringNodescasc or desc
search_fieldstringNo—Field for a contains search. Must be one of that list's sort or filter fields
search_querystringNo—Search text
filters[field]objectNo—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 -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>'

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 -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>'

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 -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>'

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 -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>'

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 -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>'

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.

TypeFieldsOperators
text*_status, *_codeContains, Does Not Contains, Is, Is Not, Starts With, Ends With, Is Empty, Is Not Empty
date*_dateIs, 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 -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>'

Errors

  • Filter field '…' is not allowed
  • Filter 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.

RecordId you sendId you receive
Invoice, sales order, quote, purchase bill, purchase orderOn edit and on a share link, record_id. On a status change, sales_order_id or quote_idCreate returns the numeric bill id in result
PaymentBill id in idNumeric payment journal id in result
TransferOn edit, transaction_idresult.id, with result.code
Contact, bank account, cheque, serial code, user, categoryNumeric id from the matching lookupNumeric id
ItemNumeric id from item searchNumeric id
Documentfile_id on confirm. record_id is the bill idfile_id from upload URL, id after confirm
Bill lineitem_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.