Creates a new customer. Requires SITE_CUSTOMER:WRITE permission and RS:CUSTOMER_CREATE right.
Duplicate handling:
- The system checks for duplicates by email OR phones (any match on the same site).
- Without
check_duplicate: if a duplicate is found, the existing customer is silently updated with the provided data and its ID is returned (HTTP 201). - With
check_duplicate: true: returns HTTP 409 if a duplicate is found.
Security
bearerAuth
Phone numbers, one entry per slot (1-4). slot and number are required and identifies the position; type_id, and stop_sms are optional.
Array of customer group IDs. Takes precedence over group.
Example:
[ 1, 2 ]
Customer alert subscriptions. Each item controls a specific subscription channel.
Example:
[ { "id": "proposition_bien", "active": true }, { "id": "abonne_newsletter", "active": false } ]
falseor omitted: silently updates an existing duplicate and returns its ID.true: returns HTTP 409 when a duplicate is found.
Example:true
Deprecated. Use the phones array (slot 3).
Example:"+33601010101"
- Mock serverhttps://api-doc.immo-facile.com/_mock/openapi/customers
- https://v2.immo-facile.com/api/v2/sitehttps://v2.immo-facile.com/api/v2/site/customers
curl -i -X POST \
https://api-doc.immo-facile.com/_mock/openapi/customers \
-H 'Authorization: Bearer <YOUR_opaque_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"gender": "m",
"first_name": "Jean",
"last_name": "Dupont",
"business_name": "string",
"email": "jean.dupont@example.com",
"phones": [
{
"slot": 1,
"number": "+33201010101",
"type_id": 0,
"stop_sms": false
}
],
"phone": "+33201010101",
"mobile_phone": "+33601010101",
"origin_id": 12,
"assigned_user_id": 123456,
"agency_id": 123456,
"next_contact_at": "2019-08-24T14:15:22Z",
"reference": "string",
"comments": "string",
"current_situation_id": 0,
"group": 1,
"groups": [
1,
2
],
"address": {
"street": "105 Rue Charles Nungesser",
"complement": "string",
"postcode": "29490",
"city": "Guipavas",
"country": "FR",
"residence": "string",
"latitude": "48.44145",
"longitude": "-4.415114"
},
"newsletter": true,
"subscriptions": [
{
"id": "proposition_bien",
"active": true
},
{
"id": "abonne_newsletter",
"active": false
}
],
"rgpd_consent": true,
"color_id": 0,
"notary_id": 123456789,
"check_duplicate": true,
"firstname": "string",
"lastname": "string",
"user_id": 0,
"type_id": 0
}'Response
{ "data": { "id": 789 } }