POST
Change line item status
Change the status of a single line item. Triggers notifications when configured on the target status.
POST
/v1/line-items/:lineItemId/statusAuthentication
This endpoint requires a valid API key with
canChangeOrderStatus permission. The API key must be passed in the X-API-Key header.X-API-Key: ucos_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXURL parameters
| Parameter | Description |
|---|---|
| lineItemIdstring · Required | Internal line item ID (SyncedLineItem.id) |
Request body
| Parameter | Description |
|---|---|
| status_idstring · Required | Target status ID. An addon status is added to the line item when it is missing and removed when the line item already carries it; its sub-status is updated when one is given. |
| sub_status_option_idstring · Optional | Required when the target status has a sub-status group with options |
Response
Returns confirmation with updated line item status:
{
"success": true,
"data": {
"message": "string",
"line_item": {
"id": "string",
"shopify_line_item_id": "string",
"name": "string",
"quantity": 0,
"title": null,
"variant_title": null,
"sku": null,
"custom_status": {
"id": "string",
"name": "string",
"color": "string"
},
"custom_sub_status": null
},
"notifications": {
"total_sent": 0,
"total_failed": 0,
"errors": [
{
"channel": "string",
"code": "string",
"message": "string"
}
]
},
"metafield_errors": []
}
}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. |
| messagestring | Confirmation message |
| line_itemobject | Updated line item object |
| notificationsobject | Notification delivery summary. |
| metafield_errorsarray | Declared as { orderId, message }[]; the metafield rebuild never rejects, so this array is always empty in practice. |
Line item object fields
| Field | Description |
|---|---|
| idstring | Unique identifier for the line item |
| shopify_line_item_idstring | Shopify's global ID for the line item |
| namestring | Product name |
| quantitynumber | Quantity ordered |
| titlestring | null | Product title |
| variant_titlestring | null | Variant title, or null |
| skustring | null | SKU, or null |
| custom_statusobject | Current status object, or null. |
| custom_sub_statusobject | null | Current sub-status object, or null. |
Status object fields
| Field | Description |
|---|---|
| idstring | Unique identifier for the custom status |
| namestring | Display name of the status (uses public name if configured) |
| colorstring | Hex color code for the status |
Sub-status object
| Field | Description |
|---|---|
| idstring | Unique identifier for the sub-status |
| namestring | Name of the sub-status |
Notifications object fields
| Field | Description |
|---|---|
| total_sentnumber | Number of notifications sent. |
| total_failednumber | Number of notifications that failed. |
| errorsarray | Per-channel notification errors. |
Notification error object fields
| Field | Description |
|---|---|
| channelstring | Channel that failed. |
| codestring | Machine-readable error code. |
| messagestring | Human-readable error message. |
Metafield error object fields
| Field | Description |
|---|---|
| orderIdstring | Order id whose metafield failed. |
| messagestring | Human-readable error message. |
Examples
Basic request
curl -X POST "https://api.ultimate-custom-order-status.apps.msmtech.ca/api/v1/line-items/8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10/status" \
-H "X-API-Key: ucos_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "X-API-Version: 1.5" \
-H "Content-Type: application/json" \
-d '{"line_item_id":"8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10","status_id":"8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10","sub_status_option_id":"8c1d4e2f-0a53-49b7-b6e4-7f2d9c3a5e10"}'Rate limiting
This endpoint is subject to per-minute and per-day rate limits based on your API key. Rate limit information is returned in the response headers:
X-RateLimit-Limit-Minute: Maximum requests per minuteX-RateLimit-Remaining-Minute: Remaining requests in current minuteX-RateLimit-Reset-Minute: Unix timestamp when minute window resetsX-RateLimit-Limit-Day: Maximum requests per dayX-RateLimit-Remaining-Day: Remaining requests in current dayX-RateLimit-Reset-Day: Unix timestamp when day window resetsRetry-After: Seconds to wait before retrying (when rate limited)
Error responses
400 Bad Request
Line item status not enabled, validation failed, or product chain enforcement violation
{
"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
API key lacks required permissions
{
"success": false,
"error": "Insufficient permissions. Required: canChangeOrderStatus"
}404 Not Found
Line item, status, or sub-status not found
{
"success": false,
"error": "Line item not found"
}500 Internal Server Error
Server error occurred
{
"success": false,
"error": "Internal server error",
"details": {
"message": "An unexpected error occurred"
}
}