Create a metafield definition
Creates a metafield definition: a custom field for one kind of record, such as a Product. The namespace, key and owner resource together must be unique in the company, and the namespace, key, value type, owner resource and validation rules cannot be changed afterwards.
To make the field translatable, send "translatable": true with a Product, Variant or EnrollmentPack definition of a text, list of text or url type. The setting works only for companies with the translatable metafields feature turned on. For any other company the value is ignored and the request still returns 201, so check that translatable is true in the response. The translatable field below lists the rules.
Requires a company admin credential with the Developer update permission.
curl --request POST \
--url https://api.fluid.app/api/v2/metafield_definitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metafield_definition": {
"owner_resource": "Product",
"namespace": "custom",
"key": "tagline",
"name": "Tagline",
"value_type": "single_line_text_field",
"translatable": true
}
}
'{
"metafield_definition": {
"id": 4812,
"company_id": 1023,
"namespace": "custom",
"key": "tagline",
"name": "Tagline",
"description": null,
"value_type": "single_line_text_field",
"validation_rules": null,
"owner_resource": "Product",
"pinned": false,
"position": 5,
"locked": false,
"searchable": false,
"translatable": true,
"list_type": false,
"reference_type": false,
"supported_validations": [
"min",
"max",
"choices",
"regex"
],
"validation_description": "Single line text up to 5000 characters",
"category_ids": [],
"created_at": "2026-11-16T16:40:58Z",
"updated_at": "2026-11-16T16:40:58Z"
},
"meta": {
"request_id": "6ebde49d-d0ae-4e72-9547-4d1e65842045",
"timestamp": "2026-11-16T16:40:58Z"
}
}Body
curl --request POST \
--url https://api.fluid.app/api/v2/metafield_definitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metafield_definition": {
"owner_resource": "Product",
"namespace": "custom",
"key": "tagline",
"name": "Tagline",
"value_type": "single_line_text_field",
"translatable": true
}
}
'{
"metafield_definition": {
"id": 4812,
"company_id": 1023,
"namespace": "custom",
"key": "tagline",
"name": "Tagline",
"description": null,
"value_type": "single_line_text_field",
"validation_rules": null,
"owner_resource": "Product",
"pinned": false,
"position": 5,
"locked": false,
"searchable": false,
"translatable": true,
"list_type": false,
"reference_type": false,
"supported_validations": [
"min",
"max",
"choices",
"regex"
],
"validation_description": "Single line text up to 5000 characters",
"category_ids": [],
"created_at": "2026-11-16T16:40:58Z",
"updated_at": "2026-11-16T16:40:58Z"
},
"meta": {
"request_id": "6ebde49d-d0ae-4e72-9547-4d1e65842045",
"timestamp": "2026-11-16T16:40:58Z"
}
}