Metafield Definitions

Create specific metafield definition

Changed on

To create metafield definition attached to customers

post/metafield_definitions/customers

Request

  • Base URL
    https://open.shopline.io/v1
  • URL
    https://open.shopline.io/v1/metafield_definitions/customers
  • Auth
    HTTP bearer

Request body

namespaceNamespace (unresolved $ref)
keyKey (unresolved $ref)
nameName (unresolved $ref)
descriptionDescription (unresolved $ref)
field_typeFieldType (unresolved $ref)

Response

OK

idstring

Metafield definition ID

namespaceNamespace (unresolved $ref)
keyKey (unresolved $ref)
namestring

Name

descriptionstring

description

field_typeFieldType (unresolved $ref)
merchant_idstring

Merchant ID

resource_type'product' | 'merchant' | 'customer' | 'order' | 'order_item' | 'cart_item'

Resource type of the metafield definition

metafield_type'merchant' | 'app'

Type of metafield definition

created_atstring
updated_atstring

Example response

{
  "id": "5ad86757e38809441400001b",
  "namespace": "sales",
  "key": "discount",
  "name": "Sale discount",
  "description": "Discount percentage on a sale product",
  "field_type": "number_integer",
  "merchant_id": "61245ba9a6e4e8001c46d6ec",
  "resource_type": "product",
  "metafield_type": "merchant",
  "created_at": "2021-12-01T03:12:11.666+00:00",
  "updated_at": "2021-12-02T09:35:12.555+00:00"
}

Changes