BigCommerce
Management API
Metafields

Locations

Get Metafields

GET /inventory/locations/{location_id}/metafields

Request

Retrieve metafields for a location.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    Unique identifier for a location.

example

Response

The request has been successfully processed.

Body

object | application/json
  • data
    array[object]

  • meta
    object

Create a Metafield

POST /inventory/locations/{location_id}/metafields

Request

Create a location metafield.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    Unique identifier for a location.

  • Content-Type in header with default of application/json - string
    required

    The MIME type of the request body.

Body

object | application/json

Common metafield properties.

  • key
    string

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

    >= 1 characters<= 64 characters

    Example: status

  • value
    string

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

    >= 1 characters<= 65535 characters

    Example: upcoming

  • namespace
    string

    Namespace for the metafield, for organizational purposes.

    >= 1 characters<= 64 characters

    Example: headquarters

  • permission_set
    string

    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 the storefront.
    write_and_sf_accessOpen for reading and writing by other API consumers, including on the storefront.

    Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access

  • description
    string

    Description for the metafields.

    >= 0 characters<= 255 characters

example

Response

The request has been successfully processed.

Body

object | application/json
  • data

    Allows app partners to write custom data to various resources in the API.

  • meta
    object

Get a Metafield

GET /inventory/locations/{location_id}/metafields/{metafield_id}

Request

Get a metafield by location.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    Unique identifier for a location.

  • metafield_id in path - integer
    required

    Unique identifier for a metafield.

example

Response

The request has been successfully processed.

Body

object | application/json
  • data

    Allows app partners to write custom data to various resources in the API.

  • meta
    object

Update a Metafield

PUT /inventory/locations/{location_id}/metafields/{metafield_id}

Request

Update a metafield.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    Unique identifier for a location.

  • metafield_id in path - integer
    required

    Unique identifier for a metafield.

Body

object | application/json

Common metafield properties.

  • key
    string

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

    >= 1 characters<= 64 characters

    Example: status

  • value
    string

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

    >= 1 characters<= 65535 characters

    Example: upcoming

  • namespace
    string

    Namespace for the metafield, for organizational purposes.

    >= 1 characters<= 64 characters

    Example: headquarters

  • permission_set
    string

    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 the storefront.
    write_and_sf_accessOpen for reading and writing by other API consumers, including on the storefront.

    Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access

  • description
    string

    Description for the metafields.

    >= 0 characters<= 255 characters

example

Response

The request has been successfully processed.

Body

object | application/json
  • data

    Allows app partners to write custom data to various resources in the API.

  • meta
    object

Delete a Metafield

DELETE /inventory/locations/{location_id}/metafields/{metafield_id}

Request

Delete a metafield.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    Unique identifier for a location.

  • metafield_id in path - integer
    required

    Unique identifier for a metafield.

example

Response

No Content

Did you find what you were looking for?