Move an Order to Another Workflow
Reassign an order to a different workflow. The move applies a starting status from the target workflow and carries the status change and the fulfilment it triggers.
Endpoint
POST /v1/orders/:order_id/workflowAuthentication
canOverrideProductChainEnforcement permission. Send your API key in the X-API-Key header with every request.X-API-Key: ucos_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXWhat the Move Does
Workflows are status-driven, so a move is completed by applying a starting status from the target workflow. The status change can trigger fulfilment — for example when the target status marks the order fulfilled.
This is not a silent reassignment: the order's status changes and the fulfilment it triggers is attempted. A blocked fulfilment never half-applies — the status change stands and the response reports the errors. A caller that also fulfils separately would double-handle the order.
Path Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
order_id | string | Yes | - | Order UUID, or a Shopify order id when use_shopify_order_id is true. |
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_id | string (UUID) | Yes | - | Target workflow. Must exist in this shop. |
starting_status_id | string (UUID) | No | First status of the target workflow | Main (non-addon, non-independent) status of the target workflow to apply. Defaults to the workflow's first status. |
use_shopify_order_id | boolean | No | false | Treat the path segment as a Shopify order id instead of the app's order UUID. |
Response
{
"success": true,
"data": {
"success": true,
"order_id": "string",
"shop_order_id": "string",
"workflow": {
"id": "string",
"name": "string"
},
"status": {
"id": "string",
"name": "string"
},
"orders_fulfilled": 0,
"fulfillment_errors": [
{
"channel": "string",
"code": "string",
"message": "string"
}
]
}
}Response Fields
Root Response Object
| Field | Type | Description |
|---|---|---|
success | boolean | Always true on a successful response. |
data | object | The endpoint's payload. Its fields are listed in the tables below. |
order_id | string | Order UUID. |
shop_order_id | string | Shopify order id (GID). |
workflow | object | Applied workflow object. |
status | object | Applied status object. |
orders_fulfilled | number | Number of orders whose fulfilment was applied. |
fulfillment_errors | array | Fulfilment errors; a blocked fulfilment never half-applies. |
fulfillment_readiness | object | null | Present when fulfilment was refused; the choice block to resolve it (v1.5 only). |
fulfillment_move_results | array | Outcome of a requested move (v1.5 only). |
Workflow Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Workflow UUID. |
name | string | Workflow name. |
Status Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Status UUID. |
name | string | Status name. |
Fulfillment Error Object Fields
| Field | Type | Description |
|---|---|---|
channel | string | Fulfilment channel that failed. |
code | string | Machine-readable error code. |
message | string | Human-readable error message. |
Fulfillment Readiness Object Fields
| Field | Type | Description |
|---|---|---|
required | boolean | Whether a location choice is needed. |
code | string | Machine-readable refusal code. |
cause | string | Underlying cause. |
message | string | Message to show the operator. |
orders_to_fulfillment_orders_map | object | Order id → fulfilment order ids map. |
moveable_fulfillment_order_ids | array | Fulfilment orders that can be moved. |
location_choices | array | Candidate destination locations. |
submit_with | string | Request field to send the answer in — fulfillment_selections. |
Fulfillment Move Result Fields
| Field | Type | Description |
|---|---|---|
shop_order_id | string | Shopify order GID involved in the move. |
fulfillment_order_id | string | Fulfilment order GID moved. |
location_id | string | Destination location id. |
success | boolean | Whether the move succeeded. |
error | string | null | Error message when the move failed. |
Examples
Basic Request
curl -X POST "https://api.ultimate-custom-order-status.apps.msmtech.ca/api/v1/orders/8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10/workflow" \
-H "X-API-Key: ucos_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "X-API-Version: 1.5" \
-H "Content-Type: application/json" \
-d '{"order_id":"8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10","use_shopify_order_id":false,"workflow_id":"8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10","starting_status_id":"8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10"}'Using a Shopify Order ID
curl -X POST "https://api.ultimate-custom-order-status.apps.msmtech.ca/api/v1/orders/5234567890/workflow" \
-H "X-API-Key: ucos_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "X-API-Version: 1.5" \
-H "Content-Type: application/json" \
-d '{
"workflow_id": "3f2a9c1e-7b64-4d21-9a3e-1c5d8f0b2a77",
"starting_status_id": "8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10",
"use_shopify_order_id": true
}'Rate Limiting
X-RateLimit-Limit-Minute: Maximum requests per minuteX-RateLimit-Remaining-Minute: Remaining in current minuteX-RateLimit-Reset-Minute: Unix timestamp (seconds) when minute resetsX-RateLimit-Limit-Day: Maximum requests per dayX-RateLimit-Remaining-Day: Remaining in current dayX-RateLimit-Reset-Day: Unix timestamp (seconds) when day resetsRetry-After: Seconds to wait before retrying (present when rate limited)
Error Responses
400 Bad Request
Invalid body, a starting status outside the target workflow, an addon or independent status, a workflow with no statuses, or the status engine refused the change.
{
"success": false,
"error": "Validation failed",
"details": {
"errors": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"status_id"
],
"message": "Required"
}
]
}
}401 Unauthorized
Missing or invalid API key
{
"success": false,
"error": "Missing API key. Include it in the X-API-Key header"
}403 Forbidden
The API key lacks the canOverrideProductChainEnforcement permission
{
"success": false,
"error": "Insufficient permissions. Required: canOverrideProductChainEnforcement"
}404 Not Found
Order, workflow or starting status not found in this shop
{
"success": false,
"error": "Order not found"
}500 Internal Server Error
Unexpected server error
{
"success": false,
"error": "Internal server error",
"details": {
"message": "An unexpected error occurred"
}
}