POST
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.
POST
/v1/orders/:order_id/workflowAuthentication
This endpoint requires the
canOverrideProductChainEnforcement permission. Send your API key in the X-API-Key header with every request.X-API-Key: ucos_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPath parameters
| Parameter | Description |
|---|---|
| order_idstring · Required | Order UUID, or a Shopify order id when use_shopify_order_id is true. |
Request body
| Parameter | Description |
|---|---|
| use_shopify_order_idboolean · Optional, default false | Treat the path segment as a Shopify order id instead of the app's order UUID. |
| workflow_idstring · Required | Target workflow. Must exist in this shop. |
| starting_status_idstring · Optional | Main (non-addon, non-independent) status of the target workflow to apply. Defaults to the workflow's first status. |
Response
Returns the applied workflow and status, plus what the fulfilment step did:
{
"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 | Description |
|---|---|
| successboolean | Always true on a successful response. |
| dataobject | The endpoint's payload. Its fields are listed in the tables below. |
| order_idstring | Order UUID. |
| shop_order_idstring | Shopify order id (GID). |
| workflowobject | Applied workflow object. |
| statusobject | Applied status object. |
| orders_fulfillednumber | Number of orders whose fulfilment was applied. |
| fulfillment_errorsarray | Fulfilment errors; a blocked fulfilment never half-applies. |
| fulfillment_readinessobject | null | Present when fulfilment was refused; the choice block to resolve it (v1.5+ only). |
| fulfillment_move_resultsarray | Outcome of a requested move (v1.5+ only). |
Workflow object fields
| Field | Description |
|---|---|
| idstring | Unique identifier for the workflow |
| namestring | Display name of the workflow |
Status object fields
| Field | Description |
|---|---|
| idstring | UUID of the status |
| namestring | Internal name of the status |
Fulfillment error object fields
| Field | Description |
|---|---|
| channelstring | Fulfilment channel that failed. |
| codestring | Machine-readable error code. |
| messagestring | Human-readable error message. |
Fulfillment readiness object fields
| Field | Description |
|---|---|
| requiredboolean | Whether a location choice is needed. |
| codestring | Machine-readable refusal code. |
| causestring | Underlying cause. |
| messagestring | Message to show the operator. |
| orders_to_fulfillment_orders_mapobject | Order id → fulfilment order ids map. |
| moveable_fulfillment_order_idsarray | Fulfilment orders that can be moved. |
| location_choicesarray | Candidate destination locations. |
| submit_withstring | Request field to send the answer in — fulfillment_selections. |
Fulfillment move result fields
| Field | Description |
|---|---|
| shop_order_idstring | Shopify order GID involved in the move. |
| fulfillment_order_idstring | Fulfilment order GID moved. |
| location_idstring | Destination location id. |
| successboolean | Whether the move succeeded. |
| errorstring | 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
This endpoint is subject to the same per-key limits as every other endpoint.
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"
}
}