BizKitHub
DocsAPI ReferenceProduct/bff/product/product-custom-field-definition-create
postProductAdmin BFF

/bff/product/product-custom-field-definition-create

Adds a new typed custom field definition to the organisation. When onlyCategoryCode is provided the field renders only for products in that main category; otherwise it renders for every product in the organisation. key must be unique per organisation.

ProductpostBffProductProduct-custom-field-definition-create

Parameters

JSON body

Request body

application/json
keystringRequired

Machine key (unique per organisation). Used as the JSON key on every product carrying a value.

Length: 132
Examplematerial
type"text" | "textarea" | "number" | "boolean"Required

Input type rendered in admin.

Exampletext
labelstringRequired

Display label.

Length: 1128
ExampleMaterial
helperTextstringOptional

Small helper text shown below the input.

Length: 0500
placeholderstringOptional

Placeholder text.

Length: 0500
onlyCategoryCodestringOptional

If set, definition applies only to products whose main category matches this code. Omit for global (org-wide).

Examplet-shirts
requiredbooleanOptional

Whether the value is required. Defaults to false.

activebooleanOptional

Whether the definition is active. Defaults to true.

validationPatternstringOptional

Regex string validated on submit (server-side check).

Length: 0500

Response schema

1 status code documented

200Success
successbooleanRequired

Whether the definition was created.

Response example

application/json
{
  "success": false
}

Request example

POST /bff/product/product-custom-field-definition-create

post
curl -X POST "https://api.bizkithub.com/bff/product/product-custom-field-definition-create" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "key": "material",
  "type": "text",
  "label": "Material",
  "helperText": "example_helperText",
  "placeholder": "example_placeholder",
  "onlyCategoryCode": "t-shirts",
  "required": false,
  "active": false,
  "validationPattern": "example_validationPattern"
}'

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key