Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/microservices-patterns/ftgo-application/llms.txt

Use this file to discover all available pages before exploring further.

The Delivery Service REST API is available at http://localhost:8089. It tracks couriers and dispatches them to pick up and drop off orders. Couriers register their availability through this API, and dispatchers or consumers can query the current state of any delivery.

POST /couriers//availability

Updates whether a courier is currently available to accept delivery assignments. When a courier becomes available, the Delivery Service can assign pending deliveries to them.

Path parameters

courierId
number
required
The unique ID of the courier whose availability is being updated.

Request body

available
boolean
required
Set to true when the courier is available to accept deliveries, or false when they are unavailable.

Response

This endpoint returns no response body. A 200 OK status indicates the availability was updated successfully.

Status codes

CodeMeaning
200 OKCourier availability updated.

Example

curl -s -X POST http://localhost:8089/couriers/1/availability \
  -H "Content-Type: application/json" \
  -d '{
    "available": true
  }'

GET /deliveries/

Returns the current status of a delivery, including its state, the assigned courier, and the list of pending courier actions.

Path parameters

deliveryId
number
required
The unique ID of the delivery to look up.

Response

deliveryInfo
object
Core information about the delivery.
assignedCourier
number
The ID of the courier currently assigned to this delivery, or null if no courier has been assigned yet.
courierActions
array
The ordered list of actions the assigned courier must perform to complete the delivery.

Status codes

CodeMeaning
200 OKDelivery found and status returned.
404 Not FoundNo delivery exists with the given deliveryId.

Example

curl -s http://localhost:8089/deliveries/1

Build docs developers (and LLMs) love