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",
  "address": "123 Main Street",
  "city": "Paris",
  "zipCode": 75001,
  "country": "France",
  "classifications": [
    0,
    2
  ],
  "description": "This is the main site of the establishment.",
  "serialNumber": "123456",
  "category": 3,
  "types": [
    1,
    1
  ]
}
'
{
  "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.",
      "onboardingStatus": "COMPLETED",
      "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
string
required

Content type, must be "application/json".

Allowed value: "application/json"

Body

application/json

Details required to create an establishment

organizationId
integer
required

Identifier of the organization associated with the establishment.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

10

name
string
required

Name of the site.

Maximum string length: 250
Example:

"Main site"

address
string
required

Address of the establishment.

Maximum string length: 100
Example:

"123 Main Street"

city
string
required

City where the establishment is located.

Maximum string length: 100
Example:

"Paris"

zipCode
integer
required

Postal code of the establishment.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

75001

country
string
required

Country where the establishment is located.

Maximum string length: 100
Example:

"France"

classifications
enum<number>[]
required

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

Available options:
0,
1,
2,
3
Example:
[0, 2]
description
string

Description of the site.

Maximum string length: 2000
Example:

"This is the main site of the establishment."

serialNumber
string

Serial number of the site.

Maximum string length: 10
Example:

"123456"

category
enum<number>

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

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

3

types
enum<number>[]

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]

Response

201 - application/json

The establishment was successfully created

data
object
required