The Produce API powers the AgroPulse marketplace catalog. Farmers use it to list items for sale — specifying the crop category, price per unit, quantity on hand, and expected harvest date — while buyers and administrators use it to browse and filter the full catalog. Every listing is scoped to aDocumentation 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.
FarmerProfile and exposes a live availability_status that reflects current stock. All endpoints require a valid JWT Bearer token.
Base path
Authentication
All endpoints require a JWT Bearer token in theAuthorization header.
Endpoints
| Method | Path | Description | Auth required |
|---|---|---|---|
GET | /api/produces/ | List produce listings | Yes |
POST | /api/produces/ | Create a new produce listing | Yes |
GET | /api/produces/{id}/ | Retrieve a single listing by UUID | Yes |
PUT | /api/produces/{id}/ | Full update of a produce listing | Yes |
PATCH | /api/produces/{id}/ | Partial update of a produce listing | Yes |
DELETE | /api/produces/{id}/ | Delete a produce listing | Yes |
Create a produce listing
POST /api/produces/
Creates a new Produce listing owned by the specified farmer. The id, created_at, and updated_at fields are set automatically by the server and must not be included in the request body. availability_status defaults to AVAILABLE if omitted.
UUID of the
FarmerProfile that owns this listing.Name of the produce item (max 255 characters). For example,
"Roma Tomatoes".Produce category. Must be one of:
VEGETABLES, FRUITS, GRAINS, DAIRY, MEAT, OTHER.Price per unit in the platform currency. Decimal, up to 2 decimal places (e.g.,
4.50).Number of units currently in stock.
Expected or actual harvest date in
YYYY-MM-DD format.Stock status. Must be one of:
AVAILABLE, LOW_STOCK, SOLD_OUT. Defaults to AVAILABLE.Example request
Example response
Retrieving a single listing via
GET /api/produces/{id}/ returns a farmer_details object in place of farmer_farm_name and farmer_user_full_name. The nested object includes farm_name, farm_location, farmer_name, farmer_email, and farmer_phone.List produce
GET /api/produces/
Returns an array of produce listings ordered by created_at descending. Use the query parameters below to narrow results.
Query parameters
Filter by produce category. One of:
VEGETABLES, FRUITS, GRAINS, DAIRY, MEAT, OTHER.Filter by stock status. One of:
AVAILABLE, LOW_STOCK, SOLD_OUT.Filter by farmer UUID. Returns only listings owned by the specified
FarmerProfile.Full-text search term matched against produce fields.
Sort results by a field name. Prefix with
- for descending order (e.g., -unit_price, harvest_date).Example request
Produce object
UUID primary key. Auto-generated on creation, never editable.
UUID of the
FarmerProfile that owns this listing.Name of the farmer’s farm. Read-only, derived from the linked
FarmerProfile.Full name of the farmer. Read-only, derived from the linked
User account.Name of the produce item.
Produce category. One of:
VEGETABLES, FRUITS, GRAINS, DAIRY, MEAT, OTHER.Price per unit as a decimal string (e.g.,
"4.50").Number of units currently in stock.
Harvest date in
YYYY-MM-DD format.Stock status. One of:
AVAILABLE, LOW_STOCK, SOLD_OUT.ISO 8601 timestamp of listing creation. Read-only.
ISO 8601 timestamp of the last update. Read-only.