---
title: "Operate metafields in bulk"
description: >
  Create or update metafields in bulk. If the metafield does not exist, it will be created; if it exists, it will be updated with the new data.
doc_type: openapi
doc_category: openapi
doc_version: v20260901
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/shopline-metafields/metafields/resource-metafields/operate-metafields-in-bulk'
  md: 'https://developer.shopline.com/docs/admin-rest-api/shopline-metafields/metafields/resource-metafields/operate-metafields-in-bulk.md'
---
# Operate metafields in bulk

Create or update metafields in bulk. If the metafield does not exist, it will be created; if it exists, it will be updated with the new data. 

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **API Version:** v20260901
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /metafields_set.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Request

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

### Request Body

* `metafields`

  array<object>

  List of metafields.  
  Maximum size: 25

  * `type`

    string

    The data type for the metafield. Valid values are:     
    - `single_line_text_field`: A single-line text field 
    - `list.single_line_text_field`: Multiple single-line text fields  
    - `multi_line_text_field`: Multi-line text field    
    - `color`: A single color  
    - `list.color`: Multiple colors 
    - `date`: A single date 
    - `list.date`: Multiple dates  
    - `date_time`: A single date and time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).   
    - `list.date_time`: Multiple dates and times. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). 
    - `url`: A single URL  
    - `list.url`: Multiple URLs  
    - `file_reference`: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.     
    - `list.file_reference`: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.  
    - `json`: JSON     
    - `weight`: A single weight with a unit   
    - `list.weight`: Multiple weights with units   
    - `volume`: A single volume with a unit   
    - `list.volume`: Multiple volumes with units   
    - `dimension`: A single size with a unit    
    - `list.dimension`: Multiple sizes with units   
    - `number_integer`: A single integer   
    - `list.number_integer`: Multiple integers   
    - `number_decimal`: A single decimal   
    - `list.number_decimal`: Multiple decimals  
    - `rating`: A single rating    
    - `list.rating`: Multiple ratings 
    - `page_reference`: A single page  
    - `list.page_reference`: Multiple pages   
    - `product_reference`: A single product    
    - `list.product_reference`: Multiple products  
    - `variant_reference`: A single product variant  
    - `list.variant_reference`: Multiple product variants    
    - `collection_reference`: A single product collection  
    - `list.collection_reference`: Multiple product collections      
    - `boolean`: Boolean type. Valid values are `true` and `false`.
    - `money`: Amount with a currency   
    
    For more information about metafields, refer to [Guide to Using Metafields Feature](https://help.shopline.com/hc/en-001/articles/7095355017113).

  * `value`

    object

    Data stored in the metafield.  
    Regardless of how you define the type of the metafield, SHOPLINE will store it in string format. The maximum length of the converted string is 500000.

  * `description`

    string

    Description of the metafield.  
    Maximum length: 255

  * `key`

    string

    A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported.  
    Minimum length: 3  
    Maximum length: 30  

  * `namespace`

    string

    The namespace of the metafield, used to group metafields. A metafield can be uniquely identified by its `key` and `namespace`.   
    Only letters, numbers, hyphens, and underscores are supported.     
    Minimum length: 2  
    Maximum length: 50 
    

  * `owner_id`

    string

    The ID of the resource to which the metafield belongs. For example, when adding a metafield to product A with an ID of `1605898661`, the metafield's `owner_id` is `1605898661`.  
    Maximum length: 128

  * `owner_resource`

    string

    The type of the resource to which the metafield belongs. Valid values are:  
    - `products`: products 
    - `variants`: product variants  
    - `collections`: product collections
    - `customers`: customers
    - `orders`: orders
    - `pages`: pages  
    - `blogs`: blogs collections
    - `articles`: blogs  
    - `shop`: store

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `fail_metafields`

  array<object>

  List of metafields that failed to be created or updated. 

  * `errors`

    string

    Error message for the metafield creation or update failure. 

  * `key`

    string

    A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported. 

  * `namespace`

    string

    The namespace of the metafield.

  * `owner_id`

    string

    The resource ID to which the metafield belongs. 

  * `owner_resource`

    string

    The type of the resource to which the metafield belongs. Valid values are:  
    - `products`: products 
    - `variants`: product variants  
    - `collections`: product collections
    - `customers`: customers
    - `orders`: orders
    - `pages`: pages  
    - `blogs`: blogs collections
    - `articles`: blogs

* `metafields`

  array<object>

  List of metafields that were successfully created or updated. 

  * `created_at`

    string

    The date and time when the metafield was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `description`

    string

    Description of the metafield.  

  * `id`

    long

    The ID of the metafield.

  * `namespace`

    string

    The namespace of the metafield.

  * `owner_id`

    string

    The resource ID to which the metafield belongs.

  * `updated_at`

    string

    The date and time when the metafield was updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `value`

    string

    The data stored in the metafield. 

  * `key`

    string

    A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported. 

  * `owner_resource`

    string

    The type of the resource to which the metafield belongs. Valid values are:  
    - `products`: products 
    - `variants`: product variants  
    - `collections`: product collections
    - `customers`: customers
    - `orders`: orders
    - `pages`: pages  
    - `blogs`: blogs collections
    - `articles`: blogs  
    - `shop`: store

  * `type`

    string

    The data type for the metafield. Valid values are:     
    - `single_line_text_field`: A single-line text field 
    - `list.single_line_text_field`: Multiple single-line text fields  
    - `multi_line_text_field`: Multi-line text field    
    - `color`: A single color  
    - `list.color`: Multiple colors 
    - `date`: A single date 
    - `list.date`: Multiple dates  
    - `date_time`: A single date and time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).   
    - `list.date_time`: Multiple dates and times. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). 
    - `url`: A single URL  
    - `list.url`: Multiple URLs  
    - `file_reference`: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.     
    - `list.file_reference`: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.  
    - `json`: JSON     
    - `weight`: A single weight with a unit   
    - `list.weight`: Multiple weights with units   
    - `volume`: A single volume with a unit   
    - `list.volume`: Multiple volumes with units   
    - `dimension`: A single size with a unit    
    - `list.dimension`: Multiple sizes with units   
    - `number_integer`: A single integer   
    - `list.number_integer`: Multiple integers   
    - `number_decimal`: A single decimal   
    - `list.number_decimal`: Multiple decimals  
    - `rating`: A single rating    
    - `list.rating`: Multiple ratings 
    - `page_reference`: A single page  
    - `list.page_reference`: Multiple pages   
    - `product_reference`: A single product    
    - `list.product_reference`: Multiple products  
    - `variant_reference`: A single product variant  
    - `list.variant_reference`: Multiple product variants    
    - `collection_reference`: A single product collection  
    - `list.collection_reference`: Multiple product collections      
    - `boolean`: Boolean type. Valid values are `true` and `false`.
    - `money`: Amount with a currency   
    
    For more information about metafields, refer to [Guide to Using Metafields Feature](https://help.shopline.com/hc/en-001/articles/7095355017113).


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Operate metafields in bulk"
  ],
  "description": "Create or update metafields in bulk. If the metafield does not exist, it will be created; if it exists, it will be updated with the new data. ",
  "externalDocs": {
    "url": "",
    "errorTableDescription": "| Error Code | HTTP Status Code | Error Description |\n|------------|------------------|-------------------|\n| INTERNAL_ERROR | 500 | An internal error occured. |\n| SUCCESS | 200 | request success |\n"
  },
  "operationId": "zHCaVw80",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "name": "body",
          "description": "Body location parameters",
          "type": "object",
          "properties": {
            "metafields": {
              "name": "metafields",
              "description": "List of metafields.  \nMaximum size: 25",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "name": "type",
                    "description": "The data type for the metafield. Valid values are:     \n- `single_line_text_field`: A single-line text field \n- `list.single_line_text_field`: Multiple single-line text fields  \n- `multi_line_text_field`: Multi-line text field    \n- `color`: A single color  \n- `list.color`: Multiple colors \n- `date`: A single date \n- `list.date`: Multiple dates  \n- `date_time`: A single date and time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).   \n- `list.date_time`: Multiple dates and times. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). \n- `url`: A single URL  \n- `list.url`: Multiple URLs  \n- `file_reference`: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.     \n- `list.file_reference`: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.  \n- `json`: JSON     \n- `weight`: A single weight with a unit   \n- `list.weight`: Multiple weights with units   \n- `volume`: A single volume with a unit   \n- `list.volume`: Multiple volumes with units   \n- `dimension`: A single size with a unit    \n- `list.dimension`: Multiple sizes with units   \n- `number_integer`: A single integer   \n- `list.number_integer`: Multiple integers   \n- `number_decimal`: A single decimal   \n- `list.number_decimal`: Multiple decimals  \n- `rating`: A single rating    \n- `list.rating`: Multiple ratings \n- `page_reference`: A single page  \n- `list.page_reference`: Multiple pages   \n- `product_reference`: A single product    \n- `list.product_reference`: Multiple products  \n- `variant_reference`: A single product variant  \n- `list.variant_reference`: Multiple product variants    \n- `collection_reference`: A single product collection  \n- `list.collection_reference`: Multiple product collections      \n- `boolean`: Boolean type. Valid values are `true` and `false`.\n- `money`: Amount with a currency   \n\nFor more information about metafields, refer to [Guide to Using Metafields Feature](https://help.shopline.com/hc/en-001/articles/7095355017113).",
                    "type": "string",
                    "example": "multi_line_text_field"
                  },
                  "value": {
                    "name": "value",
                    "description": "Data stored in the metafield.  \nRegardless of how you define the type of the metafield, SHOPLINE will store it in string format. The maximum length of the converted string is 500000.",
                    "type": "object"
                  },
                  "description": {
                    "name": "description",
                    "description": "Description of the metafield.  \nMaximum length: 255",
                    "type": "string",
                    "example": "This is the description for the Product Care Guidelines metafield"
                  },
                  "key": {
                    "name": "key",
                    "description": "A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported.  \nMinimum length: 3  \nMaximum length: 30  ",
                    "type": "string",
                    "example": "product-guide"
                  },
                  "namespace": {
                    "name": "namespace",
                    "description": "The namespace of the metafield, used to group metafields. A metafield can be uniquely identified by its `key` and `namespace`.   \nOnly letters, numbers, hyphens, and underscores are supported.     \nMinimum length: 2  \nMaximum length: 50 \n",
                    "type": "string",
                    "example": "my_fields"
                  },
                  "owner_id": {
                    "name": "owner_id",
                    "description": "The ID of the resource to which the metafield belongs. For example, when adding a metafield to product A with an ID of `1605898661`, the metafield's `owner_id` is `1605898661`.  \nMaximum length: 128",
                    "type": "string",
                    "example": "16058986610866520712462605"
                  },
                  "owner_resource": {
                    "name": "owner_resource",
                    "description": "The type of the resource to which the metafield belongs. Valid values are:  \n- `products`: products \n- `variants`: product variants  \n- `collections`: product collections\n- `customers`: customers\n- `orders`: orders\n- `pages`: pages  \n- `blogs`: blogs collections\n- `articles`: blogs  \n- `shop`: store",
                    "type": "string",
                    "example": "products"
                  }
                },
                "example": {
                  "type": "multi_line_text_field",
                  "value": null,
                  "description": "This is the description for the Product Care Guidelines metafield",
                  "key": "product-guide",
                  "namespace": "my_fields",
                  "owner_id": "16058986610866520712462605",
                  "owner_resource": "products"
                }
              },
              "example": [
                {
                  "namespace": "my_fields",
                  "owner_id": "16058986610866520712462605",
                  "owner_resource": "products",
                  "type": "multi_line_text_field",
                  "value": null,
                  "description": "This is the description for the Product Care Guidelines metafield",
                  "key": "product-guide"
                }
              ]
            }
          },
          "example": {
            "metafields": [
              {
                "value": null,
                "description": "This is the description for the Product Care Guidelines metafield",
                "key": "product-guide",
                "namespace": "my_fields",
                "owner_id": "16058986610866520712462605",
                "owner_resource": "products",
                "type": "multi_line_text_field"
              }
            ]
          }
        },
        "examples": {
          "Update metafields in batch": {
            "description": "Update metafields in batch",
            "value": {
              "metafields": [
                {
                  "key": "mfkey-1",
                  "namespace": "mftest",
                  "owner_id": "16058986610866520712462605",
                  "owner_resource": "products",
                  "type": "list.number_decimal",
                  "value": "[\"0.123\",\"22.33\"]",
                  "description": "Here is the description for the metafield1."
                },
                {
                  "type": "multi_line_text_field",
                  "value": "This is the assignment contents for metafields.",
                  "description": "Here is the description for the metafield2.",
                  "key": "mfkey-2",
                  "namespace": "mftest",
                  "owner_id": "2241475414",
                  "owner_resource": "customers"
                }
              ]
            }
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "fail_metafields": {
                "name": "fail_metafields",
                "description": "List of metafields that failed to be created or updated. ",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "name": "errors",
                      "description": "Error message for the metafield creation or update failure. ",
                      "type": "string"
                    },
                    "key": {
                      "name": "key",
                      "description": "A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported. ",
                      "type": "string",
                      "example": "product-guide"
                    },
                    "namespace": {
                      "name": "namespace",
                      "description": "The namespace of the metafield.",
                      "type": "string",
                      "example": "my_fields"
                    },
                    "owner_id": {
                      "name": "owner_id",
                      "description": "The resource ID to which the metafield belongs. ",
                      "type": "string",
                      "example": "16058986610866520712462605"
                    },
                    "owner_resource": {
                      "name": "owner_resource",
                      "description": "The type of the resource to which the metafield belongs. Valid values are:  \n- `products`: products \n- `variants`: product variants  \n- `collections`: product collections\n- `customers`: customers\n- `orders`: orders\n- `pages`: pages  \n- `blogs`: blogs collections\n- `articles`: blogs",
                      "type": "string"
                    }
                  },
                  "example": {
                    "key": "product-guide",
                    "namespace": "my_fields",
                    "owner_id": "16058986610866520712462605",
                    "owner_resource": null,
                    "errors": null
                  }
                },
                "example": [
                  {
                    "owner_resource": null,
                    "errors": null,
                    "key": "product-guide",
                    "namespace": "my_fields",
                    "owner_id": "16058986610866520712462605"
                  }
                ]
              },
              "metafields": {
                "name": "metafields",
                "description": "List of metafields that were successfully created or updated. ",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "created_at": {
                      "name": "created_at",
                      "description": "The date and time when the metafield was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string",
                      "example": "2023-05-31T17:03:43+08:00"
                    },
                    "description": {
                      "name": "description",
                      "description": "Description of the metafield.  ",
                      "type": "string",
                      "example": "This is the description for the Product Care Guidelines metafield"
                    },
                    "id": {
                      "name": "id",
                      "description": "The ID of the metafield.",
                      "type": "long",
                      "example": 3152668027083
                    },
                    "namespace": {
                      "name": "namespace",
                      "description": "The namespace of the metafield.",
                      "type": "string",
                      "example": "my_fields"
                    },
                    "owner_id": {
                      "name": "owner_id",
                      "description": "The resource ID to which the metafield belongs.",
                      "type": "string",
                      "example": "16058986610866520712462605"
                    },
                    "updated_at": {
                      "name": "updated_at",
                      "description": "The date and time when the metafield was updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string",
                      "example": "2023-05-31T17:03:43+08:00"
                    },
                    "value": {
                      "name": "value",
                      "description": "The data stored in the metafield. ",
                      "type": "string",
                      "example": "This is the metafields assignment content"
                    },
                    "key": {
                      "name": "key",
                      "description": "A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported. ",
                      "type": "string",
                      "example": "product-guide"
                    },
                    "owner_resource": {
                      "name": "owner_resource",
                      "description": "The type of the resource to which the metafield belongs. Valid values are:  \n- `products`: products \n- `variants`: product variants  \n- `collections`: product collections\n- `customers`: customers\n- `orders`: orders\n- `pages`: pages  \n- `blogs`: blogs collections\n- `articles`: blogs  \n- `shop`: store",
                      "type": "string"
                    },
                    "type": {
                      "name": "type",
                      "description": "The data type for the metafield. Valid values are:     \n- `single_line_text_field`: A single-line text field \n- `list.single_line_text_field`: Multiple single-line text fields  \n- `multi_line_text_field`: Multi-line text field    \n- `color`: A single color  \n- `list.color`: Multiple colors \n- `date`: A single date \n- `list.date`: Multiple dates  \n- `date_time`: A single date and time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).   \n- `list.date_time`: Multiple dates and times. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). \n- `url`: A single URL  \n- `list.url`: Multiple URLs  \n- `file_reference`: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.     \n- `list.file_reference`: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.  \n- `json`: JSON     \n- `weight`: A single weight with a unit   \n- `list.weight`: Multiple weights with units   \n- `volume`: A single volume with a unit   \n- `list.volume`: Multiple volumes with units   \n- `dimension`: A single size with a unit    \n- `list.dimension`: Multiple sizes with units   \n- `number_integer`: A single integer   \n- `list.number_integer`: Multiple integers   \n- `number_decimal`: A single decimal   \n- `list.number_decimal`: Multiple decimals  \n- `rating`: A single rating    \n- `list.rating`: Multiple ratings \n- `page_reference`: A single page  \n- `list.page_reference`: Multiple pages   \n- `product_reference`: A single product    \n- `list.product_reference`: Multiple products  \n- `variant_reference`: A single product variant  \n- `list.variant_reference`: Multiple product variants    \n- `collection_reference`: A single product collection  \n- `list.collection_reference`: Multiple product collections      \n- `boolean`: Boolean type. Valid values are `true` and `false`.\n- `money`: Amount with a currency   \n\nFor more information about metafields, refer to [Guide to Using Metafields Feature](https://help.shopline.com/hc/en-001/articles/7095355017113).",
                      "type": "string",
                      "example": "multi_line_text_field"
                    }
                  },
                  "example": {
                    "owner_resource": null,
                    "created_at": "2023-05-31T17:03:43+08:00",
                    "description": "This is the description for the Product Care Guidelines metafield",
                    "id": 3152668027083,
                    "key": "product-guide",
                    "namespace": "my_fields",
                    "type": "multi_line_text_field",
                    "updated_at": "2023-05-31T17:03:43+08:00",
                    "value": "This is the metafields assignment content",
                    "owner_id": "16058986610866520712462605"
                  }
                },
                "example": [
                  {
                    "description": "This is the description for the Product Care Guidelines metafield",
                    "owner_id": "16058986610866520712462605",
                    "owner_resource": null,
                    "type": "multi_line_text_field",
                    "value": "This is the metafields assignment content",
                    "id": 3152668027083,
                    "key": "product-guide",
                    "namespace": "my_fields",
                    "updated_at": "2023-05-31T17:03:43+08:00",
                    "created_at": "2023-05-31T17:03:43+08:00"
                  }
                ]
              }
            },
            "example": {
              "fail_metafields": [
                {
                  "errors": null,
                  "key": "product-guide",
                  "namespace": "my_fields",
                  "owner_id": "16058986610866520712462605",
                  "owner_resource": null
                }
              ],
              "metafields": [
                {
                  "created_at": "2023-05-31T17:03:43+08:00",
                  "description": "This is the description for the Product Care Guidelines metafield",
                  "id": 3152668027083,
                  "namespace": "my_fields",
                  "owner_id": "16058986610866520712462605",
                  "owner_resource": null,
                  "updated_at": "2023-05-31T17:03:43+08:00",
                  "key": "product-guide",
                  "type": "multi_line_text_field",
                  "value": "This is the metafields assignment content"
                }
              ]
            }
          },
          "examples": {
            "Update metafields in batch": {
              "description": "Update metafields in batch",
              "value": {
                "fail_metafields": [],
                "metafields": [
                  {
                    "owner_resource": "customers",
                    "type": "multi_line_text_field",
                    "created_at": "2025-01-23T10:45:19+08:00",
                    "description": "Here is the description for the metafield2.",
                    "key": "mfkey-2",
                    "owner_id": "2241475414",
                    "updated_at": "2025-02-13T17:10:36+08:00",
                    "value": "This is the assignment contents for metafields.",
                    "id": 1813234029606,
                    "namespace": "mftest"
                  },
                  {
                    "description": "Here is the description for the metafield1.",
                    "id": 1813234019606,
                    "updated_at": "2025-02-13T17:10:36+08:00",
                    "value": "[\"0.123\",\"22.33\"]",
                    "key": "mfkey-1",
                    "namespace": "mftest",
                    "owner_id": "16058986610866520712462605",
                    "owner_resource": "products",
                    "type": "list.number_decimal",
                    "created_at": "2025-01-23T10:45:19+08:00"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/metafields_set.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Operate metafields in bulk",
    "version": "v20260901"
  }
}
```