Orders
Endpoints under /api2/order for paginated listings, detailed lookup by ID or increment_id, and administrative operations: cancel, hold and unhold. This page is the entry point of the orders family — from here, browse to Invoices, Shipments, Credit memos and Order history.
Overview
The /api2/order family consolidates the order lifecycle on the Yep Platform — from initial lookup to final refund. This page covers the Orders root resource; the remaining resources have their own pages.
limit is missing or invalid.total, last_page, has_next with include_pagination=1.Family rules
Conventions shared by every order endpoint. Base URL in examples: /api2. Protected endpoints require Authorization: Bearer {{token}} and Content-Type: application/json on POST verbs.
- Listings accept filters either via query string or JSON body. When the same field exists in both places, the query-string value wins.
- Default pagination:
page=1,limit=20. Maximum:200. Aliasespage_size,per_pageandpageSizeare also accepted. - Dates must use
YYYY-MM-DDorYYYY-MM-DD HH:MM:SS. Invalid dates return400. - Sorting: use
sortanddirection(ascordesc). Accepted fields vary per resource. - On operational endpoints that accept
items, every item must useorder_item_idorskuand a positiveqty. - Errors follow the
{"error": "message"}shape.
HTTP statuses
| Status | Usage |
|---|---|
200 | Lookup or update completed. |
201 | Invoice, shipment, track, history or credit memo created. |
400 | Invalid parameter, invalid JSON or operation ambiguity. |
401 | Missing or invalid token. |
404 | Order, invoice, shipment or credit memo not found. |
409 | Save conflict, duplicate or deadlock handled by the module helper. |
503 | Resource temporarily unavailable due to lock wait or DB contention. |
500 | Unexpected error handled by the module helper. |
List orders with filters and deterministic pagination.
1.20, max 200.1, returns total, last_page and has_next.pending,processing.created_at_from, created_at_to, from, to.updated_at_from, updated_at_to.entity_id, created_at, updated_at, increment_id, grand_total.Example — query string
GET /api2/order?page=1&limit=50&status=pending,processing&include_pagination=1&sort=created_at&direction=desc
Authorization: Bearer {{token}}
Example — JSON body
{
"page": 1,
"limit": 50,
"include_pagination": 1,
"status": ["pending", "processing"],
"customer_email": "customer@example.com",
"created_from": "2026-01-01",
"created_to": "2026-12-31",
"sort": "created_at",
"direction": "desc"
}
Sample response
{
"success": true,
"page": 1,
"limit": 50,
"total": 137,
"last_page": 3,
"has_next": true,
"orders": [
{
"order_id": 123,
"increment_id": "100000123",
"status": "processing",
"state": "processing",
"grand_total": 459.90,
"customer_id": 34,
"customer_email": "customer@example.com",
"omnichat_sales_person_id": "seller-123",
"omnichat_sales_person_name": "Salesperson name",
"created_at": "2026-04-22 14:33:10",
"updated_at": "2026-04-23 09:11:02"
}
]
}
omnichat_sales_person_id and omnichat_sales_person_name. For orders without an Omnichat link, both fields return null.Get a single order by id or increment_id. The response uses the singular order key.
GET /api2/order?id=123
Authorization: Bearer {{token}}
GET /api2/order?increment_id=100000123
Authorization: Bearer {{token}}
/api2/orders exists and accepts the same parameters.Cancels the order following Yep's native rules. When canCancel() returns false, the API responds with 400.
POST /api2/order/cancel
Authorization: Bearer {{token}}
Content-Type: application/json
{
"order_increment_id": "100000123",
"comment": "Canceled by integration."
}
order_id instead of order_increment_id.Puts the order on hold when canHold() allows.
POST /api2/order/hold
Authorization: Bearer {{token}}
Content-Type: application/json
{
"order_id": 123,
"comment": "Order under review."
}
Removes the hold when canUnhold() allows.
POST /api2/order/unhold
Authorization: Bearer {{token}}
Content-Type: application/json
{
"order_id": 123,
"comment": "Review completed."
}
Supported usage patterns
Tested and certified combinations for the Orders resource.
GET /api2/order?status=pending,processing&include_pagination=1GET /api2/order?increment_id=100000123GET /api2/order?id=123GET /api2/order?updated_from=2026-04-01&sort=updated_at&direction=ascPOST /api2/order/cancelPOST /api2/order/holdPOST /api2/order/unholdIntegration recommendations
Consolidated best practices for ERP, OMS, CRM and marketplace integrations syncing orders with the Yep Platform.
Recommended
- Identify orders preferentially by
order_increment_id— it is stable and human-readable. - Use
include_pagination=1in sync routines to safely terminate loops viahas_next. - Combine
updated_from/updated_tofor incremental (delta) syncs. - Use
store_idin multi-store environments for deterministic results.
Avoid
- Mixing
order_idandorder_increment_idin the same payload — pick a single identifier per request. - Forcing cancel/hold/unhold without checking the current state — Yep returns
400when the transition is not allowed. - Relying on implicit ordering between pages — always pass
sortanddirection.
Incremental sync tip
For OMS/ERP integrations, combine updated_from + limit=100 + include_pagination=1 + sort=updated_at&direction=asc. You get a deterministic delta, a reliable stop condition and predictable ordering to resume from a checkpoint.
Common errors
| Status | Sample body | When it happens |
|---|---|---|
400 | {"error": "Invalid date format"} | Dates outside YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. |
400 | {"error": "Order cannot be canceled"} | canCancel(), canHold() or canUnhold() returned false for the current order state. |
401 | {"error": "Unauthorized"} | Missing Authorization or expired token. |
404 | {"error": "Order not found"} | Unknown order_id or increment_id. |
503 | {"error": "Resource temporarily unavailable"} | Lock wait or transient contention — retry with backoff. |