Docs
Management API
Metafields

Metafields

Get Customer Metafields

GET /customers/{customerId}/metafields

Request

Gets customer metafields by passing the customerId in the query parameters.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    The ID of the customer.

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
    required

    Description for the metafields.

    >= 0 characters<= 255 characters

    Example: order

  • resource_type
    string
    required

    The type of resource with which the metafield is associated.

    Allowed: brand | product | variant | category | cart | channel | location | order | customer

    Example: cart

  • resource_id
    integer
    required
    read-only

    The unique identifier for the resource with which the metafield is associated.

    Example: 424242

  • id
    integer
    required

    The unique identifier for the metafield.

  • date_created
    string
    required

    Date and time of the metafieldʼs creation.

    Example: 2022-06-16T18:39:00+00:00

  • date_modified
    string
    required

    Date and time when the metafield was last updated.

    Example: 2022-06-16T18:39:00+00:00

  • owner_client_id
    string
    read-only

    Client ID for the metafieldʼs creator.

    Example: ramciw4fnoz87it3ynjfif2zrkil5p

example

example

Response

Response payload for the BigCommerce API.

Body

object | application/json
  • data
    array[object]

example

Create Customer Metafields

POST /customers/{customerId}/metafields

Request

Creates Customer metafields by passing the customerId in the query parameters.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    The ID of the customer.

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 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

  • 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

Response payload for the BigCommerce API.

Body

object | application/json

Response payload for the BigCommerce API.

  • data
    array[object]

  • errors
    array[]

    Empty for 200 responses.

    Example: []

  • meta
    object

    Data about the response, including pagination and collection totals.

example

Get Customer Metafields List

GET /customers/{customerId}/metafields/{metafieldId}

Request

Lists available metafields for a customer. To retrieve the list, use customerId and metafieldId in the query parameters.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    The ID that belongs to the customer.

  • metafieldId in path - integer
    required

    The ID that is generated for a metafield when created.

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
    required

    Description for the metafields.

    >= 0 characters<= 255 characters

    Example: order

  • resource_type
    string
    required

    The type of resource with which the metafield is associated.

    Allowed: brand | product | variant | category | cart | channel | location | order | customer

    Example: cart

  • resource_id
    integer
    required
    read-only

    The unique identifier for the resource with which the metafield is associated.

    Example: 424242

  • id
    integer
    required

    The unique identifier for the metafield.

  • date_created
    string
    required

    Date and time of the metafieldʼs creation.

    Example: 2022-06-16T18:39:00+00:00

  • date_modified
    string
    required

    Date and time when the metafield was last updated.

    Example: 2022-06-16T18:39:00+00:00

  • owner_client_id
    string
    read-only

    Client ID for the metafieldʼs creator.

    Example: ramciw4fnoz87it3ynjfif2zrkil5p

example

example

Response

Response payload for the BigCommerce API.

Body

object | application/json
  • data
    array[object]

example

Update a Metafield

PUT /customers/{customerId}/metafields/{metafieldId}

Request

Updates customer metafields. To update the customer metafields, use 'customerId' and 'metafield' in the query parameters.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • metafieldId in query - integer

    The ID that is generated for a metafield when created.

  • metafieldId in path - integer
    required

    The ID of the metafield belonging to the customer. The metafieldId is a generated response when sending a POST query to the Create a Customer Metafields endpoint.

  • customerId in path - integer
    required

    The ID of the customer.

Body

array | application/json
  • 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

  • namespace
    string

    Namespace for the metafield, for organizational purposes.

    >= 1 characters<= 64 characters

    Example: Sales Department

  • key
    string

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

    >= 1 characters<= 64 characters

    Example: Staff Name

  • value
    string

    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

  • id
    integer
    required

    The ID of metafield to update.

    Example: 42

  • 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

  • namespace
    string

    Namespace for the metafield, for organizational purposes.

    >= 1 characters<= 64 characters

    Example: Sales Department

  • key
    string

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

    >= 1 characters<= 64 characters

    Example: Staff Name

  • value
    string

    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

  • id
    integer
    required

    The ID of metafield to update.

    Example: 42

example

Response

Response payload for the BigCommerce API.

Body

object | application/json

Response payload for the BigCommerce API.

  • data
    array[object]

  • errors
    array[]

    Empty for 200 responses.

    Example: []

  • meta
    object

    Data about the response, including pagination and collection totals.

example

Delete Customer Metafields

DELETE /customers/{customerId}/metafields/{metafieldId}

Request

Deletes customer metafields. To delete customer metafields, use 'customerId' and 'metafieldId' in the query parameters.

Authentication

  • X-Auth-Token in header
    required

Parameters

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

    The ID of the customer.

  • metafieldId in path - integer
    required

    The ID of the metafield belonging to the customer. The metafieldId is a generated response when sending a POST query to the Create a Customer Metafields endpoint.

Body

array | application/json

    example

    example

    Response

    Response object for customer metafields deletion with success.

    Did you find what you were looking for?