Metafields
Get Customer Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/customers/{customerId}/metafieldsRequest
customerId
in the query parameters.Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- customerId in path - integerrequiredThe ID of the customer.
example
Response
Body
itemsobject
example
Create Customer Metafields
POST https://api.bigcommerce.com/stores/{store_hash}/v3/customers/{customerId}/metafieldsRequest
customerId
in the query parameters.Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- customerId in path - integerrequiredThe ID of the customer.
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
Body
dataarray[object]
errorsarray[]
Empty for 200 responses.Example: []
example
Get a Customer Metafield
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 header
Parameters
- store_hash in path - string
- customerId in path - integerrequiredThe ID that belongs to the customer.
- metafieldId in path - integerrequiredThe ID that is generated for a metafield when created.
example
Response
Body
itemsobject
example
Update a Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/customers/{customerId}/metafields/{metafieldId}Request
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- metafieldId in path - integerrequiredThe 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 - integerrequiredThe ID of the customer.
Body
Common Metafield properties.
namespacestring
>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Departmentkeystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Namevaluestring
>= 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 Memberidinteger
requiredThe ID of metafield to update.
Example: 42
example
Response
Body
dataarray[object]
errorsarray[]
Empty for 200 responses.Example: []
example
Delete a Customer Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/customers/{customerId}/metafields/{metafieldId}Request
Deletes a customer metafield. To delete a customer metafield, use 'customerId' and 'metafieldId' in the query parameters.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- customerId in path - integerrequiredThe ID of the customer.
- metafieldId in path - integerrequiredThe 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.
example
Response
Response object for customer metafields deletion with success.