Data Semantics
Dates, signed quantities, amounts, cost and transaction meaning in Business API v1.
These calculations require the company API contract for the documented release. Sales responses include customer and loyalty IDs without customer name, phone or email; coupon responses omit raw coupon codes. The Partner Data guide defines its own cost-free price and availability contract.
Customer identity and enrichment
The Customers catalog uses loyalty customer identifiers. Its id is distinct from the ERP customer ID, so do not join it to sales customerId as if they were the same namespace.
phone is the full recorded contact number. customerCategory and discountPercent can be null when an unambiguous eligible customer association is unavailable. An actual discountPercent of 0 is different from missing information; never replace null with zero.
Use the full catalog for initial synchronization or periodic reconciliation. The separate Customer Delta endpoint supplies subsequent changes using a captured baseline and revision. The catalog route itself has no date filters or push delivery. A multi-page export is not one fixed snapshot; changes between requests can affect the pages. Reconcile only after the full download succeeds.
Financial-data permissions can set cost, acquisition and rent fields to null even where underlying business values exist. External transfer, adjustment and depreciation document totals are always null. Never replace a masked null with zero; use the per-resource field masking lists.
Item names and brands
The ordinary item contract returns the recorded brandName, using supplierName when the brand name is null or empty. This does not change brandId; do not infer a new brand identity from the fallback. The same fields are returned by Items Delta.
Sales and returns
saleDate is the business date, while saleTimestamp is the recorded transaction timestamp in company-local time. Backdated invoices can have different calendar dates in these fields. Use the appropriate filter pair; neither field is a general last-modified timestamp.
- Sales transaction types are 51/52; return transaction types are 53/54.
quantityis the transaction-line quantity.netQuantityis zero for non-merchandise lines (itemType != 1); merchandise quantities are sign-reversed for return types 53/54. Validate the sign of source quantities rather than assuming they are always positive.grossSalesAmountuses quantity × price for merchandise and the reported line total otherwise.netSalesAmountis the reported line amount after its invoice-discount amount;cogsAmountuses quantity × item cost. These amounts are sign-reversed for types 53/54, so normal positive return values reduce sales totals.discountPercent,discountAmountandinvoiceDiscountAmountreport the actual line-level item discount percentage, item discount amount and invoice discount amount. Use the returned values instead of calculating a different allocation.isItemDiscountedandisInvoiceDiscountedidentify those two discount mechanisms;isDiscountedis true when either applies.salespersonId/salespersonNameare line-level sales-associate references.customerIdandloyaltyCustomerIdare separate identity namespaces. They may both be null, either may be present, or both may be present. The API does not expose customer phone/email/name as part of this sales linkage.
Purchases and landed cost
purchaseDate is the original document date. stockEffectiveAt is the recorded stock-affecting timestamp for a finalized purchase or return, when available. Non-finalized documents and finalized documents not yet assigned a timestamp return null. Newly finalized documents may not appear in timestamp-only extraction until scheduled processing completes. Use date-based reconciliation for missing timestamps or subsequent corrections.
- Transaction type 1 is Purchase; type 2 is Purchase Return. Signed cost/quantity fields reverse on returns.
lineForeignAmountis the transaction-line amount before signed return adjustment.foreignCostAmount,localCostAmountandlandedCostAmountare signed business values.- The signed line total supplies foreign cost; local cost multiplies it by
exchangeRateand landed cost bycostRate.landedExpenseAmount = landedCostAmount - localCostAmount. Type 2 reverses these signs. - Discount Earned is document-level.
documentDiscountEarnedis not allocated to purchase item rows and does not reduce line acquisition/landed cost. - Document-level totals repeat on each row of the same purchase. Do not sum those header fields across lines; deduplicate using the composite transaction-type, purchase-center and purchase-number identity.
Inventory and movements
movementDate and movementTime retain the original business date and recorded time. stockEffectiveAt uses the recorded stock-affecting timestamp for purchase and purchase-return movements, when available; other movement types use their recorded transaction timestamp. This field can be null and does not replace the original movement date. Movement timestamp filters use stockEffectiveAt. Ordinary Inventory Delta returns current item/store balances and valuations (including zero and negative quantities), not movement rows.
inventory is a current balance/valuation contract. Current valuation uses quantity × cost and quantity × sale price. For dated flow analysis use inventory/movements. Purchase movements cover eligible received purchases associated with a store; landed unit cost is calculated as line amount × cost rate ÷ quantity, with null for a zero denominator.
| movementType | Meaning | Typical sign |
|---|---|---|
PURCHASE | Received purchase stock. | Positive |
PURCHASE_RETURN | Stock returned to supplier. | Negative |
SALE | Merchandise sold. | Negative |
SALE_RETURN | Customer return into stock. | Positive |
TRANSFER_OUT | Stock leaves the source store. | Negative |
TRANSFER_IN | Stock arrives at destination store. | Positive |
STOCK_ADJUSTMENT | Signed inventory correction. | Positive or negative |
STOCK_DEPRECIATION | Write-off/depreciation movement. | Negative |
These are typical signs for normal positive quantities, not universal positivity constraints. Inventory corrections keep their reported adjustment sign; depreciation movements reduce stock. Validate quantities independently.
Document totals repeat on transfer, stock-adjustment and depreciation lines as well. Deduplicate by the document identity before aggregating header totals.
Transfers
A transfer exposes both sides: sourceMovementQty is −quantity and destinationMovementQty is +quantity. For a balanced transfer those movements cancel when aggregated across both stores.
Markdowns, promotions and coupons
markdownPercentis(1 - markdown price / original price) × 100, expressed in percentage points:25means 25%. It is null when the original price is missing or zero.getValuecarries the configured reward value. Interpret it with the promotion type and rule flags; it is not a universal percentage or monetary amount across all promotion types.- Promotion relationship endpoints expose the stores/items/client categories/tiers/cashback stores attached to the promotion.
- Discount-coupon endpoints expose event metadata and store eligibility. Raw coupon codes/prefixes are intentionally not exposed.