Every AgroPulse account is assigned exactly one role at registration: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.
BUYER, SELLER, or TRANSPORTER. The role is stored on the User model and determines which profile is created for the account, which endpoints the user can call, and what actions they are permitted to take. All authenticated endpoints require a valid JWT Bearer token in the Authorization header.
The three roles
Buyer
Places orders and pays for produce through the Squad checkout. Can be an individual, restaurant, or wholesaler.
Seller (Farmer)
Lists produce for sale, receives and processes orders, and collects earnings via escrow release and payouts.
Transporter
Picks up fulfilled orders from farms and delivers them to buyers. Receives a rider payout after delivery confirmation.
Farmer (SELLER)
A farmer is any user registered withrole: "SELLER". On registration, a FarmerProfile is automatically linked to the user account.
Profile fields
| Field | Type | Description |
|---|---|---|
farm_name | string | The name of the farm or agricultural business |
farm_location | string | Physical location of the farm |
trust_score | decimal (0.00–9.99) | Platform-computed reputation score based on order history |
- List produce items with pricing and quantity
- Receive new order notifications when a buyer places an order
- Move orders from
PAIDtoPROCESSINGonce they begin fulfilling them - Have funds held in escrow after payment and released to their payout account after delivery confirmation
GET /api/produces/— manage produce listingsGET /api/orders/— view incoming ordersPATCH /api/orders/{id}/update_status/— accept and process ordersGET /api/payouts/— view payout history
Buyer (BUYER)
A buyer is any user registered withrole: "BUYER". A BuyerProfile is linked to the account and captures purchasing context.
Profile fields
| Field | Type | Description |
|---|---|---|
business_name | string (optional) | Name of the buyer’s business, if applicable |
buyer_type | enum | One of INDIVIDUAL, RESTAURANT, or WHOLESALER |
location | string | Delivery or pickup location for orders |
- Browse and search produce listings from farmers
- Place orders specifying
delivery_type(PICKUPorDELIVERY) and the desired produce items - Complete payment through a Squad-hosted checkout URL
- Track order progress from
PENDINGthrough toCOMPLETED
GET /api/produces/— browse available producePOST /api/orders/— place a new orderPOST /api/payments/initialize_payment/— start the Squad payment flowGET /api/orders/{id}/— track order status
Transporter (TRANSPORTER)
A transporter is any user registered withrole: "TRANSPORTER". A TransporterProfile records vehicle and coverage details.
Profile fields
| Field | Type | Description |
|---|---|---|
vehicle_type | string | Type of vehicle used for deliveries (e.g., van, motorcycle) |
plate_number | string | Vehicle registration plate number |
service_area | string | Geographic area the transporter covers |
- Are assigned to
DELIVERY-type orders once the farmer has processed them - Transition deliveries through
PENDING→PICKED_UP→IN_TRANSIT→DELIVERED - Receive a
RiderEarningsrecord and aPayout(typeRIDER) after delivery is confirmed
GET /api/deliveries/— view assigned deliveriesPOST /api/deliveries/{id}/start_transit/— mark a delivery as in transitPOST /api/deliveries/{id}/delivery_confirmation/— confirm delivery completionGET /api/payouts/— view payout history
Registration
Roles are set at account creation and cannot be changed after the fact. Send aPOST request to /api/users/ with the role field included in the request body.
FarmerProfile, BuyerProfile, or TransporterProfile) automatically. After registration, obtain a JWT token via POST /api/token/ and use it to authenticate all subsequent requests.
Role permissions
Role membership gates specific actions across the API:| Action | BUYER | SELLER | TRANSPORTER |
|---|---|---|---|
| Browse produce listings | Yes | Yes | — |
| Place an order | Yes | — | — |
| Initialize payment | Yes | — | — |
| Process (accept) an order | — | Yes | — |
| List produce for sale | — | Yes | — |
| Be assigned to a delivery | — | — | Yes |
| Start transit on a delivery | — | — | Yes |
| Confirm delivery completion | — | — | Yes |
| Receive farmer payouts | — | Yes | — |
| Receive rider payouts | — | — | Yes |
403 Forbidden response.