AgroPulse ties every delivery to a single order and moves it through a four-stage status lifecycle. Farmers create deliveries when an order is ready to ship; riders confirm pickup and transit; delivery confirmation closes the order and calculates rider earnings automatically.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OluwagbeminiyiA/agro_pulse-API/llms.txt
Use this file to discover all available pages before exploring further.
Delivery status lifecycle
| Status | Meaning |
|---|---|
PENDING | Delivery created, waiting for a rider to be assigned and pick up the order |
PICKED_UP | Rider has collected the produce from the farmer |
IN_TRANSIT | Rider is en route to the buyer |
DELIVERED | Produce has been delivered; order marked COMPLETED |
Delivery model fields
| Field | Type | Description |
|---|---|---|
id | UUID | Primary key, auto-generated |
order | FK | One-to-one link to the Order being delivered |
transporter | FK | The assigned TransporterProfile (nullable) |
delivery_status | string | Current status: PENDING, PICKED_UP, IN_TRANSIT, or DELIVERED |
delivery_address | text | Destination address for the delivery |
picked_up_at | datetime | Timestamp set when pickup is confirmed; null before pickup |
delivered_at | datetime | Timestamp set when delivery is confirmed; null before delivery |
Create a delivery
POST to/api/deliveries/ with the order ID, transporter ID, and delivery address. Only orders with delivery_type set to DELIVERY are eligible.
Find available riders
Retrieve all transporter profiles along with their current workload. A transporter is considered available when they have fewer than 5 active deliveries (statusPENDING, PICKED_UP, or IN_TRANSIT).
Assign a rider
Assign or reassign a transporter to a delivery by providing thetransporter_id in the request body. Assignment fails if the transporter already has 5 active deliveries.
Track delivery status
Move a delivery through each stage using the dedicated action endpoints.Confirm pickup — PENDING → PICKED_UP
The rider calls this endpoint after collecting the produce from the farmer. The This endpoint returns
picked_up_at timestamp is recorded.400 if the delivery is not in PENDING status.Start transit — PICKED_UP → IN_TRANSIT
The rider calls this endpoint when they begin driving to the buyer.This endpoint returns
400 if the delivery is not in PICKED_UP status.Confirm delivery — IN_TRANSIT → DELIVERED
The rider calls this endpoint on successful drop-off. AgroPulse automatically sets This endpoint returns
delivered_at, updates the linked order’s order_status to COMPLETED, and creates a RiderEarnings record worth 10% of the order total.400 if the delivery is not in IN_TRANSIT status.delivery_confirmation triggers automatic escrow release: the linked order’s status is set to COMPLETED and a RiderEarnings record is created for the transporter. No separate escrow call is needed.Filter deliveries
Filter the delivery list by status using thedelivery_status query parameter:
PENDING status (publicly accessible):
delivery_address or buyer business name, and order results by created_at or delivered_at: