For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Custom Field

Create a field definition for the selected resourceType. Use this to define the key, localized label, data type and validation rules that records can use.

Choose OPTION_SET, CART or PRODUCT_DATA_GRID and provide the definition required by that type. This creates the definition, not a field value on an option, cart or bill-of-materials item. Use List Custom Fields first to inspect existing keys and system definitions.

Requires the customFields:write scope.

post
Authorizations
AuthorizationstringRequired

API key sent as a bearer token (mk_live_… / mk_test_…).

Body

Data schema used by Create Custom Field (POST /v1/custom-fields). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ.

resourceTypestring · enumRequired

The resource whose records carry this custom field.

Possible values:
keystring · min: 1RequiredPattern: ^[a-zA-Z0-9-_]+$
typestring · enumRequiredPossible values:
statusstring · enumOptionalPossible values:
Responses
201

Created.

application/json
post/v1/custom-fields
POST /v1/custom-fields HTTP/1.1
Host: admin.mimeeqapi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1732

{
  "resourceType": "OPTION_SET",
  "key": "text",
  "name": {
    "en": "Chair",
    "de": "Stuhl"
  },
  "description": {
    "en": "Chair",
    "de": "Stuhl"
  },
  "type": "TEXT",
  "status": "ACTIVE",
  "validationConfig": {
    "min": 1,
    "max": 1,
    "decimalPlaces": 1,
    "regexExpression": "text",
    "validationMessage": {
      "en": "Chair",
      "de": "Stuhl"
    },
    "isRequired": true,
    "isUnique": true,
    "showOnFrontend": true
  },
  "typeConfig": {
    "checkboxContent": {
      "showInFooter": true,
      "content": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "checkedLabel": {
        "en": "Chair",
        "de": "Stuhl"
      },
      "uncheckedLabel": {
        "en": "Chair",
        "de": "Stuhl"
      }
    },
    "selectOptions": [
      {
        "id": "text",
        "name": {
          "en": "Chair",
          "de": "Stuhl"
        },
        "value": "text"
      }
    ],
    "fileContent": {
      "fileLimit": "SINGLE_FILE",
      "minFiles": 1,
      "maxFiles": 1,
      "fileTypes": {
        "acceptAllFileTypes": true,
        "images": true,
        "videos": true,
        "documents": true,
        "archives": true
      },
      "fileExceptions": {
        "allowAdditionalFileTypes": [
          "text"
        ],
        "blockSpecificFileTypes": [
          "text"
        ]
      }
    },
    "metaObjectContent": [
      {
        "parameterId": "text",
        "key": "text",
        "type": "TEXT",
        "name": {
          "en": "Chair",
          "de": "Stuhl"
        },
        "description": {
          "en": "Chair",
          "de": "Stuhl"
        },
        "validationConfig": {
          "min": 1,
          "max": 1,
          "decimalPlaces": 1,
          "regexExpression": "text",
          "validationMessage": {
            "en": "Chair",
            "de": "Stuhl"
          },
          "isRequired": true,
          "isUnique": true,
          "showOnFrontend": true
        },
        "typeConfig": {
          "checkboxContent": {
            "showInFooter": true,
            "content": {
              "ANY_ADDITIONAL_PROPERTY": "anything"
            },
            "checkedLabel": {
              "en": "Chair",
              "de": "Stuhl"
            },
            "uncheckedLabel": {
              "en": "Chair",
              "de": "Stuhl"
            }
          },
          "selectOptions": [
            {
              "id": "text",
              "name": {
                "en": "Chair",
                "de": "Stuhl"
              },
              "value": "text"
            }
          ],
          "fileContent": {
            "fileLimit": "SINGLE_FILE",
            "minFiles": 1,
            "maxFiles": 1,
            "fileTypes": {
              "acceptAllFileTypes": true,
              "images": true,
              "videos": true,
              "documents": true,
              "archives": true
            },
            "fileExceptions": {
              "allowAdditionalFileTypes": [
                "text"
              ],
              "blockSpecificFileTypes": [
                "text"
              ]
            }
          }
        }
      }
    ]
  }
}
{
  "data": {
    "parameterId": "text",
    "resourceType": "OPTION_SET",
    "key": "text",
    "name": "Chair",
    "description": "Chair",
    "type": "TEXT",
    "source": "SYSTEM",
    "status": "ACTIVE",
    "validationConfig": {
      "min": 1,
      "max": 1,
      "decimalPlaces": 1,
      "regexExpression": "text",
      "validationMessage": "Chair",
      "isRequired": true,
      "isUnique": true,
      "showOnFrontend": true
    },
    "typeConfig": {
      "checkboxContent": {
        "showInFooter": true,
        "content": null,
        "checkedLabel": "Chair",
        "uncheckedLabel": "Chair"
      },
      "selectOptions": [
        {
          "id": "text",
          "name": "Chair",
          "value": "text"
        }
      ],
      "fileContent": {
        "fileLimit": "SINGLE_FILE",
        "minFiles": 1,
        "maxFiles": 1,
        "fileTypes": {
          "acceptAllFileTypes": true,
          "images": true,
          "videos": true,
          "documents": true,
          "archives": true
        },
        "fileExceptions": {
          "allowAdditionalFileTypes": [
            "text"
          ],
          "blockSpecificFileTypes": [
            "text"
          ]
        }
      },
      "metaObjectContent": [
        {
          "parameterId": "text",
          "key": "text",
          "type": "TEXT",
          "name": "Chair",
          "description": "Chair",
          "validationConfig": {
            "min": 1,
            "max": 1,
            "decimalPlaces": 1,
            "regexExpression": "text",
            "validationMessage": "Chair",
            "isRequired": true,
            "isUnique": true,
            "showOnFrontend": true
          },
          "typeConfig": {
            "checkboxContent": {
              "showInFooter": true,
              "content": null,
              "checkedLabel": "Chair",
              "uncheckedLabel": "Chair"
            },
            "selectOptions": [
              {
                "id": "text",
                "name": "Chair",
                "value": "text"
              }
            ],
            "fileContent": {
              "fileLimit": "SINGLE_FILE",
              "minFiles": 1,
              "maxFiles": 1,
              "fileTypes": {
                "acceptAllFileTypes": true,
                "images": true,
                "videos": true,
                "documents": true,
                "archives": true
              },
              "fileExceptions": {
                "allowAdditionalFileTypes": [
                  "text"
                ],
                "blockSpecificFileTypes": [
                  "text"
                ]
              }
            }
          }
        }
      ]
    },
    "createdAt": "text",
    "modifiedAt": "text"
  }
}

Last updated

Was this helpful?