Docs
Management API
Metafields

Metafields

Get Order Metafields

GET /orders/{order_id}/metafields

Request

Gets a Metafield object list, by order_id.

The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

example

Response

An array of metafields and metadata.

Body

object | application/json

Response payload for the BigCommerce API.

  • data
    array[]

  • meta
    object

    Data about the response, including pagination and collection totals.

Create Metafields

POST /orders/{order_id}/metafields

Request

Creates an order Metafield.

The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

A Metafield object.

Body

object | application/json

Common Metafield properties.

  • permission_set
    string
    required

    Determines the visibility and writeability of the field by other API consumers.

    ValueDescription
    app_onlyPrivate to the app that owns the field
    readVisible to other API consumers
    writeOpen for reading and writing by other API consumers
    read_and_sf_accessVisible to other API consumers, including on storefront
    write_and_sf_accessOpen for reading and writing by other API consumers, including on storefront

    Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access

  • namespace
    string
    required

    Namespace for the metafield, for organizational purposes.

    >= 1 characters<= 64 characters
    Example: Sales Department
  • key
    string
    required

    The name of the field, for example: location_id, color.

    >= 1 characters<= 64 characters
    Example: Staff Name
  • value
    string
    required

    The value of the field, for example: 1, blue.

    >= 1 characters<= 65535 characters
    Example: Ronaldo
  • description
    string

    Description for the metafields.

    >= 0 characters<= 255 characters
    Example: Name of Staff Member

example

Response

A Metafield object.

Body

application/json

Response payload for the BigCommerce API.

example

Get a Metafield

GET /orders/{order_id}/metafields/{metafield_id}

Request

Gets a Metafield, by order_id.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • metafield_id in path - integer
    required

    The ID of the Metafield.

example

Response

A Metafield object.

Body

application/json

Response payload for the BigCommerce API.

example

Update a Metafield

PUT /orders/{order_id}/metafields/{metafield_id}

Request

Updates a Metafield object.

The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • metafield_id in path - integer
    required

    The ID of the Metafield.

A Metafield object.

Body

application/json

The model for a PUT to update metafield.

example

Response

A metafield and metadata.

Body

application/json

Response payload for the BigCommerce API.

example

Delete a Metafield

DELETE /orders/{order_id}/metafields/{metafield_id}

Request

Deletes a Metafield.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • metafield_id in path - integer
    required

    The ID of the Metafield.

example

Response

An empty response.

Did you find what you were looking for?