Skip to content

Create a customer
Customers

Request

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
Bodyapplication/jsonrequired
genderstring or null

Customer gender code. Use GET /users/genders for available values.

Example:"m"
first_namestring or null
Example:"Jean"
last_namestring or null
Example:"Dupont"
business_namestring or null

Company name (for professional customers).

emailstring, (email)required

Customer email address. Required.

Example:"jean.dupont@example.com"
phonesArray of objects or null(CustomerPhoneBody)

Phone numbers, one entry per slot (1-4). slot and number are required and identifies the position; type_id, and stop_sms are optional.

origin_idinteger or null

Customer origin ID. Use GET /customers/origins.

Example:12
assigned_user_idinteger or null

Assigned negotiator (agent) ID.

Example:123456
agency_idinteger or null

Agency ID (within the authenticated site's scope).

Example:123456
next_contact_atstring or null, (date-time)
referencestring or null

Internal reference of the customer.

commentsstring or null

Internal notes

current_situation_idinteger or null

Current situation list value ID (liste 5).

groupinteger or null

Customer group ID. Use GET /customers/groups.

Example:1
groupsArray of integers or null

Array of customer group IDs. Takes precedence over group.

Example:
[ 1, 2 ]
addressobject(CustomerAddressBody)

Customer address block.

newsletterboolean or null

Whether or not the customer agrees to receive communications by email.

subscriptionsArray of objects or null(CustomerSubscriptionsField)

Customer alert subscriptions. Each item controls a specific subscription channel.

Example:
[ { "id": "proposition_bien", "active": true }, { "id": "abonne_newsletter", "active": false } ]
color_idinteger or null

Customer color ID.

notary_idinteger or null

Notary customer ID.

Example:123456789
check_duplicateboolean or null
  • false or omitted: silently updates an existing duplicate and returns its ID.
  • true: returns HTTP 409 when a duplicate is found.
Example:true
phonestring or nulldeprecated

Deprecated. Use the phones array (slot 1).

Example:"+33201010101"
mobile_phonestring or nulldeprecated

Deprecated. Use the phones array (slot 3).

Example:"+33601010101"
firstnamestring or nulldeprecated

Deprecated. Use first_name.

lastnamestring or nulldeprecated

Deprecated. Use last_name.

user_idinteger or nulldeprecated

Deprecated. Use assigned_user_id.

type_idinteger or nulldeprecated

Deprecated. Use current_situation_id.

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
  }'

Responses

Customer created (or updated if duplicate found without checkDuplicate)

Bodyapplication/json
dataobject
Response
{ "data": { "id": 789 } }