---
title: "Update Order Metafield"
description: "Use PUT /orders/{order_id}/metafields/{metafield}. The operation is OrderMetafield.update."
canonical: https://docs.ordering.co/api-reference/guides/edit-order-metafield/
---

# Update Order Metafield

> **API operation:** [Open the endpoint in Scalar](https://docs.ordering.co/api-reference/#tag/orders/PUT/orders/{order_id}/metafields/{metafield})

Use `PUT /orders/{order_id}/metafields/{metafield}`. The operation is `OrderMetafield.update`. Integrations using `{metafield_id}` can map it to `{metafield}` in the same final path position.

## OpenAPI reference

**Operation:** `PUT /orders/{order_id}/metafields/{metafield}`

**Path parameters**

| Name        | Type    | Required | Description |
| ----------- | ------- | -------- | ----------- |
| `order_id`  | integer | Yes      | —           |
| `metafield` | integer | Yes      | —           |

**Request body fields**

| Name         | Type    | Required |
| ------------ | ------- | -------- |
| `key`        | string  | No       |
| `model`      | any     | Yes      |
| `object_id`  | integer | No       |
| `value`      | any     | No       |
| `value_type` | string  | No       |

**Responses**

| Code | Description                           |
| ---- | ------------------------------------- |
| 200  | OK (Envelope)                         |
| 400  | Bad Request (ErrorResponse)           |
| 401  | Unauthorized                          |
| 404  | Not Found                             |
| 429  | Too Many Requests (ErrorResponse)     |
| 500  | Internal Server Error (ErrorResponse) |
| 503  | Service Unavailable (ErrorResponse)   |

[Open this operation in the API reference](https://docs.ordering.co/api-reference/#tag/orders/PUT/orders/{order_id}/metafields/{metafield})
