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

Create a customer custom field

Define a new custom field on customers for a location.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

customer:custom-fields:write

Request Body

PropertyTypeDescription
locationIdstringOwning location.
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 "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "loc_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"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

xRM → Accounts → Custom fields
/xrm
  1. Open the Custom fields dialog from the accounts table header.
  2. Add a field and pick its type.