Skip to main content

Sessions

4 API calls in this section.

Create Session​

Restaurant Menu / Sessions
POST/restaurant/sessions

Open a dining session for a restaurant table. A conflicting open session on the same table is rejected.

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
table_idstring—
slugstring—
started_atstring—
closed_atstring—
notestring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/restaurant/sessions" \2  --header "Content-Type: application/json" \3  --data-raw '{4  "table_id": "{{table_id}}",5  "slug": "{{slug}}",6  "started_at": "2024-01-01T12:00:00Z",7  "closed_at": "2024-01-01T14:00:00Z",8  "note": "Optional note about this session"9}'

Replace {{placeholders}} with your own values before sending.

Response examples

No saved response example. Use Try it to inspect a staging response.

List Sessions By User​

Restaurant Menu / Sessions
GET/restaurant/sessions

Browse a customer’s dining sessions, optionally limited to a date range or time filter.

Query parameters

ParameterTypeDescription
user_idstring

Customer user ID. If omitted, falls back to authenticated user.

Example: {{user_id}}

time_filterstring

Allowed: all (default), past, future.

Example: all

sortstring

For all: created_at asc|desc (default desc). For past: started_at latest first. For future: started_at soonest first.

Example: desc

pagestring

Page number (1-based).

Example: 1

limitstring

Items per page (max 100).

Example: 20

from_dateOptionalstring

Filter sessions by started_at >= from_date (ISO datetime). Optional.

Example: {{from_date}}

to_dateOptionalstring

Filter sessions by started_at <= to_date (ISO datetime). Optional.

Example: {{to_date}}

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/restaurant/sessions?user_id=${USER_ID}&time_filter=all&sort=desc&page=1&limit=20&from_date=${FROM_DATE}&to_date=${TO_DATE}" \2  --header "Content-Type: application/json"

Response examples

No saved response example. Use Try it to inspect a staging response.

List Sessions By Location​

Restaurant Menu / Sessions
GET/restaurant/locations/{{location_id}}/sessions

Browse dining sessions at a restaurant location for operational review.

Path parameters

ParameterTypeDescription
location_idRequiredstring

Variable used inside the request path.

Query parameters

ParameterTypeDescription
time_filterstring

Allowed: all (default), past, future.

Example: all

sortstring

For all: created_at asc|desc (default desc). For past: started_at latest first. For future: started_at soonest first.

Example: desc

pagestring

Page number (1-based).

Example: 1

limitstring

Items per page (max 100).

Example: 20

from_dateOptionalstring

Filter sessions by started_at >= from_date (ISO datetime). Optional.

Example: {{from_date}}

to_dateOptionalstring

Filter sessions by started_at <= to_date (ISO datetime). Optional.

Example: {{to_date}}

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/restaurant/locations/${LOCATION_ID}/sessions?time_filter=all&sort=desc&page=1&limit=20&from_date=${FROM_DATE}&to_date=${TO_DATE}" \2  --header "Content-Type: application/json"

Response examples

No saved response example. Use Try it to inspect a staging response.

Close Session​

Restaurant Menu / Sessions
PUT/restaurant/sessions/:sessionId/close

Close a dine-in session and record its closing time.

Path parameters

ParameterTypeDescription
sessionIdRequiredstring

Dynamic path value from the request URL.

Staging
Request
curl
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/restaurant/sessions/${SESSIONID}/close"

Response examples

No saved response example. Use Try it to inspect a staging response.