Skip to main content

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.

AgroPulse holds buyer funds in escrow after every successful payment where escrow_enabled is true. Funds stay locked until the linked order’s delivery status reaches DELIVERED. Once released, a farmer payout is created automatically from the payment split. This protects buyers from non-delivery and gives farmers confidence that payment is secured before dispatch.

Endpoints

MethodPathAuthDescription
GET/api/escrow/RequiredList escrow accounts visible to the authenticated user
GET/api/escrow/{id}/RequiredRetrieve a single escrow account
POST/api/escrow/{id}/release_funds/RequiredRelease held funds after delivery is confirmed
GET/api/escrow/held_funds/RequiredList all escrow accounts with HELD status
Farmers see only their own escrow accounts. Staff see all records.

Release funds

Transitions an escrow account from HELD to RELEASED and creates a FARMER payout for the farmer’s share of the payment split. The linked order’s delivery must already be in DELIVERED status; otherwise the request is rejected with 400.
curl -X POST https://api.agropulse.example/api/escrow/c8a3f1b2-9d4e-4a7c-b5e0-123456789abc/release_funds/ \
  -H "Authorization: Bearer <token>"
{
  "id": "c8a3f1b2-9d4e-4a7c-b5e0-123456789abc",
  "payment": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "farmer": "d1e2f3a4-b5c6-7890-abcd-ef0987654321",
  "farmer_name": "Emeka Okafor",
  "amount_held": "15000.00",
  "release_status": "RELEASED",
  "released_at": "2026-05-13T10:30:00Z",
  "created_at": "2026-05-12T08:00:00Z"
}

Release status values

ValueMeaning
HELDFunds are locked pending delivery confirmation
RELEASEDDelivery confirmed; funds disbursed to farmer payout
DISPUTEDA dispute has been raised against this escrow

Query parameters

ParameterTypeDescription
farmerUUIDFilter by farmer profile UUID
release_statusstringFilter by HELD, RELEASED, or DISPUTED
orderingstringSort by created_at or amount_held (prefix - for descending)

EscrowAccount object

id
string
UUID of the escrow account.
payment
string
UUID of the associated payment.
farmer
string
UUID of the FarmerProfile whose funds are held.
amount_held
string
Amount held in escrow (decimal string, NGN).
release_status
string
One of HELD, RELEASED, DISPUTED.
released_at
string
ISO 8601 timestamp when funds were released. null if still held.
created_at
string
ISO 8601 timestamp when the escrow account was created.

Build docs developers (and LLMs) love