Skip to content

About Metafield Definition

Access scope

Multiple access scopes needed — refer to each endpoint for access scope requirements.

Meta Fields Definition is a fundamental service component of the Genstore platform, providing flexible business metadata management capabilities. Through the Meta Fields service, business systems can achieve dynamic field extension and data value management, ensuring business model scalability.

Core Functions

  • Meta Field Definition Management: Enable creation, update, deletion and query of meta fields, supporting field model extension across business domains.

Use Cases

  • Dynamic Field Extension: Business teams can add new properties to existing models through meta field definitions, enabling rapid business model iteration.

Meta Fields Definition Object

Meta Fields Definition Business Object.

Properties

metafieldobject
- Hide child properties
definitionNamestring
The name of the meta field.
codestring
The meta field uniquely identified and is unique in the same namespace.
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
descriptionstring
Description of the meta field.
optionMapstring
The meta-field extension configuration is used to store the extension information defined by the business on the field, such as whether to support search. The specific configuration is stored in Map format. The Map key is determined by the business provider during definition.
fieldTypestring
Meta field type. Different types of meta fields store metadata in different formats. Enumeration value:
* SingleLineText - single line text;
* MultiLineText - multiple lines of text;
* Integer - an integer;
* Decimal - decimal;
* MonthDay - month day;
* Date - Date, which is in ISO 8601 format and does not include a time zone.
* DateTime - Date and time, supporting date values in ISO 8601 format and time values in UTC time.
* Weight - weight;
* Size - the size;
* Volume - volume;
* Product - a product;
* Customer - a customer;
* SKU - Product specifications;
* Collection - a collection of goods;
* Page - page; File - file;
* Color - a color;
* Money - the amount of money;
* Url-url;
* Boolean - True or False.
multistring
Whether the meta-field supports multi-value lists. The meta-field control that supports multi-value lists allows users to enter multiple items. The meta-field data is stored in JSON Array format.
schemaRulestring
The meta field verification rule can limit the length and range of metadata input. If the value is empty, it indicates that the meta field is not verified. Check rules for different fields are different. For details, refer to the field Rules document.
pinnedboolean
The status of the meta field Pin can control its placement on the list.
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.
bash
{
  "metafield": {
    "pinned": "true",
    "definitionName": "MyFieldName01",
    "code": "MyFieldCode1",
    "namespace": "AppleName",
    "description": "this is meta field description sample",
    "optionMap": "{"search":true}",
    "fieldType": "Weight",
    "multi": "false",
    "schemaRule": "{"min":{"value":2,"unit":"g"},"max":{"value":200,"unit":"kg"}}",
    "isShow": "true"
  }
}

POST Create metafield definition

Create a metafield definition.

Access scope

Requires ANY of the following access scopes: write_metafields

Endpoint

POST /api/202412/metafields/definitions/{domainName} 

Request Params

definitionNamestring
The name of the metafield.
descriptionstring
Description of the metafield.
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The metafield uniquely identified and is unique in the same namespace.
fieldTypestring
Metafield type. Different types of metafields store metadata in different formats. Enumeration value:
* SingleLineText - single line text;
* MultiLineText - multiple lines of text;
* Integer - an integer;
* Decimal - decimal;
* MonthDay - month day;
* Date - Date, which is in ISO 8601 format and does not include a time zone.
* DateTime - Date and time, supporting date values in ISO 8601 format and time values in UTC time.
* Weight - weight;
* Size - the size;
* Volume - volume;
* Product - a product;
* Customer - a customer;
* SKU - Product specifications;
* Collection - a collection of goods;
* Page - page; File - file;
* Color - a color;
* Money - the amount of money;
* Url-url;
* Boolean - True or False.
multiboolean
Whether the metafield supports multi-value lists. The metafield control that supports multi-value lists allows users to enter multiple items. The metafield data is stored in JSON Array format.
schemaRuleobject
The metafield verification rule can limit the length and range of metadata input. If the value is empty, it indicates that the metafield is not verified. Check rules for different fields are different. For details, refer to the field Rules document.
optionMapobject
The metafield extension configuration is used to store the extension information defined by the business on the field, such as whether to support search. The specific configuration is stored in Map format. The Map key is determined by the business provider during definition.
pinnedboolean
The status of the meta field Pin can control its placement on the list.
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.

Response Data

metafieldobject
- Hide child properties
definitionNamestring
The name of the meta field.
descriptionstring
Description of the meta field.
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The meta field uniquely identified and is unique in the same namespace.
fieldTypestring
Meta field type. Different types of meta fields store metadata in different formats. Enumeration value:
* SingleLineText - single line text;
* MultiLineText - multiple lines of text;
* Integer - an integer;
* Decimal - decimal;
* MonthDay - month day;
* Date - Date, which is in ISO 8601 format and does not include a time zone.
* DateTime - Date and time, supporting date values in ISO 8601 format and time values in UTC time.
* Weight - weight;
* Size - the size;
* Volume - volume;
* Product - a product;
* Customer - a customer;
* SKU - Product specifications;
* Collection - a collection of goods;
* Page - page; File - file;
* Color - a color;
* Money - the amount of money;
* Url-url;
* Boolean - True or False.
multiboolean
Whether the meta-field supports multi-value lists. The meta-field control that supports multi-value lists allows users to enter multiple items. The meta-field data is stored in JSON Array format.
schemaRuleobject
The meta field verification rule can limit the length and range of metadata input. If the value is empty, it indicates that the meta field is not verified. Check rules for different fields are different. For details, refer to the field Rules document.
optionMapobject
The meta-field extension configuration is used to store the extension information defined by the business on the field, such as whether to support search. The specific configuration is stored in Map format. The Map key is determined by the business provider during definition.
pinnedboolean
The status of the meta field Pin can control its placement on the list.
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.
bash
curl -X POST \ 
https://{shop}.genmystore.com/api/202412/metafields/definitions/{domainName}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pinned":"true",
	"definitionName":"MyFieldName01",
	"code":"MyFieldCode1",
	"namespace":"AppleName",
	"description":"this is meta field description sample",
	"optionMap":"{\"search\":true}",
	"fieldType":"Weight",
	"multi":"false",
	"schemaRule":"{\"min\":{\"value\":2,\"unit\":\"g\"},\"max\":{\"value\":200,\"unit\":\"kg\"}}",
	"isShow":"true"
}'
json
HTTP/1.1 200 OK
{
  "metafield": {
    "pinned": "true",
    "definitionName": "MyFieldName01",
    "code": "MyFieldCode1",
    "namespace": "AppleName",
    "description": "this is meta field description sample",
    "optionMap": "{\"search\":true}",
    "fieldType": "Weight",
    "multi": "false",
    "schemaRule": "{\"min\":{\"value\":2,\"unit\":\"g\"},\"max\":{\"value\":200,\"unit\":\"kg\"}}",
    "isShow": "true"
  }
}

PUT Update metafield definition

Update metafield definition.

Access scope

Requires ANY of the following access scopes: write_metafields

Endpoint

PUT /api/202412/metafields/definitions/{domainName} 

Request Params

definitionNamestring
The name of the metafield.
descriptionstring
Description of the metafield.
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The meta field uniquely identified and is unique in the same namespace.
fieldTypestring
Metafield type. Different types of meta fields store metadata in different formats.
multiboolean
Whether the metafield supports multi-value lists. The metafield control that supports multi-value lists allows users to enter multiple items. The metafield data is stored in JSON Array format.
schemaRuleobject
The metafield verification rule can limit the length and range of metadata input. If the value is empty, it indicates that the meta field is not verified. Check rules for different fields are different. For details, refer to the field Rules document.
optionMapobject
The metafield extension configuration is used to store the extension information defined by the business on the field, such as whether to support search. The specific configuration is stored in Map format. The Map key is determined by the business provider during definition.
pinnedboolean
The status of the meta field Pin can control its placement on the list.
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.

Response Data

metafieldobject
+ Show child properties
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/metafields/definitions/{domainName}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pinned":"true",
	"definitionName":"MyFieldName01",
	"code":"MyFieldCode1",
	"namespace":"AppleName",
	"description":"this is meta field description sample",
	"optionMap":"{\"search\":true}",
	"fieldType":"Weight",
	"multi":"false",
	"schemaRule":"{\"min\":{\"value\":2,\"unit\":\"g\"},\"max\":{\"value\":200,\"unit\":\"kg\"}}",
	"isShow":"true"
}'
json
HTTP/1.1 200 OK
{
  "metafield": {
    "pinned": "true",
    "definitionName": "MyFieldName01",
    "code": "MyFieldCode1",
    "namespace": "AppleName",
    "description": "this is meta field description sample",
    "optionMap": "{\"search\":true}",
    "fieldType": "Weight",
    "multi": "false",
    "schemaRule": "{\"min\":{\"value\":2,\"unit\":\"g\"},\"max\":{\"value\":200,\"unit\":\"kg\"}}"
  },
  "isShow": "true"
}

DELETE Delete metafield definition

Delete metafield definition.

Access scope

Requires ANY of the following access scopes: write_metafields

Endpoint

DELETE /api/202412/metafields/definitions/{domainName} 

Request Params

namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The metafield uniquely identified and is unique in the same namespace.

Response Data

metafieldobject
- Hide child properties
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The meta field uniquely identified and is unique in the same namespace.
bash
curl -X DELETE \ 
https://{shop}.genmystore.com/api/202412/metafields/definitions/{domainName}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{
  "metafield": {
    "code": "MyFieldCode1",
    "namespace": "AppleName"
  }
}

GET Get metafield definition

Get detailed definition of the metafield.

Access scope

Requires ANY of the following access scopes: read_metafields write_metafields

Endpoint

GET /api/202412/metafields/definitions/detail/{domainName} 

Request Params

namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The unique code of the meta field in the namespace

Response Data

metafieldobject
- Hide child properties
namestring
The name of the meta field.
descriptionstring
Description of the meta field.
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The meta field uniquely identified and is unique in the same namespace.
fieldTypestring
Meta field type. Different types of meta fields store metadata in different formats. Enumeration value:
* SingleLineText - single line text;
* MultiLineText - multiple lines of text;
* Integer - an integer;
* Decimal - decimal;
* MonthDay - month day;
* Date - Date, which is in ISO 8601 format and does not include a time zone.
* DateTime - Date and time, supporting date values in ISO 8601 format and time values in UTC time.
* Weight - weight;
* Size - the size;
* Volume - volume;
* Product - a product;
* Customer - a customer;
* SKU - Product specifications;
* Collection - a collection of goods;
* Page - page; File - file;
* Color - a color;
* Money - the amount of money;
* Url-url;
* Boolean - True or False.
multiboolean
Whether the meta-field supports multi-value lists. The meta-field control that supports multi-value lists allows users to enter multiple items. The meta-field data is stored in JSON Array format.
schemaRuleobject
The meta field verification rule can limit the length and range of metadata input. If the value is empty, it indicates that the meta field is not verified. Check rules for different fields are different. For details, refer to the field Rules document.
optionMapobject
The meta-field extension configuration is used to store the extension information defined by the business on the field, such as whether to support search. The specific configuration is stored in Map format. The Map key is determined by the business provider during definition.
pinnedboolean
The status of the meta field Pin can control its placement on the list.
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.
bash
curl -X GET \ 
https://{shop}.genmystore.com/api/202412/metafields/definitions/detail/{domainName}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{
  "metafield": {
    "pinned": "true",
    "code": "MyFieldCode1",
    "name": "MyFieldName01",
    "namespace": "AppleName",
    "description": "this is meta field description sample",
    "optionMap": "{\"search\":true}",
    "fieldType": "Weight",
    "multi": "false",
    "schemaRule": "{\"min\":{\"value\":2,\"unit\":\"g\"},\"max\":{\"value\":200,\"unit\":\"kg\"}}",
    "isShow": "true"
  }
}

GET Get metafield definition list

Get metafield definition.

Access scope

Requires ANY of the following access scopes: read_metafields write_metafields

Endpoint

GET /api/202412/metafields/definitions/{domainName} 

Request Params

namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codesstring
The unique code of the meta field in the namespace, If multiple queries are to be queried, separate them using commas (,).
fieldTypestring
Meta field type. Different types of meta fields store metadata in different formats. Enumeration value:
* SingleLineText - single line text;
* MultiLineText - multiple lines of text;
* Integer - an integer;
* Decimal - decimal;
* MonthDay - month day;
* Date - Date, which is in ISO 8601 format and does not include a time zone.
* DateTime - Date and time, supporting date values in ISO 8601 format and time values in UTC time.
* Weight - weight;
* Size - the size;
* Volume - volume;
* Product - a product;
* Customer - a customer;
* SKU - Product specifications;
* Collection - a collection of goods;
* Page - page; File - file;
* Color - a color;
* Money - the amount of money;
* Url-url;
* Boolean - True or False.
limitnumber
The maximum number of results to show.
pageTokenstring
A unique ID used to access a certain page of results. The page_info parameter can't be modified and must be used exactly as it appears in the link header URL.

Response Data

metafieldsarray
- Hide child properties
definitionNamestring
The name of the meta field.
descriptionstring
Description of the meta field.
namespacestring
The business can uniquely identify the field code based on the field isolation namespace. The same field code can be created in different namespaces.
codestring
The meta field uniquely identified and is unique in the same namespace.
fieldTypestring
Meta field type. Different types of meta fields store metadata in different formats. Enumeration value:
* SingleLineText - single line text;
* MultiLineText - multiple lines of text;
* Integer - an integer;
* Decimal - decimal;
* MonthDay - month day;
* Date - Date, which is in ISO 8601 format and does not include a time zone.
* DateTime - Date and time, supporting date values in ISO 8601 format and time values in UTC time.
* Weight - weight;
* Size - the size;
* Volume - volume;
* Product - a product;
* Customer - a customer;
* SKU - Product specifications;
* Collection - a collection of goods;
* Page - page; File - file;
* Color - a color;
* Money - the amount of money;
* Url-url;
* Boolean - True or False.
multiboolean
Whether the meta-field supports multi-value lists. The meta-field control that supports multi-value lists allows users to enter multiple items. The meta-field data is stored in JSON Array format.
schemaRuleobject
The meta field verification rule can limit the length and range of metadata input. If the value is empty, it indicates that the meta field is not verified. Check rules for different fields are different. For details, refer to the field Rules document.
optionMapobject
The meta-field extension configuration is used to store the extension information defined by the business on the field, such as whether to support search. The specific configuration is stored in Map format. The Map key is determined by the business provider during definition.
pinnedboolean
The status of the meta field Pin can control its placement on the list.
isShowboolean
Meta field display status can control the display of fields in the definition list and business data page.
bash
curl -X GET \ 
https://{shop}.genmystore.com/api/202412/metafields/definitions/{domainName}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{
  "metafields": [
    {
      "pinned": "true",
      "definitionName": "MyFieldName01",
      "code": "MyFieldCode1",
      "namespace": "AppleName",
      "description": "this is meta field description sample",
      "optionMap": "{\"search\":true}",
      "fieldType": "Weight",
      "multi": "false",
      "schemaRule": "{\"min\":{\"value\":2,\"unit\":\"g\"},\"max\":{\"value\":200,\"unit\":\"kg\"}}",
      "isShow": "true"
    }
  ]
}