# Restaurant Modules

Modules hold the feature configuration of a restaurant for each sales channel (ordering flow, payment, style...). Restaurants inherit the module configuration defined at brand level; restaurant-level values are merged on top of it and take precedence. Use `GET /restaurants/{restaurantId}/modules` to discover the (`moduleId`, `channelId`) pairs that exist for your restaurant - the `moduleId` 12 used in the examples below is the ordering flow module.

#### Reference Values - Channel IDs

channelId

The first-level keys of the module responses and the `channelId` fields refer to the sales channels: `1` Kiosk, `2` Web ordering, `4` Reception, `5` POS, `6` Loyalty, `7` E-Wallet kiosk, `8` Vending machine, `9` Uber Eats, `10` Deliveroo, `11` Just Eat, `12` Tray scan. Only the channels enabled for the brand appear in the responses (see `GET /brands/{brandId}/channels`).

moduleId

Module IDs are not a fixed public referential: list the existing configuration first and reuse the `moduleId` values it contains when updating a module.

### `GET /restaurants/{restaurantId}/modules` - List Restaurant Modules

Retrieve all modules configured for the restaurant, grouped by channel, then category, then module name. Note that the first-level keys of the data object are channel IDs as numeric strings, not an array. For example, data\["2"\]\["ordering"\]\["flow"\] is the ordering flow configuration of the web ordering channel. The ordering flow module is enriched with a computed isGroupingByTableNameEnabled field reflecting the kitchen display configuration.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |

#### Response

```json
{
  "status": 200,
  "code": "module_succeed",
  "data": {
    "2": {
      "ordering": {
        "flow": {
          "moduleId": 12,
          "channelId": 2,
          "restaurantId": 200,
          "is_enabled": true,
          "isOrderFollowUpEnabled": false,
          "isProductFollowUpEnabled": false,
          "isGroupingByTableNameEnabled": false
        }
      }
    },
    "5": {
      "ordering": {
        "flow": {
          "moduleId": 12,
          "channelId": 5,
          "restaurantId": 200,
          "is_enabled": true
        }
      }
    }
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "module\_succeed" | Machine-readable application code for the result. |
| data | object | {…} | Endpoint-specific response payload. |
| data.2 | object | {…} | Object containing 2 fields. |
| data.2.ordering | object | {…} | Object containing ordering fields. |
| data.2.ordering.flow | object | {…} | Object containing flow fields. |
| data.2.ordering.flow.moduleId | integer | 12 | Identifier of the associated module. |
| data.2.ordering.flow.channelId | integer | 2 | Identifier of the associated channel. |
| data.2.ordering.flow.restaurantId | integer | 200 | Identifier of the restaurant. |
| data.2.ordering.flow.is\_enabled | boolean | true | Whether enabled is enabled or applies. |
| data.2.ordering.flow.isOrderFollowUpEnabled | boolean | false | Whether order follow up enabled is enabled or applies. |
| data.2.ordering.flow.isProductFollowUpEnabled | boolean | false | Whether product follow up enabled is enabled or applies. |
| data.2.ordering.flow.isGroupingByTableNameEnabled | boolean | false | Whether grouping by table name enabled is enabled or applies. |
| data.5 | object | {…} | Object containing 5 fields. |
| data.5.ordering | object | {…} | Object containing ordering fields. |
| data.5.ordering.flow | object | {…} | Object containing flow fields. |
| data.5.ordering.flow.moduleId | integer | 12 | Identifier of the associated module. |
| data.5.ordering.flow.channelId | integer | 5 | Identifier of the associated channel. |
| data.5.ordering.flow.restaurantId | integer | 200 | Identifier of the restaurant. |
| data.5.ordering.flow.is\_enabled | boolean | true | Whether enabled is enabled or applies. |

### `GET /restaurants/{restaurantId}/modules/{moduleId}` - Get Restaurant Module

Retrieve the configuration of a specific module of the restaurant for a given channel. The channelId query parameter is required even though it is passed in the query string - a 400 missing\_parameters error is returned when it is missing. The shape of the returned configuration depends on the module type (ordering flow, payment...).

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |
| moduleId | integer | Yes | The unique identifier of the module. |
| channelId | integer | Yes | The channel to read the module configuration for (query parameter). |

#### Response

```json
{
  "status": 200,
  "code": "module_succeed",
  "data": {
    "moduleId": 12,
    "channelId": 2,
    "restaurantId": 200,
    "is_enabled": true,
    "isOrderFollowUpEnabled": false,
    "isProductFollowUpEnabled": false
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "module\_succeed" | Machine-readable application code for the result. |
| data | object | {…} | Endpoint-specific response payload. |
| data.moduleId | integer | 12 | Identifier of the associated module. |
| data.channelId | integer | 2 | Identifier of the associated channel. |
| data.restaurantId | integer | 200 | Identifier of the restaurant. |
| data.is\_enabled | boolean | true | Whether enabled is enabled or applies. |
| data.isOrderFollowUpEnabled | boolean | false | Whether order follow up enabled is enabled or applies. |
| data.isProductFollowUpEnabled | boolean | false | Whether product follow up enabled is enabled or applies. |

Configuration Overwrite

The endpoint below is an upsert that overwrites the existing configuration for the given (`moduleId`, `channelId`) pair. The brand-level configuration, the existing restaurant-level configuration and the submitted values are merged, and the values you send always take precedence. Only send the fields you intend to change with their final values.

### `POST /restaurants/{restaurantId}/modules` - Create or Update Restaurant Module

Create or update the configuration of a module for a channel at restaurant level. Note that restaurantId must be repeated in the request body in addition to the path. The content of the module object depends on the module type. Side effects: setting module.isProductFollowUpEnabled to true forces isOrderFollowUpEnabled to false and disables the kitchen display; enabling a follow-up is rejected when the kitchen display has grouping by table name active; module.closeRestaurant creates an OPEN/CLOSE entry in the audit history; the web ordering configuration cache of the brand is invalidated; on first creation on the web ordering channel (channelId 2), the restaurant opening date is initialized as closed.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |

#### Request Body

```json
{
  "restaurantId": 200,
  "moduleId": 12,
  "channelId": 2,
  "module": {
    "is_enabled": true,
    "isOrderFollowUpEnabled": true,
    "isProductFollowUpEnabled": false
  }
}
```

##### Request Body Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| restaurantId | integer | 200 | Identifier of the restaurant. |
| moduleId | integer | 12 | Identifier of the associated module. |
| channelId | integer | 2 | Identifier of the associated channel. |
| module | object | {…} | Object containing module fields. |
| module.is\_enabled | boolean | true | Whether enabled is enabled or applies. |
| module.isOrderFollowUpEnabled | boolean | true | Whether order follow up enabled is enabled or applies. |
| module.isProductFollowUpEnabled | boolean | false | Whether product follow up enabled is enabled or applies. |

#### Response

```json
{
  "status": 200,
  "code": "module_create_succeed",
  "message": "Module has been successfully created.",
  "data": {
    "moduleId": 12,
    "channelId": 2,
    "restaurantId": 200,
    "is_enabled": true,
    "isOrderFollowUpEnabled": true,
    "isProductFollowUpEnabled": false
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "module\_create\_succeed" | Machine-readable application code for the result. |
| message | string | "Module has been successfully created." | Human-readable result message. Do not use this value for program logic. |
| data | object | {…} | Endpoint-specific response payload. |
| data.moduleId | integer | 12 | Identifier of the associated module. |
| data.channelId | integer | 2 | Identifier of the associated channel. |
| data.restaurantId | integer | 200 | Identifier of the restaurant. |
| data.is\_enabled | boolean | true | Whether enabled is enabled or applies. |
| data.isOrderFollowUpEnabled | boolean | true | Whether order follow up enabled is enabled or applies. |
| data.isProductFollowUpEnabled | boolean | false | Whether product follow up enabled is enabled or applies. |

#### Request Body Fields

restaurantId

Required (number). Must be provided in the body, but the path parameter is authoritative - the restaurant targeted is always the one from the URL.

moduleId / channelId

Required (numbers). Identify the module and channel whose configuration is created or updated.

module

Required (object). Free-form configuration whose content depends on the module type. If `module.style.slideshow` is present, it must be a nullable array of items with required `id` (number), `url` (string), `type` (string) and `duration` (number) fields.
