| Action | Method | Resource | Description |
|---|---|---|---|
| Get all | GET | /business/:business_id/deliveryzones | Get all delivery zones. |
| Get | GET | /business/:business_id/deliveryzones/:deliveryzone_id | Get delivery zone with id business_id and deliveryzone_id. |
| Create | POST | /business/:business_id/deliveryzones | Create a delivery zone with business_id. |
| Update | PUT | /business/:business_id/deliveryzones/:deliveryzone_id | Update delivery zone with business_id and deliveryzone_id. |
| Delete | DELETE | /business/:business_id/deliveryzones/:deliveryzone_id | Delete delivery zone with business_id and deliveryzone_id. |
The business model is composed of the following attributes:
| Attribute | Type | Required | Description | Whereable |
|---|---|---|---|---|
| name | string | no, required to create. | The zone's name. | Yes |
| type | integer | no, required to create. | The zone's type. 1 for radio. 2 for polygon. 3 for dropdown. 4 for everywhere | Yes |
| address | string | no | The zone's address. | Yes |
| data | json | no | The zone's data for zone. | No |
| dropdown_option_id | integer | no | The zone's dropdown option, if zone is type 3. | Yes |
| price | float | no, required to create. | The zone's price. | Yes |
| minimum | float | no, required to create. | The zone's minimum purshase. | Yes |
| schedule | json | no, required to create. | The zone's schedule. (e.g. LINK TO REFERENCE) | No |
| enabled | boolean | no | The zone's status. | Yes |
| businesses | array | no | Business IDs for delivery zone share |
Restrictions for Delivery zones
- Users level 0 (Type: administrator) can create, update and remove any delivery zone from any existing business in the project.
- Users level 2 (Type: business owner) can create, update and remove any delivery zone from any business related to this user.
Share Delivery Zones
To share a Delivery Zone from one business to others, you need to send the attribute businesses with an array of business IDs.
This will create a new zone to the businesses shared to.
Delivery zone type
There are 4 different ways to make delivery areas, making more versatile and comfortable for the users depending on their needs. These are shown below:
| Type Name | Type value | Description |
|---|---|---|
| Radio | 1 | Radio type, shows the maximum delivery distance from a specific point. This works in kilometers by default but you can convert the input to miles. |
| Polygon | 2 | Polygon type, creates an area based on several coordinates (minimum three). |
| Dropdown | 3 | Normally used with neighborhoods or zones. |
| Everywhere | 4 | Normally used to fast-setup a store |

