post
https://{subdomain}.myshoplaza.com/openapi/2025-06/metafield_definition/
Create a new metafield definition.
The Create Metafield Definition API allows developers to create a new metafield definition for a specified owner resource.
This API is especially useful for:
- Defining custom fields to extend resource attributes (e.g., products, orders).
- Standardizing metadata schemas across your store.
- Enabling structured data storage for third-party integrations.
Request Parameters
Public Request Parameters
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| string | Yes | Type of resource the metafield definition belongs to. Valid values: |
|
Body Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
namespace | string | Yes | Grouping identifier for metafields | "inventory" |
key | string | Yes | Unique key for the metafield | "warehouse_location" |
name | string | Yes | Human-readable name | "Warehouse Location" |
type | string | Yes | Data type of the metafield. Valid values: date, date_time, weight, volume, dimension, integer, number_decimal, file_reference, single_line_text_field, multi_line_text_field, json, color, rating, url, boolean. | "single_line_text_field" |
description | string | No | Detailed explanation of the field | "Stores warehouse bin ID" |
Response Explanation
Public Response Parameters
Successful Response
| Parameter | Type | Example | Description |
|---|---|---|---|
code | string | "success" | Status code of the operation |
message | string | Human-readable result message | |
data.metafield_definition | object | {...} | The created metafield definition object |
data.metafield_definition.id | string | "mfd_67890" | Unique identifier of the definition |
data.metafield_definition.key | string | "warehouse_location" | Metafield key |
data.metafield_definition.name | string | "Warehouse Location" | Display name |
data.metafield_definition.namespace | string | "inventory" | Namespace grouping |
data.metafield_definition.owner_resource | string | "products" | Associated resource type |
data.metafield_definition.type | string | "single_line_text_field" | Data type of the metafield |
data.metafield_definition.description | string | "Stores warehouse bin ID" | Field purpose explanation |
data.metafield_definition.created_at | string | "2025-06-01T12:00:00Z" | Creation timestamp (ISO 8601) |
data.metafield_definition.updated_at | string | "2025-06-01T12:00:00Z" | Last update timestamp (ISO 8601) |
Error Response
| Field | Type | Example | Description |
|---|---|---|---|
code | string | InvalidParameter | Error http message |
message | string | `` | Error message |
