Skip to main content

Sessions

4 API calls in this section.

Create Session

Restaurant Menu / Sessions
POST/restaurant/sessions
Most OnDi APIs require an authenticated session or service token. Public endpoints are marked by their path and module context.
Request
curl
1curl --request POST "$ONDI_BASE_URL/restaurant/sessions" \2  --header "Content-Type: application/json" \3  --header "Content-Type: application/json" \4  --data '{5  "table_id": "{{table_id}}",6  "slug": "{{slug}}",7  "started_at": "2024-01-01T12:00:00Z",8  "closed_at": "2024-01-01T14:00:00Z",9  "note": "Optional note about this session"10}'
Request body
json
1{2  "table_id": "{{table_id}}",3  "slug": "{{slug}}",4  "started_at": "2024-01-01T12:00:00Z",5  "closed_at": "2024-01-01T14:00:00Z",6  "note": "Optional note about this session"7}

Request body fields

table_idExample
string

Example field from the request body.

slugExample
string

Example field from the request body.

started_atExample
string

Example field from the request body.

closed_atExample
string

Example field from the request body.

noteExample
string

Example field from the request body.

Headers

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

List Sessions By User

Restaurant Menu / Sessions
GET/restaurant/sessions?user_id={{user_id}}&time_filter=all&sort=desc&page=1&limit=20&from_date={{from_date}}&to_date={{to_date}}
Most OnDi APIs require an authenticated session or service token. Public endpoints are marked by their path and module context.
Request
curl
1curl --request GET "$ONDI_BASE_URL/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"

Query parameters

user_idOptional
query string

{{user_id}}

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

time_filterOptional
query string

all

Allowed: all (default), past, future.

sortOptional
query string

desc

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

pageOptional
query string

1

Page number (1-based).

limitOptional
query string

20

Items per page (max 100).

from_dateOptional
query string

{{from_date}}

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

to_dateOptional
query string

{{to_date}}

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

Headers

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

List Sessions By Location

Restaurant Menu / Sessions
GET/restaurant/locations/{{location_id}}/sessions?time_filter=all&sort=desc&page=1&limit=20&from_date={{from_date}}&to_date={{to_date}}
Most OnDi APIs require an authenticated session or service token. Public endpoints are marked by their path and module context.
Request
curl
1curl --request GET "$ONDI_BASE_URL/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"

Path parameters

location_idRequired
path string

Variable used inside the request path.

Query parameters

time_filterOptional
query string

all

Allowed: all (default), past, future.

sortOptional
query string

desc

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

pageOptional
query string

1

Page number (1-based).

limitOptional
query string

20

Items per page (max 100).

from_dateOptional
query string

{{from_date}}

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

to_dateOptional
query string

{{to_date}}

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

Headers

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Close Session

Restaurant Menu / Sessions
PUT/restaurant/sessions/:sessionId/close
Most OnDi APIs require an authenticated session or service token. Public endpoints are marked by their path and module context.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/restaurant/sessions/:sessionId/close" \2  --header "Authorization: Bearer $ONDI_ACCESS_TOKEN"

Path parameters

sessionIdRequired
path string

Responses

No response example is available for this endpoint yet.