Skip to main content

POST /v1/delivery/quote

POST /v1/delivery/quote

ScopeIdempotency-KeyOperation ID
quotes.createOptionalcreateQuote

Authoritative quote with expiry and pricing version.

The caller supplies intent and coordinates, never a distance or price (any server-controlled field is SERVER_CONTROLLED_FIELD). The server resolves both pins, applies the tenant's gateways, zones and vehicle types, checks the vehicle for this delivery, measures the verified road distance and prices it with the ACTIVE pricing version. Quote creation is audited. Past the tenant's maximum verified distance the quote is LOCATION_NOT_SUPPORTED (reason: max_distance). If routing fails, a pre-approved fallback may price it; with none, PRICING_UNAVAILABLE. The quote expires at expires_at by the server clock; after that it cannot be confirmed (QUOTE_EXPIRED). breakdown appears only when the tenant has detailed pricing visibility. Idempotency-Key optional: a retry with the same key replays the same quote instead of issuing another.

Request​

Signed with your API credential: see Authentication.

ParameterInRequiredDescription
Idempotency-KeyheaderNoOne key per user intent, reused for every retry of that intent. See Idempotency.

Body​

FieldTypeRequiredDescription
pickupobjectYes
pickup.latitudenumberYesWGS84; precision is judged as sent
pickup.longitudenumberYes
pickup.accuracy_mnumberNo
dropoffobjectYes
dropoff.latitudenumberYesWGS84; precision is judged as sent
dropoff.longitudenumberYes
dropoff.accuracy_mnumberNo
vehicle_typestringYesA catalogue code available for this delivery (GET /v1/vehicle-types)
service_typestringYesOne of: EXPRESS, PRIORITY, STANDARD, NEXT_DAY.
external_order_referencestringNoThe tenant's own order handle; IDM stores nothing else about the order Pattern ^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,63}$.

Responses​

200​

The quote.

FieldTypeRequiredDescription
quote_referencestringYesPattern ^QT-[0-9A-HJKMNP-TV-Z]{8}$.
currencystringYesOne of: GHS.
delivery_feestringYesExact decimal with two places; never a JSON number. Pattern ^-?[0-9]+\.[0-9]{2}$.
classificationstringYesOne of: INTRA_ZONE, INTER_ZONE, INTER_GATEWAY.
vehicle_typestringYes
service_typestringYesOne of: EXPRESS, PRIORITY, STANDARD, NEXT_DAY.
pricing_versionstringYes
expires_atstring, date-timeYesServer clock; the quote cannot be confirmed after it
pickupobjectYes
pickup.suburbobjectYes
pickup.suburb.referencestringYesPattern ^SUB-[0-9A-HJKMNP-TV-Z]{8}$.
pickup.suburb.namestringYes
pickup.descriptionstringYes
pickup.approximatebooleanYes
dropoffobjectYes
dropoff.suburbobjectYes
dropoff.suburb.referencestringYesPattern ^SUB-[0-9A-HJKMNP-TV-Z]{8}$.
dropoff.suburb.namestringYes
dropoff.descriptionstringYes
dropoff.approximatebooleanYes
estimatedobjectYes
estimated.pickup_window_mininteger or nullYesNull until dispatch supply data can support it; never an invented figure
estimated.delivery_duration_mininteger or nullYesFrom the route's duration; null when a fallback priced the quote
external_order_referencestring or nullYes
breakdownobjectNoReturned only with detailed pricing visibility. Distances 2 dp, rates and modifiers 4 dp.
breakdown.verified_distance_kmstring or nullYes
breakdown.included_distance_kmstringYes
breakdown.chargeable_distance_kmstring or nullYes
breakdown.base_feestring or nullYes
breakdown.distance_ratestring or nullYes
breakdown.distance_surchargestring or nullYes
breakdown.zone_multiplierstringYes
breakdown.peak_modifierstringYes
breakdown.season_modifierstringYes
breakdown.classification_multiplierstring or nullYesNull when multiplier enforcement is off for the scope
breakdown.fallback_appliedbooleanYesAn approved fallback priced the quote

400​

Structural validation failed or an Idempotency-Key is missing.

The error envelope: code, message, detail, request_id.

401​

Unknown, revoked or wrong-environment credential, bad signature, or expired session.

The error envelope: code, message, detail, request_id.

403​

Tenant access denied (existence is not disclosed), insufficient scope, MFA/step-up required, partner blocked or module disabled.

The error envelope: code, message, detail, request_id.

404​

No such route, or no such resource visible to the caller.

The error envelope: code, message, detail, request_id.

409​

State changed, race lost, or idempotency conflict. Refetch before deciding again.

The error envelope: code, message, detail, request_id.

422​

Semantically invalid (location, vehicle, server-controlled field, bulk limits).

The error envelope: code, message, detail, request_id.

429​

Rate limit reached; honour Retry-After.

The error envelope: code, message, detail, request_id.

500​

Unexpected failure. Only code and request_id are returned.

The error envelope: code, message, detail, request_id.

503​

Pricing/routing unavailable, request timeout, retryable contention, or an operator must act first (ACCOUNTING_PERIOD_UNAVAILABLE, outcome REQUIRES_ADMIN), or the payment provider cannot start a payment (PAYMENT_PROVIDER_UNAVAILABLE, outcome REQUIRES_PAYMENT; nothing charged).

The error envelope: code, message, detail, request_id.