Skip to main content
POST
/
establishments
/
v2
/
bo
Create establishment with site
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/establishments/v2/bo \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Session-Token: <x-session-token>' \
  --data '
{
  "organizationId": 10,
  "name": "Main site",
  "types": [
    1,
    1
  ],
  "address": "123 Main Street",
  "city": "Paris",
  "zipCode": 75001,
  "country": "France",
  "classifications": [
    0,
    2
  ],
  "category": 3,
  "totalSurfaceArea": 1500,
  "publicCapacity": 300,
  "privateCapacity": 50,
  "pinCodeEnabled": false,
  "accessInstructions": "Enter through the back door.",
  "serialNumber": "123456",
  "tagIds": [
    1,
    2,
    3
  ]
}
'
{
  "data": {
    "establishmentSchema": {
      "id": 1,
      "image": {
        "size": 2048,
        "name": "commission-signature.jpg",
        "mimeType": "image/jpeg"
      },
      "address": "123 Main Street",
      "city": "Paris",
      "zipCode": 75001,
      "country": "France",
      "classifications": [
        0,
        2
      ],
      "category": 3,
      "isGroupment": true,
      "totalSurfaceArea": 1500,
      "publicCapacity": 300,
      "privateCapacity": 50,
      "organizationId": 10,
      "establishmentSiteId": 5,
      "pinCode": 1234,
      "pinCodeEnabled": false,
      "accessInstructions": "Enter through the back door.",
      "metadata": {
        "leafletDispatched": true
      },
      "updatedAt": "2024-12-01T12:34:56.000Z",
      "createdAt": "2023-01-01T08:00:00.000Z",
      "counters": {
        "reportIntervention": 5,
        "reportCommission": 2,
        "anomalyObservation": 1
      },
      "img": "https://example.com/image.jpg"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Session-Token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Content-Type
enum<string>
required

Content type, must be "application/json".

Available options:
application/json

Body

application/json

Details required to create an establishment

organizationId
integer
required

Identifier of the organization associated with the establishment.

Example:

10

name
string
required

Name of the site.

Maximum string length: 250
Example:

"Main site"

types
enum<number>[]
required

Types associated with the site (N, P, M, etc.).

Available options:
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19
Example:
[1, 1]
address
string | null
required

Address of the establishment.

Maximum string length: 100
Example:

"123 Main Street"

city
string | null
required

City where the establishment is located.

Maximum string length: 100
Example:

"Paris"

zipCode
integer | null
required

Postal code of the establishment.

Example:

75001

country
string | null
required

Country where the establishment is located.

Maximum string length: 100
Example:

"France"

classifications
enum<number>[] | null
required

Classifications of the establishment (e.g., ERP, IGH).

Available options:
0,
1,
2,
3
Example:
[0, 2]
category
enum<number> | null
required

Category of the establishment (if ERP), between 1 and 5.

Available options:
1,
2,
3,
4,
5,
Example:

3

totalSurfaceArea
integer | null
required

Total surface area of the establishment in square meters.

Example:

1500

publicCapacity
integer | null
required

Maximum public capacity of the establishment.

Example:

300

privateCapacity
integer | null
required

Maximum private capacity of the establishment.

Example:

50

pinCodeEnabled
boolean | null
required

Indicates if the PIN code is enabled for access.

Example:

false

accessInstructions
string | null
required

Instructions for accessing the establishment.

Maximum string length: 100
Example:

"Enter through the back door."

serialNumber
string

Serial number of the site.

Maximum string length: 10
Example:

"123456"

tagIds
integer[]

Unique identifiers of the associated tags.

Example:
[1, 2, 3]

Response

201 - application/json

The establishment was successfully created

data
object
required