Metafields
Get Customer Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/customers/{customerId}/metafieldsRequest
Gets customer metafields by passing the customerId
in the query parameters.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
Body
Common metafield properties.
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Departmentkeystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Namevaluestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldodescriptionstring
required>= 0 characters<= 255 charactersDescription for the metafields.
Example: orderresource_typestring
requiredThe type of resource with which the metafield is associated.
Allowed: brand | product | variant | category | cart | channel | location | order | customer
Example: cartresource_idinteger
requiredread-onlyThe unique identifier for the resource with which the metafield is associated.
Example: 424242idinteger
requiredThe unique identifier for the metafield.
date_createdstring
requiredDate and time of the metafieldʼs creation.
Example: 2022-06-16T18:39:00+00:00date_modifiedstring
requiredDate and time when the metafield was last updated.
Example: 2022-06-16T18:39:00+00:00owner_client_idstring
read-onlyClient ID for the metafieldʼs creator.
Example: ramciw4fnoz87it3ynjfif2zrkil5p
example
Response
Response payload for the BigCommerce API.
Body
dataarray[object]
example
Create Customer Metafields
POST https://api.bigcommerce.com/stores/{store_hash}/v3/customers/{customerId}/metafieldsRequest
Creates Customer metafields by passing the customerId
in the query parameters.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
Body
Common Metafield properties.
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Departmentkeystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Namevaluestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldodescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Name of Staff Member
example
Response
Response payload for the BigCommerce API.
Body
Response payload for the BigCommerce API.
dataarray[object]
errorsarray[]
Empty for 200 responses.
Example: []
example
Get Customer Metafields List
GET https://api.bigcommerce.com/stores/{store_hash}/v3/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 headerrequired
Parameters
- store_hash in path - string
- customerId in path - integerrequired
The ID that belongs to the customer.
- metafieldId in path - integerrequired
The ID that is generated for a metafield when created.
Body
Common metafield properties.
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Departmentkeystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Namevaluestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldodescriptionstring
required>= 0 characters<= 255 charactersDescription for the metafields.
Example: orderresource_typestring
requiredThe type of resource with which the metafield is associated.
Allowed: brand | product | variant | category | cart | channel | location | order | customer
Example: cartresource_idinteger
requiredread-onlyThe unique identifier for the resource with which the metafield is associated.
Example: 424242idinteger
requiredThe unique identifier for the metafield.
date_createdstring
requiredDate and time of the metafieldʼs creation.
Example: 2022-06-16T18:39:00+00:00date_modifiedstring
requiredDate and time when the metafield was last updated.
Example: 2022-06-16T18:39:00+00:00owner_client_idstring
read-onlyClient ID for the metafieldʼs creator.
Example: ramciw4fnoz87it3ynjfif2zrkil5p
example
Response
Response payload for the BigCommerce API.
Body
dataarray[object]
example
Update a Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/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 headerrequired
Parameters
- store_hash in path - string
- metafieldId in query - integer
The ID that is generated for a metafield when created.
Body
example
Response
Response payload for the BigCommerce API.
Body
Response payload for the BigCommerce API.
dataarray[object]
errorsarray[]
Empty for 200 responses.
Example: []
example
Delete Customer Metafields
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/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 headerrequired
Parameters
- store_hash in path - string
Body
example
Response
Response object for customer metafields deletion with success.