> For the complete documentation index, see [llms.txt](https://docs.spectrumcustomizer.com/integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.spectrumcustomizer.com/integration/ecommerce/update-order-status.md).

# Update Order Status

### Update workflow status (Third party->Spectrum)

Once an order has been submitted to Spectrum, the third-party can send Spectrum the workflow status for each order. This is done over HTTP as a REST API call.

```http
PUT https://{SpectrumEnvironment}/api/order/status HTTP/1.1
SPECTRUM_API_TOKEN: {SpectrumApiToken}
Content-Type: application/json
```

The endpoint also accepts `POST` with the same payload and behavior — either verb may be used.

The available `{SpectrumEnvironment}` base URLs are listed in the [Environments](/integration/api/environments.md) page.

#### **LineItem Format - Required**

* `purchaseOrderNumber` (string)
* `lineItems` (array)
* `lineItems[n]` (object)
  * `recipeSetReadableId` (string)
  * `workflowStatus` (string)

**Workflow Statuses**

* not-started
* in-progress
* in-progress-step-1
* completed
* revision
* on-hold
* approved
* released
* delivered
* cancelled

#### **LineItem Format:** Example request body

```javascript
{
  "purchaseOrderNumber": "HA-US-DEV00011101",
  "lineItems": [{
      "recipeSetReadableId": "ABCD1234",
      "workflowStatus": "in-progress"
    }
  ]
}
```

### Status Codes + **UpdateWorkflowStatus** response payload

#### 200 OK

The request has been accepted and all line-items have been updated.

```json
{
    "purchaseOrderNumber": "HA-US-DEV00011101",
    "status": "OK",
    "details": "Updated workflow status for recipeSetReadableId(s): MUEMVK2U."
}
```

#### 404 Not Found

The REST API can’t find one or more of the line-items. For a multiple line-item order, if any of the line-items are missing within Spectrum, no line-items in the order are updated.

```json
{
    "purchaseOrderNumber": "HA-US-DEV00011102",
    "status": "Error",
    "details": "Unable to find recipeSetReadableId(s): MUEMVK2U."
}
```

#### 500 Internal Server Error

An error occurred with the request or an internal operation.

```json
{
    "purchaseOrderNumber": "HA-US-DEV00011103",
    "status": "Error",
    "details": "Update status for HA-US-DEV00011103 encountered an error."
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spectrumcustomizer.com/integration/ecommerce/update-order-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
