Gozem Developer DocsDocs

Deliver a package end to end

Pick a vehicle, price the delivery, book the trip, then read the trip and its invoice once it lands.

Courier5 steps20 min

The path almost every Courier integration takes. Five calls, in order, against https://sandbox-api.gozem.co/courier with a token in GOZEM_ACCESS_TOKEN.

Find out what can carry it

Vehicle availability is per city, not global. Ask what covers your pickup coordinates rather than hardcoding a type, or a booking that works in Lomé fails elsewhere.

Price the delivery

A quote prices one pickup and set of dropoffs, so it is how you find the cost before committing. optimize_route lets Gozem order the dropoffs; leave it off to keep yours.

The quote holds about fifteen minutes, so ask for it when the customer is ready to confirm rather than when they start browsing.

Book it

Booking from a quote is one field and locks in the price you showed.

tracking_url is safe to hand to the customer as it is: the key in it only scopes access to this trip.

You can also skip the quote and post the pickup and dropoffs straight to /v1/trips, at whatever the price turns out to be.

Read the trip when you need detail

Webhooks tell you what changed. Fetch the trip when you need the full picture: rendering an order page, reconciling after downtime, recovering a missed delivery.

driver is absent until the trip is assigned. Do not poll this in a loop.

Pull the invoice

Note the breakdown is not the quote’s. A quote splits the price by what drives the cost, base fare and distance and multi-stop; the invoice splits it per delivery, which is what you bill a customer per stop. Totals agree, line items do not.

Handle the events

The trip is pending when you book it and moves through assigned, at_pickup and started to completed over the next half hour. Subscribe rather than poll:

Event Means
courier.trip.assigned Driver on the way, driver details now on the trip
courier.trip.at_pickup Driver has arrived, a good moment to notify your sender
courier.trip.started Collected, delivery under way
courier.trip.stop.completed One dropoff delivered, fires once per stop
courier.trip.completed Every dropoff delivered
courier.trip.canceled Canceled by you, the driver or the system
courier.trip.expired No driver accepted in time

Handle canceled and expired from the start. A trip that never finds a driver is a normal outcome in a quiet hour, and an integration that only handles the happy path leaves those orders stuck.