Customer Preferences
4 API calls in this section.
Endpoints for managing customer delivery preferences. These preferences define how, when, and where customers wish to receive their deliveries.
List Customer Preferences
/delivery/customer-preferencesList customer delivery preferences with pagination, sorting, column filters and stats.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Page number (default: 1) Example: |
limit | string | Items per page (default: 10) Example: |
customer_id | string | Filter by customer UUID (standalone param) |
location_id | string | Filter by address UUID (standalone param) |
search | string | Search across customer |
sort_by | string | Sort column: |
sort_order | string | asc or desc (default: desc) Example: |
column_filters | string | JSON object. Keys: |
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/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 ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Customer preferences retrieved successfully",4 "preferences": [5 {6 "id": "uuid",7 "preferred_day_of_week": "1",8 "preferred_time_start": "09:00",9 "preferred_time_end": "17:00",10 "delivery_instructions": "Leave at door",11 "delivery_options": {12 "signature_required": false,13 "leave_at_door": true14 },15 "created_at": "2025-01-15T08:00:00Z",16 "customer": {17 "id": "uuid",18 "full_name": "Jane Doe"19 },20 "location": {21 "id": "uuid",22 "full_address": "123 Main St"23 }24 }25 ],26 "page": 1,27 "limit": 10,28 "total": 25,29 "stats": {30 "totalPreferences": 100,31 "signatureRequiredCount": 30,32 "leaveAtDoorCount": 55,33 "recentlyAddedCount": 734 }35}Create Customer Preference
/delivery/customer-preferencesCreate a new customer delivery preference. Customers can only create preferences for themselves, while admin users can create preferences for any customer.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
customer_id | string | — |
location_id | string | — |
preferred_day_of_week | number | — |
preferred_time_start | string | — |
preferred_time_end | string | — |
delivery_instructions | string | — |
delivery_options | object | — |
delivery_options.signature_required | boolean | — |
delivery_options.leave_with_neighbor | boolean | — |
delivery_options.leave_at_door | boolean | — |
delivery_options.requires_appointment | boolean | — |
delivery_options.package_handling | object | — |
Show 19 more body fields
Additional body parameters
| Parameter | Type | Description |
|---|---|---|
delivery_options.package_handling.fragile | boolean | — |
delivery_options.package_handling.temperature_sensitive | boolean | — |
delivery_options.authorized_receivers | array<object> | — |
delivery_options.authorized_receivers.name | string | — |
delivery_options.authorized_receivers.relationship | string | — |
delivery_options.authorized_receivers.contact | string | — |
contact_preferences | object | — |
contact_preferences.notification_methods | array<object> | — |
contact_preferences.notification_methods.type | string | — |
contact_preferences.notification_methods.enabled | boolean | — |
contact_preferences.notification_methods.contact | string | — |
contact_preferences.notification_events | object | — |
contact_preferences.notification_events.on_dispatch | boolean | — |
contact_preferences.notification_events.day_before | boolean | — |
contact_preferences.notification_events.day_of | boolean | — |
contact_preferences.notification_events.hour_before | boolean | — |
contact_preferences.notification_events.on_arrival | boolean | — |
contact_preferences.notification_events.on_completion | boolean | — |
contact_preferences.language | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/delivery/customer-preferences?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "customer_id": "uuid",6 "location_id": "uuid",7 "preferred_day_of_week": 1,8 "preferred_time_start": "09:00",9 "preferred_time_end": "17:00",10 "delivery_instructions": "Leave packages at the front door",11 "delivery_options": {12 "signature_required": false,13 "leave_with_neighbor": true,14 "leave_at_door": true,15 "requires_appointment": false,16 "package_handling": {17 "fragile": true,18 "temperature_sensitive": false19 },20 "authorized_receivers": [21 {22 "name": "John Smith",23 "relationship": "Neighbor",24 "contact": "+1987654321"25 }26 ]27 },28 "contact_preferences": {29 "notification_methods": [30 {31 "type": "sms",32 "enabled": true,33 "contact": "+1234567890"34 },35 {36 "type": "email",37 "enabled": true,38 "contact": "customer@example.com"39 }40 ],41 "notification_events": {42 "on_dispatch": true,43 "day_before": false,44 "day_of": true,45 "hour_before": true,46 "on_arrival": true,47 "on_completion": true48 },49 "language": "en"50 }51}'Response examples
1{2 "success": true,3 "message": "Preference created successfully",4 "id": "uuid"5}Update Customer Preference
/delivery/customer-preferences/:preferenceIdUpdate 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.
Path parameters
| Parameter | Type | Description |
|---|---|---|
preferenceIdRequired | string | ID of the preference to update |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
location_id | string | — |
preferred_day_of_week | number | — |
preferred_time_start | string | — |
preferred_time_end | string | — |
delivery_instructions | string | — |
delivery_options | object | — |
delivery_options.signature_required | boolean | — |
delivery_options.leave_with_neighbor | boolean | — |
delivery_options.leave_at_door | boolean | — |
contact_preferences | object | — |
contact_preferences.notification_methods | array<object> | — |
contact_preferences.notification_methods.type | string | — |
Show 9 more body fields
Additional body parameters
| Parameter | Type | Description |
|---|---|---|
contact_preferences.notification_methods.enabled | boolean | — |
contact_preferences.notification_methods.contact | string | — |
contact_preferences.notification_events | object | — |
contact_preferences.notification_events.on_dispatch | boolean | — |
contact_preferences.notification_events.day_before | boolean | — |
contact_preferences.notification_events.day_of | boolean | — |
contact_preferences.notification_events.hour_before | boolean | — |
contact_preferences.notification_events.on_arrival | boolean | — |
contact_preferences.notification_events.on_completion | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/customer-preferences/${PREFERENCEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "location_id": "uuid",6 "preferred_day_of_week": 2,7 "preferred_time_start": "10:00",8 "preferred_time_end": "18:00",9 "delivery_instructions": "Updated delivery instructions",10 "delivery_options": {11 "signature_required": true,12 "leave_with_neighbor": false,13 "leave_at_door": false14 },15 "contact_preferences": {16 "notification_methods": [17 {18 "type": "sms",19 "enabled": true,20 "contact": "+1234567890"21 },22 {23 "type": "email",24 "enabled": false,25 "contact": "customer@example.com"26 }27 ],28 "notification_events": {29 "on_dispatch": true,30 "day_before": true,31 "day_of": true,32 "hour_before": true,33 "on_arrival": true,34 "on_completion": true35 }36 }37}'Response examples
1{2 "success": true,3 "message": "Preference updated successfully",4 "preference": {5 "id": "uuid",6 "tenant_id": "uuid",7 "customer_id": "uuid",8 "location_id": "uuid",9 "preferred_day_of_week": 2,10 "preferred_time_start": "10:00",11 "preferred_time_end": "18:00",12 "delivery_instructions": "Updated delivery instructions",13 "delivery_options": {14 "signature_required": true,15 "leave_with_neighbor": false,16 "leave_at_door": false17 },18 "contact_preferences": {19 "notification_methods": [20 {21 "type": "sms",22 "enabled": true,23 "contact": "+1234567890"24 },25 {26 "type": "email",27 "enabled": false,28 "contact": "customer@example.com"29 }30 ],31 "notification_events": {32 "on_dispatch": true,33 "day_before": true,34 "day_of": true,35 "hour_before": true,36 "on_arrival": true,37 "on_completion": true38 }39 },40 "created_at": "2023-08-01T12:00:00Z",41 "updated_at": "2023-08-02T14:30:00Z"42 }43}Get Customer Preference
/delivery/customer-preferences/:preferenceIdGet a single customer delivery preference by ID. Customers can only view their own preferences, while admin users can view any preference.
Path parameters
| Parameter | Type | Description |
|---|---|---|
preferenceIdRequired | string | ID of the preference to retrieve |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/customer-preferences/${PREFERENCEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Preference retrieved successfully",4 "preference": {5 "id": "uuid",6 "preferred_day_of_week": 1,7 "preferred_time_start": "09:00",8 "preferred_time_end": "17:00",9 "delivery_instructions": "Leave packages at the front door",10 "delivery_options": {11 "signature_required": false,12 "leave_with_neighbor": true,13 "leave_at_door": true14 },15 "contact_preferences": {16 "notification_methods": [17 {18 "type": "sms",19 "enabled": true,20 "contact": "+1234567890"21 }22 ]23 },24 "created_at": "2023-08-01T12:00:00Z",25 "updated_at": "2023-08-01T12:00:00Z",26 "customer": {27 "id": "uuid",28 "full_name": "John Doe"29 },30 "location": {31 "id": "uuid",32 "full_address": "123 Main St, City, State 12345"33 }34 }35}