Metafields
Get Cart Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/carts/{cart_id}/metafieldsRequest
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- cart_id in path - stringrequiredThe ID of the
Cart
to which the transactions belong. - Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- page in query - integer
Specifies the page number in a limited (paginated) list of products.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of products.
- key in query - stringFilter based on a metafieldʼs key.
- namespace in query - stringFilter based on a metafieldʼs namespaces.
- direction in query - string
Sort direction. Acceptable values are:
asc
,desc
.Allowed: asc | desc
example
Response
An array of metafields and metadata.
Body
Response payload for the BigCommerce API.
dataobject
Allows app partners to write custom data to various resources in the 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 header
Parameters
- store_hash in path - string
- cart_id in path - stringrequiredThe ID of the
Cart
to which the transactions belong. - Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- Content-Type in header with default of application/json - stringrequired
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.
dataobject
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
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- cart_id in path - stringrequiredThe ID of the
Cart
to which the transactions belong. - metafield_id in path - integerrequiredThe unique ID of the subject
Metafield
. - page in query - integer
Specifies the page number in a limited (paginated) list of products.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of products.
- key in query - stringFilter based on a metafieldʼs key.
- namespace in query - stringFilter based on a metafieldʼs namespaces.
- direction in query - string
Sort direction. Acceptable values are:
asc
,desc
.Allowed: asc | desc
example
Response
A Metafield
object.
Body
Response payload for the BigCommerce API.
dataobject
Allows app partners to write custom data to various resources in the 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 header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- cart_id in path - stringrequiredThe ID of the
Cart
to which the transactions belong. - metafield_id in path - integerrequiredThe unique ID of the subject
Metafield
. - Content-Type in header with default of application/json - stringrequired
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.
dataobject
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 header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- cart_id in path - stringrequiredThe ID of the
Cart
to which the transactions belong. - metafield_id in path - integerrequiredThe unique ID of the subject
Metafield
.
example
Response
An empty response.