Create a new customer
Add a new customer account in the CareCloud platform.
What happens when a customer is created
-
A customer record is created and its server-generated customer_id is returned.
-
One or more customer-partner relations are created automatically. The assignment depends on the project configuration:
- If the project is configured for store-based partner assignment and store_id is set in personal_information - a single relation is created for the partner derived from the store.
- If the project is not configured for store-based partner assignment - relations are created for all partners accessible to the authenticated API user. The store_id, if set, is still recorded on the customer account but does not determine partner assignment.
-
If called from the customer interface with autologin=true, the customer is logged in as part of the response.
-
If referral_code is provided and valid, a customer relation is created between the new customer and the referral code holder. The relation type used is determined by the referral campaign configuration. See GET /customers/{customer_id}/related-customers to view the resulting relation. Conditional requirements
-
When autologin is true, password is required.
-
When autologin is false, password is optional.
autologin is meaningful only when this endpoint is called from the customer interface. In the enterprise interface, autologin=true causes the password to be validated but does not log the customer in - the enterprise interface does not establish customer sessions.
Related operations
- POST /customers/actions/set-partners - replace all partner assignments on a customer in a single call (enterprise interface only).
- POST /customers/actions/validate-customer-data - validate a referral code before submitting this request.
Headers
The unique ID of the language code by ISO 639-1.
Request body
Example request
{
"customer": {
"customer_id": "8ea2591121e636086a4a9c0992",
"personal_information": {
"salutation": "Dear Mr. Smith",
"gender": 1,
"first_name": "John",
"last_name": "Smith",
"pre_nominals": "Dr.",
"post_nominals": "Ph.D",
"birthdate": "1985-02-12",
"email": "happy_customer@crmcarecloud.com",
"phone": "420523828931",
"language_id": "en",
"store_id": "8bed991c68a4",
"photo_url": "https://example.com/photos/customer.jpg",
"address": {
"address1": "Old Town Square",
"address2": "34",
"address3": "1a",
"zip": "11000",
"city": "Prague 1",
"country_code": "cz"
},
"agreement": {
"agreement_gtc": 1,
"agreement_profiling": 1,
"agreement_marketing_communication": 1,
"custom_agreements": [
{
"agreement_id": "8fd73167342d06899c4c015320",
"agreement_value": 2
}
]
},
"consents": [
{
"consent_id": "8fd73167342d06899c4c015320",
"consent_value": 2,
"last_change": "2024-06-23 11:47:23"
}
]
},
"doi_email": "2019-06-23 11:47:22",
"doi_phone": "2019-06-23 11:47:23",
"last_change": "2019-06-23 11:47:23",
"state": 1
},
"customer_source": {
"customer_source_record_id": "8fd73167342d06899c4c015320",
"customer_source_id": "86e05affc7a7abefcd513ab400",
"customer_id": "87af991126405bf8e7dfb36045",
"external_id": "A66854921C",
"last_change": "2019-06-23 11:47:22"
},
"password": "password_example",
"social_network_credentials": {
"social_network_id": "twitter",
"social_network_token": "38e123j1jedu12d1jnjqwd"
},
"property_records": [
{
"property_record_id": "docasna_blokace_darce_do:8ea2591121e636086a4a9c0992",
"property_id": "docasna_blokace_darce_do",
"property_name": "Property #6",
"last_change": "2023-02-02 00:00:00"
}
],
"referral_code": "FRIEND2024"
}Response
Created
Example response
{
"data": {
"customer_id": "8ea6abece4cd0a4ded0a29f093"
}
}