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

# Bulk create app metafield

To create app metafield attached to cart items of specific cart

# 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"
      }
    },
    "requestBodies": {
      "CreateSubResAppMetafieldBody": {
        "description": "Payload for creating app metafield",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "key": {
                  "$ref": "#/components/schemas/AppMetafieldValue/properties/key"
                },
                "field_type": {
                  "$ref": "#/components/schemas/AppMetafieldValue/properties/field_type"
                },
                "field_value": {
                  "$ref": "#/components/schemas/AppMetafieldValue/properties/field_value"
                },
                "resource_id": {
                  "$ref": "#/components/schemas/AppMetafieldValue/properties/resource_id"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "AppMetafieldValue": {
        "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"
          },
          "application_id": {
            "description": "Application ID",
            "type": "string",
            "example": "65f90df935bfdf37a27cfb40"
          }
        },
        "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": "app",
          "resource_id": "62f9f0c76f4ae6001e4b00f2",
          "application_id": "65f90df935bfdf37a27cfb40"
        }
      }
    }
  },
  "paths": {
    "/carts/{cart_id}/items/app_metafields/bulk": {
      "post": {
        "summary": "Bulk create app metafield",
        "description": "To create app metafield attached to cart items of specific cart",
        "parameters": [
          {
            "name": "cart_id",
            "description": "Cart ID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "123456"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/requestBodies/CreateSubResAppMetafieldBody/content/application~1json/schema"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Cart Item App Metafields"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AppMetafieldValue"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Cart Item App Metafields",
      "description": "Operations about cart item app metafield values"
    }
  ]
}
```