POST
/api/public/v1/customers

Create a customer

Create a new customer (account) within 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 Settings → Company → API, and to a teammate under Employee → Permissions.

customers:write

Request Body

PropertyTypeDescription
locationIdstringLocation that owns the customer.
fullnamestringCustomer full name.
emailstringEmail address.
phoneNumberstringPhone number.
birthdaystringISO date of birth.
notesstringFree-form notes.
statusstringAccount status.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/customers" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "loc_abc",
    "fullname": "John Doe",
    "email": "john@example.com"
  }'
200Example response
json
{
  "message": "Customer created successfully!",
  "content": {
    "customer": {
      "id": "cust_1"
    }
  }
}

In the console

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

xRM → Accounts
/xrm
  1. Add an account.