Customers V3
Get Customer Metafields
GET /stores/{store_hash}/v3/customers/{customerId}/metafields
Request
Gets customer metafields by passing the customerId
in the query parameters.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- customerId in path - integerrequired
The ID of the customer.
Body
Common metafield properties.
permission_setstring
requiredDetermines the visibility and writeability of the field by other API consumers.
Value Description app_only
Private to the app that owns the field. read
Visible to other API consumers. write
Open for reading and writing by other API consumers. read_and_sf_access
Visible to other API consumers, including on storefront. write_and_sf_access
Open for reading and writing by other API consumers, including on storefront. Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Department
keystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Name
valuestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldo
descriptionstring
required>= 0 characters<= 255 charactersDescription for the metafields.
Example: order
resource_typestring
requiredThe type of resource with which the metafield is associated.
Allowed: brand | product | variant | category | cart | channel | location | order | customer
Example: cart
resource_idinteger
requiredread-onlyThe unique identifier for the resource with which the metafield is associated.
Example: 424242
idinteger
requiredThe unique identifier for the metafield.
date_createdstring
requiredDate and time of the metafieldʼs creation.
Example: 2022-06-16T18:39:00+00:00
date_modifiedstring
requiredDate and time when the metafield was last updated.
Example: 2022-06-16T18:39:00+00:00
owner_client_idstring
read-onlyClient ID for the metafieldʼs creator.
Example: ramciw4fnoz87it3ynjfif2zrkil5p
example
example
Response
Response payload for the BigCommerce API.
Body
dataarray[]
idinteger
requiredread-onlyUnique ID of the Metafield. Read-Only.
Example: 0
keystring
requiredThe key for the metafields.
Example: Staff Name
valuestring
requiredThe description for the metafield.
Example: Ronaldo
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Department
permission_setstring
requiredDetermines the visibility and writeability of the field by other API consumers.
Value Description app_only
Private to the app that owns the field. read
Visible to other API consumers. write
Open for reading and writing by other API consumers. read_and_sf_access
Visible to other API consumers, including on storefront. write_and_sf_access
Open for reading and writing by other API consumers, including on storefront. Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access
resource_typestring
requiredThe type of resource with which the metafield is associated.
Allowed: brand | product | variant | category | cart | channel | location | order | customer
Example: cart
resource_idinteger
requiredread-onlyThe unique identifier for the resource with which the metafield is associated.
Example: 0
descriptionstring
requiredDescription for the metafields.
Example: order
date_createdstring
requiredDate and time of the metafieldʼs creation.
Example: 2022-06-16T18:39:00+00:00
date_modifiedstring
requiredDate and time when the metafield was last updated.
Example: 2022-06-16T18:39:00+00:00
owner_client_idstring
read-onlyClient ID for the metafield's creator.
Example: ramciw4fnoz87it3ynjfif2zrkil5p
example
Create Customer Metafields
POST /stores/{store_hash}/v3/customers/{customerId}/metafields
Request
Creates Customer metafields by passing the customerId
in the query parameters.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- customerId in path - integerrequired
The ID of the customer.
Body
Common Metafield properties.
permission_setstring
requiredDetermines the visibility and writeability of the field by other API consumers.
Value Description app_only
Private to the app that owns the field. read
Visible to other API consumers. write
Open for reading and writing by other API consumers. read_and_sf_access
Visible to other API consumers, including on the storefront. write_and_sf_access
Open 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
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Department
keystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Name
valuestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldo
descriptionstring
>= 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: []
metaobject
Data about the response, including pagination and collection totals.
example
Get Customer Metafields List
GET /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.
permission_setstring
requiredDetermines the visibility and writeability of the field by other API consumers.
Value Description app_only
Private to the app that owns the field. read
Visible to other API consumers. write
Open for reading and writing by other API consumers. read_and_sf_access
Visible to other API consumers, including on storefront. write_and_sf_access
Open for reading and writing by other API consumers, including on storefront. Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Department
keystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Name
valuestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldo
descriptionstring
required>= 0 characters<= 255 charactersDescription for the metafields.
Example: order
resource_typestring
requiredThe type of resource with which the metafield is associated.
Allowed: brand | product | variant | category | cart | channel | location | order | customer
Example: cart
resource_idinteger
requiredread-onlyThe unique identifier for the resource with which the metafield is associated.
Example: 424242
idinteger
requiredThe unique identifier for the metafield.
date_createdstring
requiredDate and time of the metafieldʼs creation.
Example: 2022-06-16T18:39:00+00:00
date_modifiedstring
requiredDate and time when the metafield was last updated.
Example: 2022-06-16T18:39:00+00:00
owner_client_idstring
read-onlyClient ID for the metafieldʼs creator.
Example: ramciw4fnoz87it3ynjfif2zrkil5p
example
example
Response
Response payload for the BigCommerce API.
Body
dataarray[]
idinteger
requiredread-onlyUnique ID of the Metafield. Read-Only.
Example: 0
keystring
requiredThe key for the metafields.
Example: Staff Name
valuestring
requiredThe description for the metafield.
Example: Ronaldo
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Department
permission_setstring
requiredDetermines the visibility and writeability of the field by other API consumers.
Value Description app_only
Private to the app that owns the field. read
Visible to other API consumers. write
Open for reading and writing by other API consumers. read_and_sf_access
Visible to other API consumers, including on storefront. write_and_sf_access
Open for reading and writing by other API consumers, including on storefront. Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access
resource_typestring
requiredThe type of resource with which the metafield is associated.
Allowed: brand | product | variant | category | cart | channel | location | order | customer
Example: cart
resource_idinteger
requiredread-onlyThe unique identifier for the resource with which the metafield is associated.
Example: 0
descriptionstring
requiredDescription for the metafields.
Example: order
date_createdstring
requiredDate and time of the metafieldʼs creation.
Example: 2022-06-16T18:39:00+00:00
date_modifiedstring
requiredDate and time when the metafield was last updated.
Example: 2022-06-16T18:39:00+00:00
owner_client_idstring
read-onlyClient ID for the metafield's creator.
Example: ramciw4fnoz87it3ynjfif2zrkil5p
example
Update a Metafield
PUT /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.
- metafieldId in path - integerrequired
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 - integerrequired
The ID of the customer.
Body
permission_setstring
Determines the visibility and writeability of the field by other API consumers.
Value Description app_only
Private to the app that owns the field. read
Visible to other API consumers. write
Open for reading and writing by other API consumers. read_and_sf_access
Visible to other API consumers, including on the storefront. write_and_sf_access
Open 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
namespacestring
>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Department
keystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Name
valuestring
>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldo
descriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Name of Staff Member
idinteger
requiredThe ID of metafield to update.
Example: 42
example
Response
Response payload for the BigCommerce API.
Body
Response payload for the BigCommerce API.
dataarray[object]
errorsarray[]
Empty for 200 responses.
Example: []
metaobject
Data about the response, including pagination and collection totals.
example
Delete Customer Metafields
DELETE /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
- customerId in path - integerrequired
The ID of the customer.
- metafieldId in path - integerrequired
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
example
example
Response
Response object for customer metafields deletion with success.