Skip to main content

Storefront Delivery Configuration

6 API calls in this section.

Get Delivery Config

Storefront & Commerce / Storefront Delivery Configuration
GET/storefront/delivery-config

Fetch current tenant delivery configuration. Response: { success, config: { mode, status, external_base_url, timeout_ms, retries, last_tested_at, test_result, webhook_secret, webhook_url } }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/storefront/delivery-config" \2  --header "Authorization: Bearer {{access_token}}"

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "config": {4    "mode": "external",5    "status": "active",6    "external_base_url": "https://example.com/functions/v1",7    "timeout_ms": 15000,8    "retries": 2,9    "last_tested_at": "2025-10-31T12:00:00.000Z",10    "test_result": {},11    "webhook_secret": "{{storefront_webhook_secret}}",12    "webhook_url": "{{base_url}}/storefront/hooks/delivery-status"13  }14}

Update Delivery Config (Internal)

Storefront & Commerce / Storefront Delivery Configuration
PUT/storefront/delivery-config

Switches to internal mode and saves with status=inactive. Response: { success, message, config } with webhook fields null.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/storefront/delivery-config" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "mode": "internal",7  "timeout_ms": 15000,8  "retries": 29}'
Request body
json
1{2  "mode": "internal",3  "timeout_ms": 15000,4  "retries": 25}

Request body fields

modeExample
string

Example field from the request body.

timeout_msExample
number

Example field from the request body.

retriesExample
number

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "message": "delivery_integration_updated_successfully",4  "config": {5    "mode": "internal",6    "status": "inactive",7    "external_base_url": null,8    "timeout_ms": 15000,9    "retries": 2,10    "last_tested_at": null,11    "test_result": null,12    "webhook_secret": null,13    "webhook_url": null14  }15}

Test & Activate External Delivery Config

Storefront & Commerce / Storefront Delivery Configuration
POST/storefront/delivery-config/test

Tests external using request body only. On success: saves and activates, returns { success, status, test_result, config } (with webhook_secret and webhook_url). Errors: external_health_check_error (400), external_health_check_timeout (408).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/storefront/delivery-config/test" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "mode": "external",7  "external_base_url": "{{external_base_url}}",8  "external_api_key": "{{external_api_key}}"9}'
Request body
json
1{2  "mode": "external",3  "external_base_url": "{{external_base_url}}",4  "external_api_key": "{{external_api_key}}"5}

Request body fields

modeExample
string

Example field from the request body.

external_base_urlExample
string

Example field from the request body.

external_api_keyExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "status": "active",4  "test_result": {},5  "config": {6    "mode": "external",7    "status": "active",8    "external_base_url": "{{external_base_url}}",9    "timeout_ms": null,10    "retries": null,11    "last_tested_at": null,12    "test_result": null,13    "webhook_secret": "{{storefront_webhook_secret}}",14    "webhook_url": "{{base_url}}/storefront/hooks/delivery-status"15  }16}

Disable External (Back to Internal)

Storefront & Commerce / Storefront Delivery Configuration
PUT/storefront/delivery-config

Disables external and switches configuration back to internal with status=inactive.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/storefront/delivery-config" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "mode": "external",7  "status": "disabled"8}'
Request body
json
1{2  "mode": "external",3  "status": "disabled"4}

Request body fields

modeExample
string

Example field from the request body.

statusExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "message": "delivery_integration_updated_successfully",4  "config": {5    "mode": "internal",6    "status": "inactive",7    "external_base_url": null,8    "timeout_ms": null,9    "retries": null,10    "last_tested_at": null,11    "test_result": null,12    "webhook_secret": null,13    "webhook_url": null14  }15}

Inbound Delivery Status Webhook (Test Receiver)

Storefront & Commerce / Storefront Delivery Configuration
POST/storefront/hooks/delivery-status

Webhook endpoint to receive delivery status updates. Provide the generated webhook secret in X-API-Key.

Send the tenant API key in X-APIKey or X-API-Key after the key is created and approved.
Request
curl
1curl --request POST "$ONDI_BASE_URL/storefront/hooks/delivery-status" \2  --header "X-API-Key: {{storefront_webhook_secret}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "delivery_id": "EXT-DEL-123",7  "status": "in_transit"8}'
Request body
json
1{2  "delivery_id": "EXT-DEL-123",3  "status": "in_transit"4}

Request body fields

delivery_idExample
string

Example field from the request body.

statusExample
string

Example field from the request body.

Headers

X-API-KeyOptional
header string

{{storefront_webhook_secret}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

List Delivery Services

Storefront & Commerce / Storefront Delivery Configuration
GET/storefront/stores/{{market_id}}/delivery-services?delivery_type_code=on_demand&active=true&search=&page=1&limit=10

List delivery services for the storefront tenant. Only works if delivery integration is enabled (status='active'). Supports both internal and external modes: - Internal mode: Queries delivery_services table directly - External mode: Proxies request to external delivery module API Path parameters: - store_id (market_id): Market ID to determine tenant Query parameters (optional): - delivery_type_code: Filter by delivery type code - active: Filter by active status (default: true) - search: Search by name or code - page: Page number (default: 1) - limit: Items per page (default: 10) Response: { success: true, deliveryServices: [...], page: number, limit: number, total: number }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/storefront/stores/{{market_id}}/delivery-services?delivery_type_code=on_demand&active=true&search=&page=1&limit=10" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

market_idRequired
path string

Variable used inside the request path.

Query parameters

delivery_type_codeOptional
query string

on_demand

Filter by delivery type code (e.g., 'on_demand')

activeOptional
query string

true

Filter by active status (default: true)

searchOptional
query string

Search by name or code

pageOptional
query string

1

Page number (default: 1)

limitOptional
query string

10

Items per page (default: 10)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK - Internal Mode200OK
Response body
json
1{2  "success": true,3  "deliveryServices": [4    {5      "id": "service-uuid",6      "name": "Standard Delivery",7      "code": "standard",8      "description": "Standard delivery service",9      "service_level": "standard",10      "default_price": 5,11      "estimated_delivery_time_min": 30,12      "estimated_delivery_time_max": 60,13      "service_options": {14        "signature_required": false,15        "insurance_available": true16      },17      "unit_min": 1,18      "unit_max": 10,19      "active": true,20      "delivery_type": {21        "id": "type-uuid",22        "code": "on_demand",23        "name": "On Demand"24      }25    }26  ],27  "page": 1,28  "limit": 10,29  "total": 130}
200 OK - External Mode200OK
Response body
json
1{2  "success": true,3  "deliveryServices": [4    {5      "id": "external-service-id",6      "name": "Express Delivery",7      "code": "express",8      "description": "Express delivery from external provider",9      "service_level": "express",10      "default_price": 10,11      "estimated_delivery_time_min": 15,12      "estimated_delivery_time_max": 30,13      "service_options": {14        "signature_required": true,15        "insurance_available": true16      },17      "unit_min": 1,18      "unit_max": 5,19      "active": true,20      "delivery_type": {21        "id": "type-uuid",22        "code": "on_demand",23        "name": "On Demand"24      }25    }26  ],27  "page": 1,28  "limit": 10,29  "total": 130}
400 Bad Request - Market ID Required400Bad Request
Response body
json
1{2  "success": false,3  "message": "market_id_required"4}
404 Not Found - Market Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "market_not_found"4}
400 Bad Request - Integration Not Enabled400Bad Request
Response body
json
1{2  "success": false,3  "message": "delivery_integration_not_enabled"4}