IMS Documentation
IMS API 1.1.0.0 • Business API v1

Requests & Responses

Common conventions used for ordinary Business API v1 resources. Delta resources use the separate synchronization envelopes and cursor rules in their guides.

Route pattern

GET /api/v1/companies/{companyId}/resource

companyId must be in the range 1–32767 and assigned to the API client.

Date format

Date parameters use ISO format yyyy-MM-dd, for example 2026-09-30. In date mode for transaction/history resources, both fromDate and toDate are required and toDate cannot be earlier than fromDate.

Transaction timestamp filters

Supply either both fromDate and toDate (inclusive company business dates) or both fromTimestamp and toTimestamp (company-local timestamps without a UTC offset or Z). Do not mix the pairs. The timestamp start is inclusive and the end exclusive; the start must precede the end. Timestamp filtering is based on recorded event time, not subsequent edits. For incremental transaction extraction use bounded overlapping/reconciled windows, stable line identities and idempotent replacement; do not assume the timestamp is a last-modified cursor.

ResourceTimestamp field
/salessaleTimestamp
/purchasesstockEffectiveAt (finalized purchase/return, when known)
/inventory/movementsstockEffectiveAt (purchase finalization time where available; recorded transaction time for non-purchase movements)

Example for a full local calendar day:

GET /api/v1/companies/1/sales?fromTimestamp=2026-10-01T00:00:00&toTimestamp=2026-10-02T00:00:00

Do not add Z or a UTC offset to these local transaction timestamps. The ordinary Delta endpoints instead use offset-aware since/through timestamps normalized to UTC. Do not reuse one kind of cursor for the other.

Pagination

Ordinary page-number endpoints accept page and pageSize. Defaults are page=1 and pageSize=200. page must be at least 1 and pageSize must be 1–1000.

FieldMeaning
pageCurrent 1-based page number.
pageSizeRequested rows per page.
countRows returned in this page.
totalCountTotal rows matching the request.
totalPagesTotal page count for the current page size.
dataResponse rows.

Null and decimal values

Nullable response fields may be JSON null. Some nonnullable fields return an empty string, 0 or false when no value is available; use the nullability and meaning specified for that response field in the endpoint reference. Financial, quantity and price fields are JSON numbers and may include the decimal precision appropriate to their business values.

Filtering

Filters are supplied as query-string parameters. Omitted optional filters do not restrict the result. Multiple supplied filters are combined to narrow the result.

Large extracts

For date-based resources, use bounded date ranges. Page through results sequentially. Customers supports full-catalog pagination without date filters; individual pages are consistent, but separate requests do not share an export-wide snapshot. Do not request the same large page repeatedly. Respect the client rate limits returned by the service.

Response envelopes

Ordinary successful resource envelopes include companyId, companyCode, companyName, count and data. Stores is unpaged and does not add the paging totals. Other resources add the paging fields above. Required-date resources echo fromDate/toDate; sales, purchases and movements additionally echo fromTimestamp/toTimestamp, with the unused pair null. Delta envelopes are described separately below; relationship responses also include promotionId or couponEventId.

Illustrative empty items response (fictional company; not a live API result):

{
  "companyId": 1,
  "companyCode": "EXAMPLE",
  "companyName": "Example Company",
  "page": 1,
  "pageSize": 200,
  "count": 0,
  "totalCount": 0,
  "totalPages": 0,
  "data": []
}

totalPages is zero for no matching rows; otherwise it is the ceiling of totalCount / pageSize. Changes between page requests can affect the reported totals or which rows are included. Ordinary page-number pagination does not provide a cross-request snapshot token; sequential paging does not guarantee a repeatable export. Ordinary Items/Inventory Delta, Customer Delta and Partner Stock Delta use keyset continuation cursors.

Date selection

Transfers, adjustments, depreciations, markdowns, promotions and footfall require both dates. Sales, purchases and movements accept either both dates or both timestamps. Transaction date bounds are inclusive. Markdowns and promotions select intervals overlapping the requested range inclusively, including records that began earlier. Coupon expiryFrom and expiryTo are individually optional; when both are supplied the end must not precede the start. No maximum date span is imposed by the shared date validator.

Types and filtering

JSON property names use camelCase. Dates are returned as date strings, times as time strings and timestamps as date-time strings. Do not assume ordinary transaction timestamps are UTC. Delta windows use offset timestamps normalized to UTC; transaction timestamp filters use local date-time values without offsets. Nullability is listed for every field in the endpoint reference.

String equality filters are trimmed exact matches. Supplier search is a case-insensitive search of the English or Arabic name; the characters % and _ are treated as search wildcards. Supplied boolean filters include false; omission leaves the result unrestricted. nonZeroOnly=true includes positive and negative stock, while false or omission does not filter balances. hasSpecialPrice=true includes non-null special prices, including zero; false selects null.

Accepted filter values

Movement and promotion type text is trimmed and case-normalized. Promotion and coupon-event path IDs must be positive. Their relation endpoints return empty pages when no related rows match; an empty page does not establish whether the parent exists.

Result ordering

Stable order keys: stores storeId; items itemId; customers id; inventory storeId,itemId; suppliers supplierId; purchases purchaseDate,purchaseCenterId,transactionType,purchaseNo,lineNo; sales saleDate,saleTimestamp,storeId,transactionType,invoiceNo,lineNo; transfers transferDate,transferTime,fromStoreId,transferNo,lineNo; adjustments adjustmentDate,adjustmentTimestamp,storeId,adjustmentNo,lineNo; depreciation depreciationDate,depreciationTimestamp,storeId,depreciationNo,lineNo; movements movementDate,movementTime,storeId,documentCenterId,documentNo,lineNo,movementType; markdowns startDate,markdownId,itemId; promotions startDate,promotionId; coupon events expiryDate descending,couponEventId descending. Relations sort by storeId, clientCategoryId or amountThreshold as applicable; promotion items sort by itemId,rewardItemId nulls last,specialPrice nulls last.

Delta envelopes and hourly traffic

Items and Inventory Delta, Customer Delta and Partner Stock Delta use keyset cursors and have two response shapes: full-sync-required and incremental. They do not use page numbers or totalCount. The reference shows both shapes with every field. Footfall uses the ordinary dated paged envelope and orders countDate, storeId, countHour. Each row is one store/date/hour aggregate, not a customer.

Maintenance and retries

Affected company resources can temporarily return HTTP 503. Honor Retry-After; retry the same page or cursor and do not mark incomplete exports as complete.