Customer Preferences
4 API calls in this section.
List Customer Preferences
/delivery/customer-preferences?page=1&limit=10&customer_id=&location_id=&search=&sort_by=&sort_order=desc&column_filters=&tenant_id=&language=enList customer delivery preferences with pagination, sorting, column filters and stats.
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
pageOptional1
Page number (default: 1)
limitOptional10
Items per page (default: 10)
customer_idOptionalFilter by customer UUID (standalone param)
location_idOptionalFilter by address UUID (standalone param)
searchOptionalSearch across customer full_name and address full_address (ILIKE)
sort_byOptionalSort column: customer_id (sorts by full_name) | preferred_day_of_week | preferred_time_start | preferred_time_end | created_at (default)
sort_orderOptionaldesc
asc or desc (default: desc)
column_filtersOptionalJSON 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_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Create Customer Preference
/delivery/customer-preferences?tenant_id=&language=enCreate a new customer delivery preference. Customers can only create preferences for themselves, while admin users can create preferences for any customer.
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}'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_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
customer_idExampleExample field from the request body.
location_idExampleExample field from the request body.
preferred_day_of_weekExampleExample field from the request body.
preferred_time_startExampleExample field from the request body.
preferred_time_endExampleExample field from the request body.
delivery_instructionsExampleExample field from the request body.
delivery_optionsExampleExample field from the request body.
delivery_options.signature_requiredExampleExample field from the request body.
delivery_options.leave_with_neighborExampleExample field from the request body.
delivery_options.leave_at_doorExampleExample field from the request body.
delivery_options.requires_appointmentExampleExample field from the request body.
delivery_options.package_handlingExampleExample field from the request body.
delivery_options.package_handling.fragileExampleExample field from the request body.
delivery_options.package_handling.temperature_sensitiveExampleExample field from the request body.
delivery_options.authorized_receiversExampleExample field from the request body.
delivery_options.authorized_receivers.nameExampleExample field from the request body.
delivery_options.authorized_receivers.relationshipExampleExample field from the request body.
delivery_options.authorized_receivers.contactExampleExample field from the request body.
contact_preferencesExampleExample field from the request body.
contact_preferences.notification_methodsExampleExample field from the request body.
contact_preferences.notification_methods.typeExampleExample field from the request body.
contact_preferences.notification_methods.enabledExampleExample field from the request body.
contact_preferences.notification_methods.contactExampleExample field from the request body.
contact_preferences.notification_eventsExampleExample field from the request body.
contact_preferences.notification_events.on_dispatchExampleExample field from the request body.
contact_preferences.notification_events.day_beforeExampleExample field from the request body.
contact_preferences.notification_events.day_ofExampleExample field from the request body.
contact_preferences.notification_events.hour_beforeExampleExample field from the request body.
contact_preferences.notification_events.on_arrivalExampleExample field from the request body.
contact_preferences.notification_events.on_completionExampleExample field from the request body.
contact_preferences.languageExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Update Customer Preference
/delivery/customer-preferences/:preferenceId?tenant_id=&language=enUpdate 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.
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}'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
preferenceIdRequiredID of the preference to update
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
location_idExampleExample field from the request body.
preferred_day_of_weekExampleExample field from the request body.
preferred_time_startExampleExample field from the request body.
preferred_time_endExampleExample field from the request body.
delivery_instructionsExampleExample field from the request body.
delivery_optionsExampleExample field from the request body.
delivery_options.signature_requiredExampleExample field from the request body.
delivery_options.leave_with_neighborExampleExample field from the request body.
delivery_options.leave_at_doorExampleExample field from the request body.
contact_preferencesExampleExample field from the request body.
contact_preferences.notification_methodsExampleExample field from the request body.
contact_preferences.notification_methods.typeExampleExample field from the request body.
contact_preferences.notification_methods.enabledExampleExample field from the request body.
contact_preferences.notification_methods.contactExampleExample field from the request body.
contact_preferences.notification_eventsExampleExample field from the request body.
contact_preferences.notification_events.on_dispatchExampleExample field from the request body.
contact_preferences.notification_events.day_beforeExampleExample field from the request body.
contact_preferences.notification_events.day_ofExampleExample field from the request body.
contact_preferences.notification_events.hour_beforeExampleExample field from the request body.
contact_preferences.notification_events.on_arrivalExampleExample field from the request body.
contact_preferences.notification_events.on_completionExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Get Customer Preference
/delivery/customer-preferences/:preferenceId?tenant_id=&language=enGet a single customer delivery preference by ID. Customers can only view their own preferences, while admin users can view any preference.
1curl --request GET "$ONDI_BASE_URL/delivery/customer-preferences/:preferenceId?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
preferenceIdRequiredID of the preference to retrieve
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}