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.
Endpoints
POST
/api/202412/metafields/definitions/{domainName}: Create metafield definition
PUT
/api/202412/metafields/definitions/{domainName}: Update metafield definition
DELETE
/api/202412/metafields/definitions/{domainName}: Delete metafield definition
GET
/api/202412/metafields/definitions/detail/{domainName}: Get metafield definition
GET
/api/202412/metafields/definitions/{domainName}: Get metafield definition list
Meta Fields Definition Object ​
Meta Fields Definition Business Object.
Properties ​
* 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.
{
"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
* 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.
Response Data
* 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.
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"
}'
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
Response Data
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"
}'
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
Response Data
curl -X DELETE \
https://{shop}.genmystore.com/api/202412/metafields/definitions/{domainName}" \
-H "X-Genstore-Access-Token: {access_token}" \
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
Response Data
* 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.
curl -X GET \
https://{shop}.genmystore.com/api/202412/metafields/definitions/detail/{domainName}" \
-H "X-Genstore-Access-Token: {access_token}" \
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
* 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.
Response Data
* 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.
curl -X GET \
https://{shop}.genmystore.com/api/202412/metafields/definitions/{domainName}" \
-H "X-Genstore-Access-Token: {access_token}" \
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"
}
]
}
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
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}
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}
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}
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}
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}