Bulk Delivery Order Creations
10 API calls in this section.
Request Signed Upload URL
/delivery/bulk-order-creations/upload-url?tenant_id=&language=enStep 1 of the bulk import flow. Returns a one-time signed PUT URL the client uploads the file to. The returned file_key must be passed back to Create Bulk Order Creation Job. Request Body: - file_name (required): original file name; extension must be csv, xls, or xlsx. - file_size_bytes (optional): if provided, must be ≤ 15 MB (15728640 bytes). Validation: - Unsupported extension → 400 unsupported_file_extension - File too large → 413 file_too_large (limit returned in response) Permissions: manage:operations:tenant or system admin.
1curl --request POST "$ONDI_BASE_URL/delivery/bulk-order-creations/upload-url?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 "file_name": "orders_batch_a.csv",7 "file_size_bytes": 5242888}'1{2 "file_name": "orders_batch_a.csv",3 "file_size_bytes": 5242884}Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
file_nameExampleExample field from the request body.
file_size_bytesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Upload File To Signed URL (Client Side)
/{{upload_url}}Step 2 of the bulk import flow. Client PUTs the file bytes directly to the signed URL returned by Request Signed Upload URL. No tenant headers — the URL is pre-authorized. Use the matching Content-Type: - text/csv for .csv - application/vnd.ms-excel for .xls - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for .xlsx
1curl --request PUT "$ONDI_BASE_URL/{{upload_url}}" \2 --header "Content-Type: text/csv"Path parameters
upload_urlRequiredVariable used inside the request path.
Headers
Content-TypeOptionaltext/csv
Responses
No response example is available for this endpoint yet.
Create Bulk Order Creation Job
/delivery/bulk-order-creations?tenant_id=&language=enStep 3 of the bulk import flow. Creates the job row, verifies the file at file_key exists in storage, then kicks off the background worker. Returns 202 with the job row. Request Body: - name (optional): human-friendly label for the import - source_view (required): dispatcher | admin - customer_id (required, UUID): tenant customer the deliveries are billed to / created for - delivery_service_id (required, UUID): determines delivery_type_id server-side; do NOT send delivery_type_id - payer_type (required): sender | receiver - payment_method (required): wallet | cod | card | etc. - mappings (required, object): maps your CSV header names → worker logical fields - total_records (optional, int): client-side row count for UI; the worker reads the actual count from the file - file_key (required): exact value returned by upload-url — the server uses the full storage key as the idempotency token (same file_key returns the existing job) - file_kind (required): csv | xls | xlsx - file_size_bytes (optional) Logical fields (used as mappings values): - Required: pickup_full_address, pickup_latitude, pickup_longitude, pickup_city, pickup_country, delivery_full_address, delivery_latitude, delivery_longitude, delivery_city, delivery_country, delivery_contact_name, delivery_contact_phone - Optional: external_reference_id, cod_amount, package_special_instructions, package_items (CSV cell holds a JSON array string) Row behavior: - unit_size is calculated from package_items using the same package-based logic as direct delivery creation. - If external_reference_id already exists on another delivery, that row is marked failed with external_reference_id_already_present. Permissions: manage:operations:tenant or system admin.
1curl --request POST "$ONDI_BASE_URL/delivery/bulk-order-creations?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 "name": "Q2 storefront orders – batch A",7 "source_view": "dispatcher",8 "customer_id": "uuid",9 "delivery_service_id": "uuid",10 "payer_type": "sender",11 "payment_method": "wallet",12 "mappings": {13 "Pickup Address": "pickup_full_address",14 "Pickup Lat": "pickup_latitude",15 "Pickup Lng": "pickup_longitude",16 "Pickup City": "pickup_city",17 "Pickup Country": "pickup_country",18 "Drop Address": "delivery_full_address",19 "Drop Lat": "delivery_latitude",20 "Drop Lng": "delivery_longitude",21 "Drop City": "delivery_city",22 "Drop Country": "delivery_country",23 "Recipient Name": "delivery_contact_name",24 "Recipient Phone": "delivery_contact_phone",25 "Reference": "external_reference_id",26 "COD": "cod_amount",27 "Notes": "package_special_instructions",28 "Items": "package_items"29 },30 "total_records": 50,31 "file_key": "imports/<tenant_id>/<uuid>/original.csv",32 "file_kind": "csv",33 "file_size_bytes": 52428834}'1{2 "name": "Q2 storefront orders – batch A",3 "source_view": "dispatcher",4 "customer_id": "uuid",5 "delivery_service_id": "uuid",6 "payer_type": "sender",7 "payment_method": "wallet",8 "mappings": {9 "Pickup Address": "pickup_full_address",10 "Pickup Lat": "pickup_latitude",11 "Pickup Lng": "pickup_longitude",12 "Pickup City": "pickup_city",13 "Pickup Country": "pickup_country",14 "Drop Address": "delivery_full_address",15 "Drop Lat": "delivery_latitude",16 "Drop Lng": "delivery_longitude",17 "Drop City": "delivery_city",18 "Drop Country": "delivery_country",19 "Recipient Name": "delivery_contact_name",20 "Recipient Phone": "delivery_contact_phone",21 "Reference": "external_reference_id",22 "COD": "cod_amount",23 "Notes": "package_special_instructions",24 "Items": "package_items"25 },26 "total_records": 50,27 "file_key": "imports/<tenant_id>/<uuid>/original.csv",28 "file_kind": "csv",29 "file_size_bytes": 52428830}Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
nameExampleExample field from the request body.
source_viewExampleExample field from the request body.
customer_idExampleExample field from the request body.
delivery_service_idExampleExample field from the request body.
payer_typeExampleExample field from the request body.
payment_methodExampleExample field from the request body.
mappingsExampleExample field from the request body.
mappings.Pickup AddressExampleExample field from the request body.
mappings.Pickup LatExampleExample field from the request body.
mappings.Pickup LngExampleExample field from the request body.
mappings.Pickup CityExampleExample field from the request body.
mappings.Pickup CountryExampleExample field from the request body.
mappings.Drop AddressExampleExample field from the request body.
mappings.Drop LatExampleExample field from the request body.
mappings.Drop LngExampleExample field from the request body.
mappings.Drop CityExampleExample field from the request body.
mappings.Drop CountryExampleExample field from the request body.
mappings.Recipient NameExampleExample field from the request body.
mappings.Recipient PhoneExampleExample field from the request body.
mappings.ReferenceExampleExample field from the request body.
mappings.CODExampleExample field from the request body.
mappings.NotesExampleExample field from the request body.
mappings.ItemsExampleExample field from the request body.
total_recordsExampleExample field from the request body.
file_keyExampleExample field from the request body.
file_kindExampleExample field from the request body.
file_size_bytesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
List Bulk Order Creations
/delivery/bulk-order-creations?page=1&limit=20&status=&search=&tenant_id=&language=enPaginated list of bulk import jobs for the current tenant, newest first. Permissions: manage:operations:tenant or system admin.
1curl --request GET "$ONDI_BASE_URL/delivery/bulk-order-creations?page=1&limit=20&status=&search=&tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Query parameters
pageOptional1
Page number for pagination
limitOptional20
Items per page (max 200)
statusOptionalFilter by status (pending | processing | completed | failed)
searchOptionalilike match on name OR idempotency_key
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Get Bulk Order Creation
/delivery/bulk-order-creations/:jobId?tenant_id=&language=enReturns the full job row plus signed download URLs (original_signed_url, success_signed_url, failed_signed_url), the event_timeline array (milestones: file_accepted, mapping_received, import_started, import_completed / import_failed), and failed_order_logs (per-row diagnostics). Permissions: manage:operations:tenant or system admin.
1curl --request GET "$ONDI_BASE_URL/delivery/bulk-order-creations/:jobId?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
jobIdRequireduuid
Bulk order creation job ID
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Download Success CSV
/delivery/bulk-order-creations/:jobId/success-csv?tenant_id=&language=en302 redirect to a signed URL for success.csv. Each CSV row carries the original CSV columns plus a delivery_id column. Returns 404 csv_not_ready if the worker has not yet generated the file.
1curl --request GET "$ONDI_BASE_URL/delivery/bulk-order-creations/:jobId/success-csv?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
jobIdRequireduuid
Bulk order creation job ID
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Download Failed CSV
/delivery/bulk-order-creations/:jobId/failed-csv?tenant_id=&language=en302 redirect to a signed URL for failed.csv. Each CSV row carries the original CSV columns plus row_number, error_field, error_code columns. Returns 404 csv_not_ready if the worker has not yet generated the file.
1curl --request GET "$ONDI_BASE_URL/delivery/bulk-order-creations/:jobId/failed-csv?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
jobIdRequireduuid
Bulk order creation job ID
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Resume Job (Internal Cron)
/delivery/bulk-order-creations/:jobId/_resumeInternal cron-only hook invoked by the watchdog when a processing job's lease has expired. Re-triggers the worker, which re-runs all rows from the start; rows that already produced a delivery for the same bulk job are counted as success on recovery, while external-reference collisions with other deliveries remain row failures. Skips authentication.
1curl --request POST "$ONDI_BASE_URL/delivery/bulk-order-creations/:jobId/_resume" \2 --header "Authorization: Bearer $ONDI_ACCESS_TOKEN"Path parameters
jobIdRequireduuid
Bulk order creation job ID
Responses
Abort Job
/delivery/bulk-order-creations/:jobId/abort?tenant_id=&language=enMarks a pending or processing job as cancelled and stops the worker from processing remaining rows. The job's worker_lease_id is cleared — any in-flight worker invocation will fail its next refreshLease call and exit cleanly. Already-created deliveries are kept (not deleted automatically). Use DELETE /:id/deliveries if you want to remove them. Errors: - job_not_found 404 — unknown ID or wrong tenant - job_already_terminal 409 — job status is already completed, failed, or cancelled - insufficient_permissions 403 Permissions: manage:operations:tenant or system admin.
1curl --request POST "$ONDI_BASE_URL/delivery/bulk-order-creations/:jobId/abort?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
jobIdRequireduuid
Bulk order creation job ID
Query parameters
tenant_idOptionalTenant ID
languageOptionalen
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Delete Job Deliveries
/delivery/bulk-order-creations/:jobId/deliveries?tenant_id=&language=enSoft-deletes all delivery records (deleted_at set to now) that were created by this bulk import job. Only allowed when the job is in a terminal state (cancelled, completed, or failed). If the job is still pending or processing, abort it first. Returns: deleted_count — number of deliveries that were soft-deleted. Errors: - job_not_found 404 - job_still_running 409 — job is still active; abort first - insufficient_permissions 403 Permissions: manage:operations:tenant or system admin.
1curl --request DELETE "$ONDI_BASE_URL/delivery/bulk-order-creations/:jobId/deliveries?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
jobIdRequireduuid
Bulk order creation job ID
Query parameters
tenant_idOptionalTenant ID
languageOptionalen
Headers
AuthorizationOptionalBearer {{access_token}}