| Attribute | Format | Length | Required | Description | Example |
| owner_type | String | N/A | Yes | The type of object that owns the metafield. Acceptable values include
Shopper | Shopper |
| owner_ref | String (format depends on type) | N/A | Yes | A unique identifier for the owner. The format depends on the
owner_type. | sh-1234 |
| namespace | String | N/A | Yes | A grouping for the metafield. Typically custom for
user-defined fields. | custom |
| key | String | N/A | Yes | A unique identifier for the metafield within its namespace. It should be unique per owner and namespace. | favorite_color |
| is_list | Boolean [true|false] | N/A | Yes | Indicates whether the metafield contains a list of values. Acceptable
values are true or false. | false |
| value_type | String | N/A | Yes | The data type of the metafield value. Acceptable values include
single_line_text_field, boolean,
date, etc. | single_line_text_field |
| value | Depends on value_type | N/A | Yes | The actual value of the metafield. Accepted values depend on the
selected value_type. | Blue |
| active | Boolean [true|false] | N/A | Yes | Defines whether the metafield should be active. When set to
false, the metafield should be removed. | true |
Owner Type
Theowner_type field defines which BSPK object the metafield belongs to. Available options:
-
Shopper
Owner Reference
Theowner_ref must match an existing object in BSPK for the provided owner_type. Its format may vary depending on the type of owner.
Namespace and Key
The combination ofnamespace and key identifies the metafield definition within a given owner.
For example:
namespace:customkey:favorite_color
List Values
Whenis_list is set to true, the metafield value is expected to represent a list of values instead of a single value.
When is_list is set to false, the metafield value is treated as a single value.
Value Type
Thevalue_type determines how the value field is interpreted. Examples include:
-
single_line_text_field -
boolean -
date
value must be compatible with the selected value_type.
Active
Theactive field controls whether the metafield should exist in BSPK.
- When
true, the metafield is created or updated - When
false, the metafield is removed
