Fenicia models an order's lifecycle with two related state tables, not one: the 23-state catalog that decides which actions (accept, reject, cancel, prepare, fulfill, returns) appear in _links (HATEOAS), and a smaller transition table — 17 states, the canonical OrderStatus type — that's the one that actually validates POST /transition, POST /orders/bulk/transition, and GET /valid-transitions. This article documents both and all the endpoints that operate them.
Which endpoint should I use?
Use accept, reject, and cancel for the merchant's common actions — they're optimized for their use case and validate specific business rules (for example, the cancellation reason catalog). Use the generic transition endpoint when you need to move the order to any valid state in the machine that doesn't have a dedicated action.
This table governs _links, NOT /transition validation
This 23-state table (it includes the new/pending aliases and additional states such as preparing, shipped, completed, ready_for_pickup, out_for_delivery, and problematic, which are not possible values of the persisted orderStatus field today) is the one that decides which named actions appear in _links when you retrieve an order — see "Available actions (HATEOAS)" below. It is not the table that validates POST /orders/{orderId}/transition, POST /orders/bulk/transition, or GET /orders/{orderId}/valid-transitions. Those three endpoints validate against a different, smaller table (17 states) — see "The table that actually validates a transition" below.
Each row indicates, per this table, the states an order could move to from the current state for the purposes of which action to show in _links.
POST /orders/{orderId}/transition, POST /orders/bulk/transition, and GET /orders/{orderId}/valid-transitionsdon't use the 23-state table above. They validate against @fenicia/core's state machine, which only knows the 17 values of the canonical OrderStatus type (no new/pending aliases as separate states, and no preparing, shipped, completed, ready_for_pickup, out_for_delivery, or problematic) and which changes based on the flowProfile you send (basic, intermediate — default — or wms-full).
Current state
basic
intermediate (default)
wms-full
draft
new, cancelled
new, cancelled
new, cancelled
new
accepted, rejected, cancelled
accepted, rejected, cancelled
accepted, rejected, cancelled
accepted
fulfilled, cancelled
processing, fulfilled, cancelled
picking, cancelled
cancelled
(terminal)
(terminal)
(terminal)
rejected
(terminal)
(terminal)
(terminal)
processing
(not used in basic)
picking, packaging, fulfilled, cancelled
picking, cancelled(alternative entry point)
packaging
(not used in basic)
pickup-pending, fulfilled, cancelled
pickup-pending, cancelled
picking
(not used in basic)
packaging, fulfilled, cancelled
packaging, cancelled
pickup-pending
(not used in basic)
in-transit, fulfilled
in-transit, delivered, cancelled
in-transit
delivered, exception, not-delivered
delivered, exception, not-delivered
delivered, exception, not-delivered
fulfilled
in-transit, delivered
in-transit, delivered
in-transit, delivered
delivered
returned
returned
returned
returned
(terminal)
(terminal)
(terminal)
partially-fulfilled
fulfilled, cancelled
fulfilled, in-transit, cancelled
fulfilled, in-transit, cancelled
partially-delivered
delivered, returned
delivered, returned
delivered, returned
not-delivered
in-transit, cancelled
in-transit, cancelled
in-transit, cancelled
exception
in-transit, delivered, cancelled
in-transit, delivered, cancelled
in-transit, delivered, cancelled
preparing is not a valid state for /transition
Notice preparing doesn't appear in any column: it isn't one of the 17 values of the OrderStatus type, so sending it as toStatus to /transition (with any flowProfile) always gets rejected with orders:invalid_transition, even though it does appear in the 23-state HATEOAS table above.
When you retrieve an order, its _links object includes only the actions valid for its current state. The possible actions are: accept, reject, cancel, prepare, fulfill, returns. If an action doesn't appear in _links, it isn't valid for the order's current state.
The handler doesn't read any field from the request body — send {} or simply omit the body. If the order belongs to a channel that requires confirming the acceptance in the marketplace before accepting locally (today: Walmart), the acceptance is propagated automatically; you don't need to send anything for that.
Returns the updated order, wrapped in data, with its new state (rejected) and its _links. rejected is a terminal state in the HATEOAS table, so no action (accept/prepare/fulfill/…) appears — only the four base navigation links (self, attachments, activityLog, validTransitions), which are always present.
One of the 12 canonical cancellation reasons — same catalog used by cancel (see table in 'Cancel an order' below).
motivestring
Specific child motive within the chosen reason. Must belong to reason.
notestring
Additional free-text context. Required when reason is other.
requestedBystring
Who requested the rejection: buyer, seller, or platform.
Same reason catalog as cancel, strict validation
reject uses the same catalog of 12 canonical reasons as cancel (see the table in the "Cancel an order" section below) and the same rule: note is required when reason is other. Unlike cancel (which accepts extra fields without rejecting them), reject's validator is strict: sending any field other than reason, motive, note, or requestedBy is rejected.
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/cancel \ -H "Authorization: Bearer fkapi_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "reason": "customer_request", "requestedBy": "buyer", "note": "El cliente cambió de opinión" }'
Returns the updated order, wrapped in data, with its new state (cancelled) and its _links. cancelled is a terminal state in the HATEOAS table, so no action (accept/prepare/fulfill/…) appears — only the four base navigation links (self, attachments, activityLog, validTransitions), which are always present.
Unlike accept/reject/cancel/transition, this endpoint responds with 204 No Content: it doesn't validate the transition against the state machine (don't confuse it with transition, which does validate) and it doesn't return the updated order. If you need the resulting order, do a GET /orders/{orderId} afterward.
Target status. Must be a valid transition from the current state per the 17-state table by `flowProfile` (see above) — not the 23-state HATEOAS table.
reasonstring
Reason for the transition, for the activity log. Only required when the specific transition demands it (e.g. some transitions to cancelled/rejected) — in that case, omitting it returns validation:invalid_input.
detailsstring
Additional free-text detail for the activity log.
flowProfilestring
Flow profile the transition is validated against: basic, intermediate (default), or wms-full.
The response does NOT carry _links, and the order is nested under order
Unlike accept/reject/cancel (which return { data: { ...order, _links } }), this endpoint returns { data: { order, previousStatus, newStatus, hooks } } — the complete order lives under the order key, without _links, alongside the previous/new status and the list of hooks that fired (e.g. inventory adjustments).
preparing is not a valid toStatus
preparing belongs only to the 23-state HATEOAS table, not to the canonical OrderStatus type this endpoint validates against — sending it as toStatus always returns orders:invalid_transition, regardless of flowProfile. Use one of the 17 states from "The table that actually validates a transition" above (e.g. processing, as in the example).
Returnssuccess (true only if no order failed), a summary of the operation (summary), and the detailed per-order result (results[]), along with the bulkOperationId, the applied targetStatus, and performedAt/performedBy with the timestamp and the user who ran the operation.
IDs of the orders to transition. At least one element — an empty array rejects the entire call with validation:invalid_input.
toStatusstringrequired
Target status for all orders.
reasonstring
Reason applied to the batch. Not required by the schema.
detailsstring
Additional free-text detail, same as the individual transition — applied to each order's activity log entry in the batch.
flowProfilestring
Optional flow profile for the transition.
Each order is processed individually
With at least one element in orderIds, each order is processed separately: one can fail (invalid transition, not found) without aborting the rest — check results[] for the per-order detail.
Returns the order's current state (currentStatus) and the array of states it can transition to (validTargets), computed against the 17-state table by flowProfile from "The table that actually validates a transition" above — not the 23-state HATEOAS table.
Flow profile the valid transitions are computed against: basic, intermediate (default), or wms-full.
This endpoint saves you from having to reimplement @fenicia/core's 17-state transition table in your client: it returns directly the set of valid states, per flowProfile, for the queried order. It's documented in detail in Get an order, along with the rest of the resource's HATEOAS links.