Add order's metafields
const url = 'https://acme.mykreezalid.com/api/v1/orders/1/metafields';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"namespace":"erp","title":"invoice_number","value":"INV-2026-0042"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://acme.mykreezalid.com/api/v1/orders/1/metafields \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "namespace": "erp", "title": "invoice_number", "value": "INV-2026-0042" }'Adds one metafield, or several when you send an array of them. A metafield with the same namespace and title as an existing one of this order replaces its value. The metafield may also be wrapped in a metafield key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of your order
Request Bodyrequired
Section titled “Request Bodyrequired”A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
Example
{ "namespace": "erp", "title": "invoice_number", "value": "INV-2026-0042"}Responses
Section titled “Responses”The saved metafields: under metafield (a list of one) when you sent one metafield, under metafields when you sent an array
object
A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
Example
{ "metafield": [ { "namespace": "erp", "title": "warehouse_code", "value": "WH-42" } ], "metafields": [ { "namespace": "erp", "title": "warehouse_code", "value": "WH-42" } ]}No order has this identifier.
The body is not a metafield or a list of metafields, or namespace, title or value is missing or empty.