Orders
This guide covers the complete order lifecycle: creating orders with buyer and item references, updating order state and properties, and querying with rich filters including JSONB property searches.All endpoints require header-based auth:
X-Business-ID and X-API-Key.Authentication
Include these headers in every request:X-Business-ID: Your business identifierX-API-Key: Your API key
Overview: Orders, Buyers, and Items
Orders in Polinate connect buyers with items:- Create Items with variants (SKU, price, dimensions, etc.)
- Create Buyers representing your customers/partners
- Create Orders that reference the buyer and specific item variants
- A reference to the buyer (
partnershipId,membershipId) - Order-level metadata (delivery address, dates, totals, custom properties)
- Order items that reference specific item variants with quantity and pricing
List Orders
Endpoint:GET /api/v1/orders
Supports pagination, time-window filters, state filters, and property-based queries:
Pagination:
page(number, default 1)limit(number, max 100, default 20)
createdSince(ISO datetime): orders withcreatedAt > createdSinceupdatedSince(ISO datetime): orders withupdatedAt > updatedSincemodifiedSince(ISO datetime): orders where (createdAt > tsORupdatedAt > ts)- Mutual exclusivity:
modifiedSincecannot be combined withcreatedSinceorupdatedSince. You may combinecreatedSinceandupdatedSincetogether.
- Mutual exclusivity:
phase(enum): High-level order statestatus(enum): Physical fulfillment/movement state
propertyPath(string): Dot-notation path to a property (e.g.,sage200Evo.salesOrderNo)propertyValue(string): Filter orders where the property equals this valuepropertyExists(boolean): Filter by property existence (true) or absence (false)- Mutual exclusivity:
propertyValueandpropertyExistscannot be used together - Both require
propertyPathto be specified
- Mutual exclusivity:
Understanding Phase vs Status
Orders have two complementary state dimensions: Phase represents the high-level lifecycle of an order:DRAFT: Order is being preparedPENDING: Order is awaiting acceptance/confirmationACTIVE: Order is confirmed and in progressARCHIVED: Order is complete and archivedREJECTED: Order was declinedCANCELLED: Order was cancelledDELETED: Order was soft-deleted
UNASSIGNED: Not yet assigned for processingACCEPTED: Accepted and ready for fulfillmentPREPARING: Being prepared for shipmentSHIPPED: In transit to destinationDELIVERED: Successfully deliveredCANCELLED: Fulfillment cancelledRETURNED: Returned by recipient
Phase and status work together. For example, an order can have
phase: CANCELLED but status: SHIPPED if it was cancelled after already being dispatched.Example Queries
Best practices:
- Use
modifiedSincefor catch-up syncs: it returns all orders created or updated after the given timestamp - Use
propertyExists=falseto find orders that need processing (e.g., not yet synced to your ERP) - Combine state filters with property filters for powerful queries
Response Structure
Each order includes buyer context and full item details:partnershipId: Links to the buyer (see Buyers API)orderItems[].itemListEntry.itemVariantId: The specific variant orderedorderItems[].itemListEntry.itemVariant.itemId: The parent itemproperties: Flexible JSONB field for custom data (see Properties section below)
Get Individual Order
Endpoint:GET /api/v1/orders/{id}
Fetch a single order by ID with all buyer and item context:
Update an Order
Endpoint:PATCH /api/v1/orders/{id}
Update order state, metadata, and properties. The API supports partial updates with automatic property merging.
Ingest an Order (Idempotent)
Endpoint:POST /api/v1/orders
Use an Idempotency-Key header so retries don’t create duplicates. The expected key is:
Working with Properties
Theproperties field is a flexible JSONB column that lets you store custom data with orders. This is perfect for:
- External system references (ERP order numbers, tracking IDs)
- Integration metadata (sync status, timestamps)
- Custom business logic data
Deep Merge Behavior
When you update properties via PATCH, the API performs a deep merge (upsert behavior):- Top-level keys are merged independently
- Nested objects within the same key are merged
- New keys are added without affecting existing keys
- Null values are stored as-is (use
nullto explicitly set a property to null)
Property Merge Examples
Initial order properties:sage200Evo object is merged (not replaced):
Querying by Properties
Use property filters to find orders based on custom data: Find orders synced to Sage 200:Common Integration Pattern
A typical ERP/external system integration workflow:-
Fetch unsynced orders:
- Process in your system (create sales order, get order number)
-
Update order with external reference:
-
Later, add more external data (merges automatically):
Pagination & Rate Limits
- Pagination is standard
page+limit(max 100). Default: page 1, limit 20. - Rate limits return HTTP 429 with a
Retry-Afterheader (seconds). Back off and retry after that interval.
Errors
- 400: Validation errors (e.g., invalid timestamps, mutually-exclusive filters, missing propertyPath)
- 401: Missing or invalid authentication headers
- 404: Order not found or doesn’t belong to your business
- 429: Too many requests — honor
Retry-After - 500: Unexpected server error
Best Practices
- Incremental syncs: Use
modifiedSinceto fetch only changed orders - Property filters: Use
propertyExists=falseto find orders needing processing - Idempotency: Always use idempotency keys for POST operations
- Property structure: Namespace your properties by system (e.g.,
sage200Evo,unleashed,myErp) - Timestamps: Store sync timestamps in properties for debugging and monitoring
- Error handling: Orders you don’t own return 404 (not 403) to prevent information leakage

