- Développeurs
- Référence API
- Locations, Accounts and Users
Locations, Accounts and Users
1. Locations
1.1 Retrieve Location
Get location details.
Endpoint: | GET /locations/:id |
Short endpoint: | GET /location (location only) |
Access level: | location, account |
Example request
GET /locations/3r4s3-1
{ "id": "3r4s3-1", "name": "Paris", "account": { "id": "3r4s3", "name": "Bella Pizza", "currency": "EUR" }, "address": "13 rue du Chant des Oiseaux", "postal_code": "75003", "city": "Paris", "country": "FR", "timezone": { "name": "Europe/Paris" }, "cutoff_time": "06:00", "opening_hours": { "monday": [ { "from": "12:00", "to": "14:00" }, { "from": "18:00", "to": "01:00" } ] // ... other days of the week }, "preparation_time": 15, "order_acceptance": { "mode": "normal" }, "custom_fields": { "delivery": { "door_time": "35" } }}
Parameters:
Name | Type | Description |
---|---|---|
id | string | Unique id of the location, generated by HubRise. |
name | string | The name of the location. Can only be changed from the HubRise back office. |
account | Account | The account to which the location belongs. |
address | string | The address of the location. |
postal_code | string | The postal code of the location. |
city | string | The city of the location. |
country | string | The country of the location. |
timezone | Timezone | The timezone of the location. |
cutoff_time | string | The time of the day when opening hours are cut off. See Opening Hours. |
opening_hours | OpeningHours | The opening hours of the location. null indicates they have not been set. |
preparation_time | integer | Base preparation time in minutes. |
order_acceptance | OrderAcceptance | Whether the location is accepting orders. |
custom_fields | CustomFields | Custom fields are useful to pass information that is not part of the standard HubRise API. |
Note: the timezone.offset
field is deprecated and should not be used, as it does not take daylight saving time into account.
Opening Hours
The opening_hours
field represents the opening hours for a location on each day of the week: monday
, tuesday
, etc. You can provide multiple time slots for each day, specifying the from
and to
times in the HH:mm
format. For example:
{ "opening_hours": { "monday": [ { "from": "12:00", "to": "14:00" }, { "from": "18:00", "to": "01:00" // Same day because 01:00 is before the cutoff time (= 06:00) } ] // ... other days of the week }}
You can skip some days, in which case the location will be considered closed on those days, but at least one time slot must be provided for the week.
For each time slot, to
must follow from
. Additionally, there must be no overlap between time slots of the same day.
The cutoff_time
is a location level field, with a default value of 06:00
. It allows time slots to span across midnight. In the example above, the second time slot ends at 01:00
, which is considered on the same day as 18:00
, because 01:00
is before the cutoff_time
. If the cutoff_time
was 00:00
, 01:00
would be considered on the next day and the API would return an error.
Order Acceptance
Controls whether a location is currently accepting new orders. Three modes are available:
normal
: The location is accepting orders normally.busy
: The location is accepting orders with a delay. Theextra_preparation_time
field specifies the additional time added to the basepreparation_time
.paused
: The location is not accepting orders. Thereason
field can be used to provide a free-text explanation.
The order_acceptance
object has the following fields:
Name | Type | Description |
---|---|---|
mode | normal | busy | paused | Current acceptance mode. |
resume_at optional | Time | Timestamp at which mode automatically reverts to normal , when mode is busy or paused . If null , the location must be updated manually. |
extra_preparation_time | integer | Additional minutes added to preparation_time , when mode is busy . |
reason optional | string | Free-text explanation shown to customers, when mode is paused . |
1.2 Update Location
Updates a location.
Endpoint: | PATCH /locations/:id |
Short endpoint: | PATCH /location (location only) |
Access level: | location, account |
The following fields can be updated: cutoff_time
, opening_hours
, preparation_time
, order_acceptance
, and custom_fields
.
If the order_acceptance
object is provided, it must match one of the following templates:
// Accepting orders normally{ "mode": "normal"} // Accepting with delay{ "mode": "busy", "resume_at": <ISO-8601 timestamp> // optional "extra_preparation_time": <integer>, // required} // Not accepting orders{ "mode": "paused", "resume_at": <ISO-8601 timestamp>, // optional "reason": <string> // optional}
Example request
PATCH /locations/3r4s3-1
{ "cutoff_time": "05:00", "opening_hours": { "monday": [ { "from": "09:00", "to": "12:30" }, { "from": "14:00", "to": "23:30" } ], "tuesday": [ { "from": "09:00", "to": "12:30" }, { "from": "14:00", "to": "23:30" } ], "wednesday": [ { "from": "09:00", "to": "12:30" }, { "from": "14:00", "to": "01:30" } // 01:30 is next day because it's before the cutoff time (= 05:00) ], "thursday": [], "friday": [{ "from": "17:00", "to": "02:00" }], "saturday": [{ "from": "18:00", "to": "02:00" }], "sunday": [{ "from": "18:00", "to": "23:00" }] }, "preparation_time": 20, "order_acceptance": { "mode": "busy", "resume_at": "2025-06-04T19:30:00+02:00", "extra_preparation_time": 25 }, "custom_fields": { "delivery": { "door_time": "35" } }}
1.3 List Locations
Returns the locations of the account.
Endpoint: | GET /locations/ |
Access level: | account |
Example request:
GET /locations
[ { "id": "3r4s3-1", "name": "Paris", "account": { "id": "3r4s3", "name": "Bella Pizza", "currency": "EUR" }, "preparation_time": 15, "order_acceptance": { "mode": "normal" } ... } ...]
2. Accounts
2.1 Retrieve Account
Get account details.
Endpoint: | GET /accounts/:id |
Short endpoint: | GET /account |
Access level: | account |
Example request:
GET /accounts/3r4s3
{ "id": "3r4s3", "name": "Mister Pizza", "currency": "EUR"}
3. Users
3.1 Retrieve User
Get user information.
Endpoint: | GET /user |
Access level: | profile, profile_with_email |
Example request:
GET /user
{ "id": "v6ap7", "first_name": "Tom", "last_name": "Jones", "email": "tom.jones@dummy-mail.org", "timezone": { "name": "Europe/Paris" }, "locales": ["en-GB", "fr-FR"]}
The email
field is included only if the access level is profile_with_email
.