---
updatedAt: 2026-05-27T07:01:03.000Z
agentTools:
  projectIndex: https://open-api.docs.shoplineapp.com/llms.txt
---

# bulk update metafield

bulk update information of metafield attached to order items of specific order

# OpenAPI definition

```json
{
  "info": {
    "title": "SHOPLINE Open API",
    "version": "2.348.2",
    "description": "Welcome to the shopline open-api developer hub. You'll find comprehensive guides and documentation to help you start working with shopline open-api as quickly as possible, as well as support if you get stuck. Let's jump right in!"
  },
  "servers": [
    {
      "url": "https://open.shopline.io/v1",
      "description": "Production"
    }
  ],
  "openapi": "3.0.0",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "MetafieldValue": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Metafield Value ID",
            "type": "string",
            "example": "5ad86757e38809441400001b"
          },
          "namespace": {
            "description": "Namespace",
            "type": "string",
            "example": "sales"
          },
          "key": {
            "description": "Key",
            "type": "string",
            "example": "discount"
          },
          "field_type": {
            "description": "Data type of the metafield value<br> Type allows:<br> single_line_text_field - One line of string (max 50 characters)<br> multi_line_text_field - Multiple line of string (max 1000 characters)<br> number_integer - Integer<br> number_decimal - Decimal<br> json - String of JSON object (max 4000 characters)<br> boolean - Boolean<br> url - String of URL<br>\n",
            "type": "string",
            "example": "number_integer",
            "enum": [
              "single_line_text_field",
              "multi_line_text_field",
              "number_integer",
              "number_decimal",
              "json",
              "boolean",
              "url"
            ]
          },
          "field_value": {
            "description": "Metafield value",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "object"
              }
            ],
            "example": 1234
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "metafield_type": {
            "description": "Type of the metafield",
            "type": "string",
            "example": "merchant",
            "enum": [
              "merchant",
              "app"
            ]
          },
          "resource_id": {
            "description": "Resource ID",
            "type": "string",
            "example": "62f9f0c76f4ae6001e4b00f2"
          },
          "resource_type": {
            "description": "Resource Type",
            "type": "string",
            "enum": [
              "merchant",
              "customer",
              "product",
              "order",
              "order_item",
              "cart_item"
            ]
          },
          "merchant_id": {
            "description": "Merchant ID",
            "type": "string",
            "example": "66418472bcba497f92f3a168"
          }
        },
        "example": {
          "id": "5ad86757e38809441400001b",
          "namespace": "sales",
          "key": "discount",
          "field_type": "number_integer",
          "field_value": 10,
          "created_at": "2021-12-01T03:12:11.666+00:00",
          "updated_at": "2021-12-02T09:35:12.555+00:00",
          "metafield_type": "merchant",
          "resource_id": "62f9f0c76f4ae6001e4b00f2",
          "resource_type": "product",
          "merchant_id": "66418472bcba497f92f3a168"
        }
      }
    }
  },
  "paths": {
    "/orders/{order_id}/items/metafields/bulk": {
      "put": {
        "summary": "bulk update metafield",
        "description": "bulk update information of metafield attached to order items of specific order",
        "parameters": [
          {
            "name": "order_id",
            "description": "Order ID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "61a454d074350c3ee0fa6aab"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "$ref": "#/components/schemas/MetafieldValue/properties/id"
                        },
                        "resource_id": {
                          "$ref": "#/components/schemas/MetafieldValue/properties/resource_id"
                        },
                        "namespace": {
                          "$ref": "#/components/schemas/MetafieldValue/properties/namespace"
                        },
                        "key": {
                          "$ref": "#/components/schemas/MetafieldValue/properties/key"
                        },
                        "field_type": {
                          "$ref": "#/components/schemas/MetafieldValue/properties/field_type"
                        },
                        "field_value": {
                          "$ref": "#/components/schemas/MetafieldValue/properties/field_value"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Order Item Metafields"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MetafieldValue"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Order Item Metafields",
      "description": "Operations about order item metafield values"
    }
  ]
}
```