The Buyers API managesDocumentation 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.
BuyerProfile records for users with the BUYER role on the AgroPulse platform. A buyer profile extends a base User account with purchasing context — a buyer_type that classifies the buyer as an individual, restaurant, or wholesaler, an optional business_name, and a location used to match buyers with nearby produce. All endpoints require a valid JWT Bearer token. The user field on a buyer profile is automatically set to the authenticated user; you do not include it in the request body.
Base path
Authentication
All endpoints require a JWT Bearer token in theAuthorization header.
The
user field is automatically set to the authenticated user when creating a record. You do not need to supply it in the request body.Endpoints
| Method | Path | Description | Auth required |
|---|---|---|---|
GET | /api/buyers/ | List buyer profiles | Yes |
POST | /api/buyers/ | Create a new buyer profile | Yes |
GET | /api/buyers/{id}/ | Retrieve a single buyer profile by UUID | Yes |
PUT | /api/buyers/{id}/ | Full update of a buyer profile | Yes |
PATCH | /api/buyers/{id}/ | Partial update of a buyer profile | Yes |
DELETE | /api/buyers/{id}/ | Delete a buyer profile | Yes |
Create a buyer profile
POST /api/buyers/
Creates a BuyerProfile linked to the authenticated user. The user field is set automatically from the Bearer token and is read-only. Provide a buyer_type to classify the account and a location so the platform can surface relevant produce listings.
Trading or business name of the buyer (max 255 characters). Optional — leave blank for individual buyers.
Classification of the buyer. Must be one of
INDIVIDUAL, RESTAURANT, or WHOLESALER.Physical location or delivery area of the buyer (max 255 characters).
Example request
Example response
List buyers
GET /api/buyers/
Returns an array of buyer profiles ordered by created_at descending. Non-admin users receive only their own profile. Staff users receive all profiles.
Query parameters
Filter results by a search term matched against buyer profile fields.
Sort results by a field name. Prefix with
- for descending order (e.g., -created_at).Example request
BuyerProfile object
UUID primary key. Auto-generated on creation, never editable.
UUID of the linked
User account. Set automatically from the authenticated user. Read-only.Email address of the linked user. Read-only, derived from the
User record.Full name of the linked user. Read-only, derived from the
User record.Trading or business name of the buyer.
null when not provided.Classification of the buyer. One of
INDIVIDUAL, RESTAURANT, or WHOLESALER.Physical location or delivery area of the buyer.
ISO 8601 timestamp of profile creation. Read-only.
ISO 8601 timestamp of the last update. Read-only.