Metafields
Get Cart Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/carts/{cart_id}/metafieldsRequest
Get a cart's metafields.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
example
Response
An array of metafields and metadata.
Body
Response payload for the BigCommerce API.
example
Create a Cart Metafield
POST https://api.bigcommerce.com/stores/{store_hash}/v3/carts/{cart_id}/metafieldsRequest
Create a cart Metafield
.
If you create an order from a Cart, you can continue referencing the Cart Metafields even if you delete the original Cart. Use the cart_id
field on the Order to construct the Cart Metafield endpoint.
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
A Metafield
object.
Body
Response payload for the BigCommerce API.
data
Allows app partners to write custom data to various resources in the API.
example
Get a Cart Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v3/carts/{cart_id}/metafields/{metafield_id}Request
Gets a cart metafield.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- metafield_id in path - integerrequired
The unique ID of the subject
Metafield
.
example
Response
A Metafield
object.
Body
Response payload for the BigCommerce API.
example
Update a Cart Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/carts/{cart_id}/metafields/{metafield_id}Request
Update a Metafield
, by cart_id
.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- metafield_id in path - integerrequired
The unique ID of the subject
Metafield
.
A Metafield
object.
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
Response
A Metafield
and metadata.
Body
Response payload for the BigCommerce API.
data
Allows app partners to write custom data to various resources in the API.
Delete a Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/carts/{cart_id}/metafields/{metafield_id}Request
Deletes a Metafield
.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- metafield_id in path - integerrequired
The unique ID of the subject
Metafield
.
example
Response
An empty response.