Create Metafield
POST https://api.ecartapi.com/api/v2/metafields
Please note that all Metafield Definitions you create through our metafields resource will have the access type of MERCHANTREADWRITE. For more information, visit this link.
Make sure that your integration has the readcontent and writecontent access scopes to be able to create Metafield Definitions.
Properties
Properties | Description |
---|---|
name | The human-readable name for the metafield definition. |
namespace | The container for a group of metafields that the metafield definition will be associated with. Must be 3-255 characters long and only contain alphanumeric, hyphen, and underscore characters. |
key | The unique identifier for the metafield definition within its namespace. Must be 3-64 characters long and only contain alphanumeric, hyphen, and underscore characters. |
description | The description for the metafield definition. |
type | The type of data that each of the metafields that belong to the metafield definition will store. Refer to the list of supported types. |
ownerType | The resource type that the metafield definition is attached to. |
Request Body
{"metafield"=>{"name"=>"special note", "namespace"=>"orderControl", "key"=>"testing", "description"=>"metafield test for order resource", "type"=>"multi_line_text_field", "ownerType"=>"order"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string |
RESPONSES
status: OK
{"success":true,"metafield":{"id":"34854240425","description":"metafield test for order resource","key":"testing","name":"special note","ownerType":null,"namespace":"app--9176940545--orderControl","type":null}}