Create Metafield Definition
Definitions
Create Metafield Definition
Create a new metafield definition. Admin API only.
POST
Create Metafield Definition
Documentation Index
Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt
Use this file to discover all available pages before exploring further.
Create Metafield Definition
Creates the schema (type + validations + label) for a metafield. Once a definition exists, all writes to(ownerType, namespace, key) are
validated against it.
Request
Auth
Merchant JWT (MERCHANT, STAFF_ADMIN, SUPER_ADMIN, MANAGER).
Body parameters
Namespace (e.g.
custom, your app handle, or anything else).Machine name. Unique per
(storeId, ownerType, namespace).Human label shown in the admin UI.
One of the 22 supported types.
One of the 9 owner types.
Tooltip / helper text shown in admin.
Type-dependent validation rules. See
validation rules per type.
If true, the field appears on the resource detail page in admin without
the merchant having to click “Add custom data”.
Examples
Number with bounds
Single-line text with regex
List of references
URL with restricted schemes
Response
Error codes
| Code | Description |
|---|---|
UNAUTHORIZED | Invalid or missing JWT |
FORBIDDEN | Wrong store / insufficient role |
VALIDATION_ERROR | Invalid type, owner type, or validation key |
DUPLICATE_KEY | A definition with this (ownerType, namespace, key) already exists |