Skip to main content

Shipment Label Batch Internal

1 API call in this section.

Generate Shipment Label Batch (Internal)​

Delivery & Last-Mile / Shipment Label Batch Internal
POST/generate-pdf

This contract applies only to the internal record.delivery_ids batch branch. Existing single-record PDF webhook branches are unchanged. record.delivery_ids must be an array of 1 to 50 distinct non-empty strings, each at most 100 characters. Optional record fields: actor_id, source (defaults to system), correlation_id (1-128 letters/digits/dot/underscore/colon/hyphen), expected_label_versions (delivery-ID to version map), and deadline (Unix milliseconds). HTTP 200 returns per-delivery outcomes and can have success: false; inspect each result. A reached deadline yields an in-progress per-item result without starting that item.

Internal backend/cron only. Send apikey: {{supabase_secret_key}} with the default managed Supabase secret key (SUPABASE_SECRET_KEYS.default). Never put this value in a frontend or mobile application. Missing, invalid, publishable, legacy anon, and legacy service-role bearer credentials return HTTP 401 before work is dispatched. Authorization: Bearer ... alone is not accepted. Frontend handoff: none; application clients must not call this internal endpoint.

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

apikeystring

Default managed Supabase secret key; backend only.

Example: {{supabase_secret_key}}

Body parameters

ParameterTypeDescription
recordobject—
record.delivery_idsarray<string>—
record.actor_idstring—
record.sourcestring—
record.correlation_idstring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/generate-pdf" \2  --header "Content-Type: application/json" \3  --header "apikey: ${SUPABASE_SECRET_KEY}" \4  --data-raw '{5  "record": {6    "delivery_ids": [7      "{{delivery_id}}"8    ],9    "actor_id": "{{actor_id}}",10    "source": "bulk-labels",11    "correlation_id": "internal-label-batch"12  }13}'

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

Internal backend endpoint. Run from a trusted server; keep backend secret keys out of the browser.

Response examples

200OK
Response body
json
1{2  "success": true,3  "delivery_count": 1,4  "success_count": 1,5  "failed_count": 0,6  "results": [7    {8      "delivery_id": "{{delivery_id}}",9      "success": true,10      "status": 20011    }12  ]13}