POST
/api/public/v1/customer-custom-fields

Create a customer custom field

Define a new custom field on customers for a business.

Request Body

PropertyTypeDescription
businessIdstringOwning business.
namestringInternal name (a-z, A-Z, 0-9, _).
typestringField type.
labelstringDisplay label.
placeholderstringPlaceholder text.
requiredbooleanWhether the field is required.
optionsarrayFor SELECT: array of { value, label }.
displayOrdernumberDisplay 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"
    }
  }
}