Skip to content

Add or update listing metafields

POST
/listings/{id}/metafields
curl --request POST \
--url https://acme.mykreezalid.com/api/v1/listings/1/metafields \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "namespace": "erp", "title": "warehouse_code", "value": "WH-42" }'

Attaches one metafield, or an array of metafields, to a listing. A metafield with the same namespace and title as an existing one replaces its value. You can also wrap the body in a metafield key. When you send one metafield the response key is metafield; when you send an array it is metafields. Both hold an array.

id
required
integer

ID of your listing

Media typeapplication/json
One of:

A custom value you attach to a resource, identified by its namespace and title.

object
namespace
required

Group the metafield belongs to

string

Example

erp
title
required

Name of the metafield, unique within its namespace

string

Example

warehouse_code
value
required

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.

string

Example

WH-42

The saved metafields

Media typeapplication/json
object
metafield

When you sent one metafield

Array<object>

A custom value you attach to a resource, identified by its namespace and title.

object
namespace
required

Group the metafield belongs to

string
title
required

Name of the metafield, unique within its namespace

string
value
required

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.

string
metafields

When you sent an array

Array<object>

A custom value you attach to a resource, identified by its namespace and title.

object
namespace
required

Group the metafield belongs to

string
title
required

Name of the metafield, unique within its namespace

string
value
required

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.

string

Example

{
"metafield": [
{
"namespace": "erp",
"title": "warehouse_code",
"value": "WH-42"
}
],
"metafields": [
{
"namespace": "erp",
"title": "warehouse_code",
"value": "WH-42"
}
]
}

Missing or wrong API credentials

No listing has this identifier

The body is not valid JSON, or a metafield misses namespace, title or value