> For the complete documentation index, see [llms.txt](https://vu-custom.gitbook.io/vu-custom/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vu-custom.gitbook.io/vu-custom/admin-api/orders/update-an-order.md).

# Update an order

Method : <mark style="color:green;">**PUT**</mark>

{% code fullWidth="false" %}

```url
https://os.vucustom.com/api/v1/orders?id=&order_number=
```

{% endcode %}

URL Parameters

<table><thead><tr><th width="190">Field Name</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>System-generated unique identifier for the order. Use either id or order_number</td></tr><tr><td>order_number</td><td>Unique order reference number. Used when id is not provided</td></tr></tbody></table>

<details>

<summary>Example Request </summary>

{% code fullWidth="true" %}

```json
{		
		"order":{
        "note": "test note",
        "purchase_order_number": "po-123",
		"sales_order_number": "so-123",
		"ship_method_code": "FED",
		"ship_method_carrier": "Fedex",
		"ship_method_description": "Next day air, NDA"
	}
}
```

{% endcode %}

</details>

{% hint style="info" %}
refer to order and order line schema [here](/vu-custom/admin-api/orders/create-an-order.md)
{% endhint %}

{% tabs %}
{% tab title="200" %}
**`200 Successful response example`**

```json
{
	"order": {
		"id": 432,
		"order_number": "ord-12s3425",
		"order_date": "2022-10-31T01:54:56.271Z",
		"note": null,
		"custom_attributes": {},
		"purchase_order_number": "po-123",
		"sales_order_number": "so-123",
		"ship_method_carrier": "ups",
		"ship_method_description": "Standard",
		"ship_method_code": "ups_standard",
		"tags": [
			"tag1",
			"tag2"
		],
		"created_at": "2023-12-19T08:10:53.424Z",
		"updated_at": "2024-01-02T07:26:41.193Z",
		"ship_to": {
			"id": 13,
			"account_number": "SHPTO123",
			"address_1": "123 Main St",
			"address_2": "",
			"city": "Ridgewood",
			"company_name": "VU Custom",
			"state_region": "NJ",
			"country": "US",
			"first_name": "John",
			"last_name": "Smith",
			"phone": "2011231234",
			"postal_code": "07450",
			"created_at": "2022-10-31T01:54:56.271Z",
			"updated_at": "2022-10-31T01:54:56.271Z"
		},
		"sold_to": {
			"id": 17,
			"account_number": "SLDTO123",
			"address_1": "123 Main St",
			"address_2": "",
			"city": "Ridgewood",
			"company_name": "VU Custom",
			"state_region": "NJ",
			"country": "US",
			"first_name": "John",
			"last_name": "Smith",
			"phone": "2011231234",
			"postal_code": "07450",
			"created_at": "2022-10-31T01:54:56.271Z",
			"updated_at": "2022-10-31T01:54:56.271Z"
		},
		"order_lines": [
			{
				"id": 396,
				"sku": "SKU123",
				"customer_requested_date": "2022-10-31T01:54:56.271Z",
				"estimated_arrival_date": "2022-10-31T01:54:56.271Z",
				"line_reference": "59861396",
				"price": "70.0",
				"quantity": 1,
				"recipe_token": "1609c0e8",
				"status": "not_routed",
				"tags": [
					"tag1",
					"tag2"
				],
				"ex_factory_date": {
					"calculated": "2022-10-31T01:54:56.271Z",
					"requested": null,
					"confirmed": null,
					"changes": []
				},
				"upc": null,
				"custom_attributes": {},
				"factory_code": null,
				"created_at": "2023-12-19T08:10:53.431Z",
				"updated_at": "2023-12-19T08:10:53.431Z"
			}
		]
	}
}
```

{% endtab %}

{% tab title="401 " %}
**`401 Unauthorized`**

`The client doesn’t have correct authentication credentials.`

```
{
"errors": "[API] Invalid API key or secret (unrecognized login or wrong password)"
}
```

{% endtab %}

{% tab title="403" %}
**`403 Forbidden`**

`The server is refusing to respond. This is typically caused by incorrect access.`
{% endtab %}

{% tab title="404" %}
**`404 Not Found`**

`The requested resource was not found but could be available again in the future.`
{% endtab %}

{% tab title="422" %}
**`422 Unprocessable Entity`**
{% endtab %}

{% tab title="5xx" %}
**`5xx Errors`**

`An internal error occurred in VU Admin.`
{% endtab %}
{% endtabs %}
