Create a customer
If a contact with the given email already exists for this shop, it is updated rather than duplicated.
POST
/customersAuthorization
AuthorizationBearer token (JWT) · headerrequiredRequest body
requiredapplication/jsonemailstring<email>requiredContact email address. Used as the unique identifier for find-or-create.
namestringrequiredFull name (first and last).
phone_numberstringcompany_namestringCompany name. Creates or finds a company record automatically.
company_id_numberstringCompany tax/ID number (RUT, DNI, etc.), stored with the company record.
tagsstring[]Tag names. Replaces all existing tags.
opt_inbooleanWhether the contact accepts marketing emails/newsletters.
contact_group_idintegerContact group ID to assign this contact to.
salesperson_idstringShop admin user ID
sourcestringOrigin of the contact record. Defaults to `API` if omitted on create.
Allowed:
signup-formregister-formcontact-formcheckoutcustom_dataobject[]Custom field values for this contact.
Show propertiesHide properties
Array of
objectkeystringField key (slug)
field_idintegerField definition ID (optional alternative to key)
valueanyField value
shop_idintegerrequiredResponses
201Customer created
_linksHalLinksidintegershop_idintegeremailstringnamestringFull name (first and last)
phone_numberstringphone_validatedbooleanvalidation_methodstringcompany_namestringcompany_id_numberstringCompany tax/ID number (RUT, DNI, etc.), formatted
company_activity_codestringcustomer_statusstringCustomer account status.
Allowed:
publicprivatependingopt_inbooleanWhether the contact has opted in to marketing emails.
sourcestringlast_logged_onstring<date-time>last_ip_addressstringhas_passwordbooleantotal_spentintegerIn cents
available_orders_countintegersalesperson_idintegerfavorite_product_idsinteger[]used_promotion_idsinteger[]tagsstring[]created_onstring<date-time>updated_onstring<date-time>_embeddedobjectShow propertiesHide properties
contact_groupobjectPresent when the contact belongs to a group
addressesAddress[]Show propertiesHide properties
Array of
Addressstreetstringstreet_2stringlocality_namestringregion_namestringcountry_namestringpostal_codestring422Validation error
Request
curl -X POST "https://api.onbolder.com/v2/customers" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"shop_id": 1,
"email": "newcustomer@example.com",
"name": "Jane Smith"
}'const response = await fetch("https://api.onbolder.com/v2/customers", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"shop_id": 1,
"email": "newcustomer@example.com",
"name": "Jane Smith"
})
});import requests
response = requests.post(
"https://api.onbolder.com/v2/customers",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"shop_id": 1,
"email": "newcustomer@example.com",
"name": "Jane Smith"
},
)Response
{
"id": 3001,
"shop_id": 1,
"email": "newcustomer@example.com",
"name": "Jane Smith",
"customer_status": "public",
"phone_validated": false,
"created_on": "2024-06-20T14:00:00Z",
"_links": {
"self": {
"href": "https://api.onbolder.com/v2/customers/3001"
},
"orders": {
"href": "https://api.onbolder.com/v2/orders?shop_id=1&contact_email=newcustomer@example.com"
}
}
}Validation error