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 } }

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/delivery-config" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200OK
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.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
modestring—
timeout_msnumber—
retriesnumber—
Staging
Request
curl
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/storefront/delivery-config" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "mode": "internal",6  "timeout_ms": 15000,7  "retries": 28}'

Response examples

200OK
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).

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
modestring—
external_base_urlstring—
external_api_keystring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/storefront/delivery-config/test" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "mode": "external",6  "external_base_url": "{{external_base_url}}",7  "external_api_key": "{{external_api_key}}"8}'

Replace {{placeholders}} with your own values before sending.

Response examples

200OK
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.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
modestring—
statusstring—
Staging
Request
curl
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/storefront/delivery-config" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "mode": "external",6  "status": "disabled"7}'

Response examples

200OK
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.

Headers

ParameterTypeDescription
X-API-Keystring

Example: {{storefront_webhook_secret}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
delivery_idstring—
statusstring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/storefront/hooks/delivery-status" \2  --header "X-API-Key: ${STOREFRONT_WEBHOOK_SECRET}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "delivery_id": "EXT-DEL-123",6  "status": "in_transit"7}'

Response examples

No saved response example. Use Try it to inspect a staging response.

List Delivery Services​

Storefront & Commerce / Storefront Delivery Configuration
GET/storefront/stores/{{market_id}}/delivery-services

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

Response

{ success: true, deliveryServices: [...], page: number, limit: number, total: number }

Path parameters

ParameterTypeDescription
market_idRequiredstring

Variable used inside the request path.

store_idstring

(market_id): Market ID to determine tenant

Query parameters

ParameterTypeDescription
delivery_type_codeOptionalstring

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

Example: on_demand

activeOptionalstring

Filter by active status (default: true)

Example: true

searchOptionalstring

Search by name or code

pageOptionalstring

Page number (default: 1)

Example: 1

limitOptionalstring

Items per page (default: 10)

Example: 10

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/stores/${MARKET_ID}/delivery-services?delivery_type_code=on_demand&active=true&search=&page=1&limit=10" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200OK
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}