Skip to content
innovorder
⌘K

Service operations

Delivery Areas

Delivery areas define the geographic zones a restaurant delivers to. Each area is a polygon of latitude/longitude points with its own delivery fee, delay, minimum order amount, and optional weekly schedules. Areas become active for online ordering once they are linked to a delivery consumption mode. deliveryFee, minimumAmount, and minimumAmountForFreeDelivery are expressed in cents (250 = 2.50); deliveryDelay is expressed in minutes.

Access flag required: Replacing the delivery areas of a restaurant requires the CAN_EDIT_AREAS access flag in addition to role-based authorization.

Reference Values

schedules[].day
Day of week: MON, TUE, WED, THU, FRI, SAT, SUN
schedules[].start / end
Time in minutes from midnight (e.g., 690 = 11:30, 840 = 14:00).
schedules[].orderingQuota
Maximum number of orders accepted in the time slot. null means no quota.

GET/areas/restaurant/{restaurantId}List Delivery Areas

Retrieve all delivery areas of a restaurant, including their polygon points and weekly schedules.

Parameters

NameTypeRequiredDescription
restaurantIdintegerYesThe unique identifier of the restaurant.

Response

json
{
  "status": 200,
  "code": "fetch_areas_succeed",
  "message": "The areas for the given restaurant have been successfully fetched.",
  "data": [
    {
      "areaId": 31,
      "uuid": "c4d5e6f7-a8b9-0123-cdef-456789abcdef",
      "restaurantId": 200,
      "name": "Paris Center",
      "deliveryFee": 250,
      "deliveryDelay": 30,
      "isActivated": true,
      "minimumAmount": 1500,
      "paymentLater": false,
      "minimumAmountForFreeDelivery": 3000,
      "forceOnlinePayment": true,
      "priority": 1,
      "isScheduleModeEnabled": true,
      "points": [
        {
          "lat": 48.8738,
          "lng": 2.295
        },
        {
          "lat": 48.8738,
          "lng": 2.36
        },
        {
          "lat": 48.845,
          "lng": 2.36
        },
        {
          "lat": 48.845,
          "lng": 2.295
        }
      ],
      "schedules": [
        {
          "start": 690,
          "end": 840,
          "day": "MON",
          "orderingQuota": 20
        },
        {
          "start": 1080,
          "end": 1320,
          "day": "MON",
          "orderingQuota": null
        }
      ]
    }
  ]
}
Response Properties

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

PropertyTypeExampleDescription
statusinteger200HTTP status code returned by the API.
codestring"fetch_areas_succeed"Machine-readable application code for the result.
messagestring"The areas for the given restaurant have been successfully fetched."Human-readable result message. Do not use this value for program logic.
dataarray[…]Endpoint-specific response payload.
data[]object{…}Endpoint-specific response payload.
data[].areaIdinteger31Identifier of the associated area.
data[].uuidstring"c4d5e6f7-a8b9-0123-cdef-456789abcdef"The uuid value.
data[].restaurantIdinteger200Identifier of the restaurant.
data[].namestring"Paris Center"The name value.
data[].deliveryFeeinteger250The delivery fee value.
data[].deliveryDelayinteger30The delivery delay value.
data[].isActivatedbooleantrueWhether activated is enabled or applies.
data[].minimumAmountinteger1500The minimum amount value.
data[].paymentLaterbooleanfalseThe payment later value.
data[].minimumAmountForFreeDeliveryinteger3000The minimum amount for free delivery value.
data[].forceOnlinePaymentbooleantrueThe force online payment value.
data[].priorityinteger1The priority value.
data[].isScheduleModeEnabledbooleantrueWhether schedule mode enabled is enabled or applies.
data[].pointsarray[…]List of points entries.
data[].points[]object{…}Object containing points fields.
data[].points[].latnumber48.8738The lat value.
data[].points[].lngnumber2.295The lng value.
data[].schedulesarray[…]List of schedules entries.
data[].schedules[]object{…}Object containing schedules fields.
data[].schedules[].startinteger690The start value.
data[].schedules[].endinteger840The end value.
data[].schedules[].daystring"MON"The day value.
data[].schedules[].orderingQuotainteger20The ordering quota value.
Full replacement: the endpoint below replaces the entire list of delivery areas of the restaurant. All existing areas and their schedules are deleted, then recreated from the payload - any area missing from the payload is permanently lost, and new areaId values are assigned on every call. To modify a single area you must resend all areas. Include the areaId of an existing area in its payload object to preserve its uuid and its consumption mode bindings (the returned areaId still changes); areas sent without an areaId lose those bindings.

POST/areas/restaurant/{restaurantId}Replace Delivery Areas

Replace all delivery areas of a restaurant with the provided list, in a single transaction. Unknown fields in the payload are silently ignored.

Parameters

NameTypeRequiredDescription
restaurantIdintegerYesThe unique identifier of the restaurant.

Request Body

json
{
  "areas": [
    {
      "areaId": 31,
      "name": "Paris Center",
      "deliveryFee": 250,
      "deliveryDelay": 30,
      "isActivated": true,
      "minimumAmount": 1500,
      "minimumAmountForFreeDelivery": 3000,
      "forceOnlinePayment": true,
      "isScheduleModeEnabled": true,
      "priority": 1,
      "points": [
        {
          "lat": 48.8738,
          "lng": 2.295
        },
        {
          "lat": 48.8738,
          "lng": 2.36
        },
        {
          "lat": 48.845,
          "lng": 2.36
        },
        {
          "lat": 48.845,
          "lng": 2.295
        }
      ],
      "schedules": [
        {
          "start": 690,
          "end": 840,
          "day": "MON",
          "orderingQuota": 20
        }
      ]
    },
    {
      "name": "Paris West",
      "deliveryFee": 400,
      "deliveryDelay": 45,
      "isActivated": true,
      "minimumAmount": 2000,
      "minimumAmountForFreeDelivery": null,
      "forceOnlinePayment": true,
      "isScheduleModeEnabled": false,
      "points": [
        {
          "lat": 48.8738,
          "lng": 2.25
        },
        {
          "lat": 48.8738,
          "lng": 2.295
        },
        {
          "lat": 48.845,
          "lng": 2.295
        },
        {
          "lat": 48.845,
          "lng": 2.25
        }
      ]
    }
  ]
}
Request Body Properties

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

PropertyTypeExampleDescription
areasarray[…]List of areas entries.
areas[]object{…}Object containing areas fields.
areas[].areaIdinteger31Identifier of the associated area.
areas[].namestring"Paris Center"The name value.
areas[].deliveryFeeinteger250The delivery fee value.
areas[].deliveryDelayinteger30The delivery delay value.
areas[].isActivatedbooleantrueWhether activated is enabled or applies.
areas[].minimumAmountinteger1500The minimum amount value.
areas[].minimumAmountForFreeDeliveryinteger3000The minimum amount for free delivery value.
areas[].forceOnlinePaymentbooleantrueThe force online payment value.
areas[].isScheduleModeEnabledbooleantrueWhether schedule mode enabled is enabled or applies.
areas[].priorityinteger1The priority value.
areas[].pointsarray[…]List of points entries.
areas[].points[]object{…}Object containing points fields.
areas[].points[].latnumber48.8738The lat value.
areas[].points[].lngnumber2.295The lng value.
areas[].schedulesarray[…]List of schedules entries.
areas[].schedules[]object{…}Object containing schedules fields.
areas[].schedules[].startinteger690The start value.
areas[].schedules[].endinteger840The end value.
areas[].schedules[].daystring"MON"The day value.
areas[].schedules[].orderingQuotainteger20The ordering quota value.

Response

json
{
  "status": 201,
  "code": "create_areas_succeed",
  "message": "The areas for the given restaurant have been successfully created.",
  "data": [
    {
      "areaId": 45,
      "uuid": "c4d5e6f7-a8b9-0123-cdef-456789abcdef",
      "restaurantId": 200,
      "name": "Paris Center",
      "deliveryFee": 250,
      "deliveryDelay": 30,
      "isActivated": true,
      "minimumAmount": 1500,
      "paymentLater": false,
      "minimumAmountForFreeDelivery": 3000,
      "forceOnlinePayment": true,
      "priority": 1,
      "isScheduleModeEnabled": true,
      "points": [
        {
          "lat": 48.8738,
          "lng": 2.295
        },
        {
          "lat": 48.8738,
          "lng": 2.36
        },
        {
          "lat": 48.845,
          "lng": 2.36
        },
        {
          "lat": 48.845,
          "lng": 2.295
        }
      ],
      "schedules": [
        {
          "start": 690,
          "end": 840,
          "day": "MON",
          "orderingQuota": 20
        }
      ]
    },
    {
      "areaId": 46,
      "uuid": "d5e6f7a8-b9c0-1234-def0-56789abcdef0",
      "restaurantId": 200,
      "name": "Paris West",
      "deliveryFee": 400,
      "deliveryDelay": 45,
      "isActivated": true,
      "minimumAmount": 2000,
      "paymentLater": false,
      "minimumAmountForFreeDelivery": null,
      "forceOnlinePayment": true,
      "priority": null,
      "isScheduleModeEnabled": false,
      "points": [
        {
          "lat": 48.8738,
          "lng": 2.25
        },
        {
          "lat": 48.8738,
          "lng": 2.295
        },
        {
          "lat": 48.845,
          "lng": 2.295
        },
        {
          "lat": 48.845,
          "lng": 2.25
        }
      ],
      "schedules": []
    }
  ]
}
Response Properties

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

PropertyTypeExampleDescription
statusinteger201HTTP status code returned by the API.
codestring"create_areas_succeed"Machine-readable application code for the result.
messagestring"The areas for the given restaurant have been successfully created."Human-readable result message. Do not use this value for program logic.
dataarray[…]Endpoint-specific response payload.
data[]object{…}Endpoint-specific response payload.
data[].areaIdinteger45Identifier of the associated area.
data[].uuidstring"c4d5e6f7-a8b9-0123-cdef-456789abcdef"The uuid value.
data[].restaurantIdinteger200Identifier of the restaurant.
data[].namestring"Paris Center"The name value.
data[].deliveryFeeinteger250The delivery fee value.
data[].deliveryDelayinteger30The delivery delay value.
data[].isActivatedbooleantrueWhether activated is enabled or applies.
data[].minimumAmountinteger1500The minimum amount value.
data[].paymentLaterbooleanfalseThe payment later value.
data[].minimumAmountForFreeDeliveryinteger3000The minimum amount for free delivery value.
data[].forceOnlinePaymentbooleantrueThe force online payment value.
data[].priorityinteger1The priority value.
data[].isScheduleModeEnabledbooleantrueWhether schedule mode enabled is enabled or applies.
data[].pointsarray[…]List of points entries.
data[].points[]object{…}Object containing points fields.
data[].points[].latnumber48.8738The lat value.
data[].points[].lngnumber2.295The lng value.
data[].schedulesarray[…]List of schedules entries.
data[].schedules[]object{…}Object containing schedules fields.
data[].schedules[].startinteger690The start value.
data[].schedules[].endinteger840The end value.
data[].schedules[].daystring"MON"The day value.
data[].schedules[].orderingQuotainteger20The ordering quota value.

Consumption Mode Bindings

A delivery area only applies to online ordering once it is bound to a delivery consumption mode of the same restaurant. Binding and unbinding return the consumption mode reloaded with all its linked modules.

POST/areas/{areaId}/consumption_modes/{consumptionModeId}Bind Area to Consumption Mode

Link a delivery area to a consumption mode, activating the area for that mode. The area must belong to the same restaurant as the consumption mode; otherwise a 403 access_denied error is returned.

Parameters

NameTypeRequiredDescription
areaIdintegerYesThe unique identifier of the delivery area.
consumptionModeIdintegerYesThe unique identifier of the consumption mode.

Response

json
{
  "status": 200,
  "code": "module_bind_succeed",
  "data": {
    "consumptionModeId": 15,
    "restaurantId": 200,
    "brandId": 100,
    "channelId": 2,
    "type": "MODE_DELIVERY",
    "fee": 250,
    "delay": 30,
    "areas": [
      {
        "areaId": 45,
        "name": "Paris Center"
      }
    ]
  }
}
Response Properties

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

PropertyTypeExampleDescription
statusinteger200HTTP status code returned by the API.
codestring"module_bind_succeed"Machine-readable application code for the result.
dataobject{…}Endpoint-specific response payload.
data.consumptionModeIdinteger15Identifier of the associated consumption mode.
data.restaurantIdinteger200Identifier of the restaurant.
data.brandIdinteger100Identifier of the brand.
data.channelIdinteger2Identifier of the associated channel.
data.typestring"MODE_DELIVERY"The type value.
data.feeinteger250The fee value.
data.delayinteger30The delay value.
data.areasarray[…]List of areas entries.
data.areas[]object{…}Object containing areas fields.
data.areas[].areaIdinteger45Identifier of the associated area.
data.areas[].namestring"Paris Center"The name value.

DELETE/areas/{areaId}/consumption_modes/{consumptionModeId}Unbind Area from Consumption Mode

Remove the link between a delivery area and a consumption mode, deactivating the area for that mode.

Parameters

NameTypeRequiredDescription
areaIdintegerYesThe unique identifier of the delivery area.
consumptionModeIdintegerYesThe unique identifier of the consumption mode.

Response

json
{
  "status": 200,
  "code": "module_unbind_succeed",
  "data": {
    "consumptionModeId": 15,
    "restaurantId": 200,
    "brandId": 100,
    "channelId": 2,
    "type": "MODE_DELIVERY",
    "fee": 250,
    "delay": 30,
    "areas": []
  }
}
Response Properties

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

PropertyTypeExampleDescription
statusinteger200HTTP status code returned by the API.
codestring"module_unbind_succeed"Machine-readable application code for the result.
dataobject{…}Endpoint-specific response payload.
data.consumptionModeIdinteger15Identifier of the associated consumption mode.
data.restaurantIdinteger200Identifier of the restaurant.
data.brandIdinteger100Identifier of the brand.
data.channelIdinteger2Identifier of the associated channel.
data.typestring"MODE_DELIVERY"The type value.
data.feeinteger250The fee value.
data.delayinteger30The delay value.
data.areasarray[]List of areas entries.