Skip to main content

Customer Preferences

4 API calls in this section.

List Customer Preferences

Delivery & Last-Mile / Customer Preferences
GET/delivery/customer-preferences?page=1&limit=10&customer_id=&location_id=&search=&sort_by=&sort_order=desc&column_filters=&tenant_id=&language=en

List customer delivery preferences with pagination, sorting, column filters and stats.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/customer-preferences?page=1&limit=10&customer_id=&location_id=&search=&sort_by=&sort_order=desc&column_filters=&tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number (default: 1)

limitOptional
query string

10

Items per page (default: 10)

customer_idOptional
query string

Filter by customer UUID (standalone param)

location_idOptional
query string

Filter by address UUID (standalone param)

searchOptional
query string

Search across customer full_name and address full_address (ILIKE)

sort_byOptional
query string

Sort column: customer_id (sorts by full_name) | preferred_day_of_week | preferred_time_start | preferred_time_end | created_at (default)

sort_orderOptional
query string

desc

asc or desc (default: desc)

column_filtersOptional
query string

JSON object. Keys: customer_id (uuid string), location_id (uuid string), preferred_day_of_week ("0"–"6"), delivery_instructions (ILIKE), delivery_location ("true"/"false" → leave_at_door), signature_required ("true"/"false"). Example: {"preferred_day_of_week":"1","signature_required":"true"}

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Error - Insufficient Permissions403Forbidden

Create Customer Preference

Delivery & Last-Mile / Customer Preferences
POST/delivery/customer-preferences?tenant_id=&language=en

Create a new customer delivery preference. Customers can only create preferences for themselves, while admin users can create preferences for any customer.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/customer-preferences?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "customer_id": "uuid",7  "location_id": "uuid",8  "preferred_day_of_week": 1,9  "preferred_time_start": "09:00",10  "preferred_time_end": "17:00",11  "delivery_instructions": "Leave packages at the front door",12  "delivery_options": {13    "signature_required": false,14    "leave_with_neighbor": true,15    "leave_at_door": true,16    "requires_appointment": false,17    "package_handling": {18      "fragile": true,19      "temperature_sensitive": false20    },21    "authorized_receivers": [22      {23        "name": "John Smith",24        "relationship": "Neighbor",25        "contact": "+1987654321"26      }27    ]28  },29  "contact_preferences": {30    "notification_methods": [31      {32        "type": "sms",33        "enabled": true,34        "contact": "+1234567890"35      },36      {37        "type": "email",38        "enabled": true,39        "contact": "customer@example.com"40      }41    ],42    "notification_events": {43      "on_dispatch": true,44      "day_before": false,45      "day_of": true,46      "hour_before": true,47      "on_arrival": true,48      "on_completion": true49    },50    "language": "en"51  }52}'
Request body
json
1{2  "customer_id": "uuid",3  "location_id": "uuid",4  "preferred_day_of_week": 1,5  "preferred_time_start": "09:00",6  "preferred_time_end": "17:00",7  "delivery_instructions": "Leave packages at the front door",8  "delivery_options": {9    "signature_required": false,10    "leave_with_neighbor": true,11    "leave_at_door": true,12    "requires_appointment": false,13    "package_handling": {14      "fragile": true,15      "temperature_sensitive": false16    },17    "authorized_receivers": [18      {19        "name": "John Smith",20        "relationship": "Neighbor",21        "contact": "+1987654321"22      }23    ]24  },25  "contact_preferences": {26    "notification_methods": [27      {28        "type": "sms",29        "enabled": true,30        "contact": "+1234567890"31      },32      {33        "type": "email",34        "enabled": true,35        "contact": "customer@example.com"36      }37    ],38    "notification_events": {39      "on_dispatch": true,40      "day_before": false,41      "day_of": true,42      "hour_before": true,43      "on_arrival": true,44      "on_completion": true45    },46    "language": "en"47  }48}

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Request body fields

customer_idExample
string

Example field from the request body.

location_idExample
string

Example field from the request body.

preferred_day_of_weekExample
number

Example field from the request body.

preferred_time_startExample
string

Example field from the request body.

preferred_time_endExample
string

Example field from the request body.

delivery_instructionsExample
string

Example field from the request body.

delivery_optionsExample
object

Example field from the request body.

delivery_options.signature_requiredExample
boolean

Example field from the request body.

delivery_options.leave_with_neighborExample
boolean

Example field from the request body.

delivery_options.leave_at_doorExample
boolean

Example field from the request body.

delivery_options.requires_appointmentExample
boolean

Example field from the request body.

delivery_options.package_handlingExample
object

Example field from the request body.

delivery_options.package_handling.fragileExample
boolean

Example field from the request body.

delivery_options.package_handling.temperature_sensitiveExample
boolean

Example field from the request body.

delivery_options.authorized_receiversExample
array<object>

Example field from the request body.

delivery_options.authorized_receivers.nameExample
string

Example field from the request body.

delivery_options.authorized_receivers.relationshipExample
string

Example field from the request body.

delivery_options.authorized_receivers.contactExample
string

Example field from the request body.

contact_preferencesExample
object

Example field from the request body.

contact_preferences.notification_methodsExample
array<object>

Example field from the request body.

contact_preferences.notification_methods.typeExample
string

Example field from the request body.

contact_preferences.notification_methods.enabledExample
boolean

Example field from the request body.

contact_preferences.notification_methods.contactExample
string

Example field from the request body.

contact_preferences.notification_eventsExample
object

Example field from the request body.

contact_preferences.notification_events.on_dispatchExample
boolean

Example field from the request body.

contact_preferences.notification_events.day_beforeExample
boolean

Example field from the request body.

contact_preferences.notification_events.day_ofExample
boolean

Example field from the request body.

contact_preferences.notification_events.hour_beforeExample
boolean

Example field from the request body.

contact_preferences.notification_events.on_arrivalExample
boolean

Example field from the request body.

contact_preferences.notification_events.on_completionExample
boolean

Example field from the request body.

contact_preferences.languageExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201Created
Error - Preference Already Exists409Conflict
Error - Invalid Time Format400Bad Request

Update Customer Preference

Delivery & Last-Mile / Customer Preferences
PUT/delivery/customer-preferences/:preferenceId?tenant_id=&language=en

Update an existing customer delivery preference. Customers can only update their own preferences, while admin users can update any customer's preferences. The customer_id cannot be changed.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/delivery/customer-preferences/:preferenceId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "location_id": "uuid",7  "preferred_day_of_week": 2,8  "preferred_time_start": "10:00",9  "preferred_time_end": "18:00",10  "delivery_instructions": "Updated delivery instructions",11  "delivery_options": {12    "signature_required": true,13    "leave_with_neighbor": false,14    "leave_at_door": false15  },16  "contact_preferences": {17    "notification_methods": [18      {19        "type": "sms",20        "enabled": true,21        "contact": "+1234567890"22      },23      {24        "type": "email",25        "enabled": false,26        "contact": "customer@example.com"27      }28    ],29    "notification_events": {30      "on_dispatch": true,31      "day_before": true,32      "day_of": true,33      "hour_before": true,34      "on_arrival": true,35      "on_completion": true36    }37  }38}'
Request body
json
1{2  "location_id": "uuid",3  "preferred_day_of_week": 2,4  "preferred_time_start": "10:00",5  "preferred_time_end": "18:00",6  "delivery_instructions": "Updated delivery instructions",7  "delivery_options": {8    "signature_required": true,9    "leave_with_neighbor": false,10    "leave_at_door": false11  },12  "contact_preferences": {13    "notification_methods": [14      {15        "type": "sms",16        "enabled": true,17        "contact": "+1234567890"18      },19      {20        "type": "email",21        "enabled": false,22        "contact": "customer@example.com"23      }24    ],25    "notification_events": {26      "on_dispatch": true,27      "day_before": true,28      "day_of": true,29      "hour_before": true,30      "on_arrival": true,31      "on_completion": true32    }33  }34}

Path parameters

preferenceIdRequired
path string

ID of the preference to update

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Request body fields

location_idExample
string

Example field from the request body.

preferred_day_of_weekExample
number

Example field from the request body.

preferred_time_startExample
string

Example field from the request body.

preferred_time_endExample
string

Example field from the request body.

delivery_instructionsExample
string

Example field from the request body.

delivery_optionsExample
object

Example field from the request body.

delivery_options.signature_requiredExample
boolean

Example field from the request body.

delivery_options.leave_with_neighborExample
boolean

Example field from the request body.

delivery_options.leave_at_doorExample
boolean

Example field from the request body.

contact_preferencesExample
object

Example field from the request body.

contact_preferences.notification_methodsExample
array<object>

Example field from the request body.

contact_preferences.notification_methods.typeExample
string

Example field from the request body.

contact_preferences.notification_methods.enabledExample
boolean

Example field from the request body.

contact_preferences.notification_methods.contactExample
string

Example field from the request body.

contact_preferences.notification_eventsExample
object

Example field from the request body.

contact_preferences.notification_events.on_dispatchExample
boolean

Example field from the request body.

contact_preferences.notification_events.day_beforeExample
boolean

Example field from the request body.

contact_preferences.notification_events.day_ofExample
boolean

Example field from the request body.

contact_preferences.notification_events.hour_beforeExample
boolean

Example field from the request body.

contact_preferences.notification_events.on_arrivalExample
boolean

Example field from the request body.

contact_preferences.notification_events.on_completionExample
boolean

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Error - Preference Not Found404Not Found
Error - Insufficient Permissions403Forbidden

Get Customer Preference

Delivery & Last-Mile / Customer Preferences
GET/delivery/customer-preferences/:preferenceId?tenant_id=&language=en

Get a single customer delivery preference by ID. Customers can only view their own preferences, while admin users can view any preference.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/customer-preferences/:preferenceId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

preferenceIdRequired
path string

ID of the preference to retrieve

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Error - Preference Not Found404Not Found
Error - Insufficient Permissions403Forbidden