Metafields
Get Order Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/orders/{order_id}/metafieldsRequest
Gets a Metafield
object list, by order_id
.
The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client 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.
- order_id in path - integerrequired
The ID of the
Order
to which the transactions belong. - 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 - string
Filter based on a metafieldʼs key.
- namespace in query - string
Filter based on a metafieldʼs key.
- 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.
dataarray[object]
Create Metafields
POST https://api.bigcommerce.com/stores/{store_hash}/v3/orders/{order_id}/metafieldsRequest
Creates an order Metafield
.
The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client 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.
- order_id in path - integerrequired
The ID of the
Order
to which the transactions belong. - Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
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
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 Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v3/orders/{order_id}/metafields/{metafield_id}Request
Gets a Metafield
, by order_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.
- order_id in path - integerrequired
The ID of the
Order
to which the transactions belong. - metafield_id in path - integerrequired
The ID of the
Metafield
.
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 Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/orders/{order_id}/metafields/{metafield_id}Request
Updates a Metafield
object.
The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client 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.
- order_id in path - integerrequired
The ID of the
Order
to which the transactions belong. - metafield_id in path - integerrequired
The ID of the
Metafield
. - Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
A Metafield
object.
Body
The model for a PUT to update metafield.
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 and metadata.
Body
Response payload for the BigCommerce API.
dataobject
Allows app partners to write custom data to various resources in the API.
example
Delete a Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/orders/{order_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.
- order_id in path - integerrequired
The ID of the
Order
to which the transactions belong. - metafield_id in path - integerrequired
The ID of the
Metafield
.
example
Response
An empty response.