POST
/api/public/v1/customer-custom-fieldsCreate a customer custom field
Define a new custom field on customers for a business.
Request Body
| Property | Type | Description |
|---|---|---|
businessId | string | Owning business. |
name | string | Internal name (a-z, A-Z, 0-9, _). |
type | string | Field type. |
label | string | Display label. |
placeholder | string | Placeholder text. |
required | boolean | Whether the field is required. |
options | array | For SELECT: array of { value, label }. |
displayOrder | number | Display position. |
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/customer-custom-fields" \
-H "X-Organization-Id: your_org_id" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"businessId": "biz_abc",
"name": "preferred_contact",
"type": "SELECT",
"label": "Preferred contact method",
"options": [
{
"value": "email",
"label": "Email"
},
{
"value": "sms",
"label": "SMS"
}
]
}'200Example response
json
{
"message": "Customer custom field created successfully!",
"content": {
"customField": {
"id": "cf_1"
}
}
}