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.

After escrow funds are released, AgroPulse creates payout records for the farmer and, where applicable, the rider. Each payout tracks the disbursement lifecycle from PENDING through PROCESSING to COMPLETED. Farmers and riders can view their own payouts; admin staff have full access and can process batches or mark individual payouts completed.

Endpoints

MethodPathAuthDescription
GET/api/payouts/RequiredList payouts visible to the authenticated user
POST/api/payouts/RequiredCreate a payout manually
GET/api/payouts/{id}/RequiredRetrieve a single payout
PUT/api/payouts/{id}/RequiredReplace a payout record
PATCH/api/payouts/{id}/RequiredPartially update a payout record
DELETE/api/payouts/{id}/RequiredDelete a payout record
POST/api/payouts/{id}/mark_completed/RequiredMark a payout as completed with a bank reference
GET/api/payouts/my_payouts/RequiredCurrent user’s payouts (farmer or rider)
GET/api/payouts/pending_farmer_payouts/Staff onlyAll pending farmer payouts

Payout type and status values

payout_type
ValueDescription
FARMERDisbursement to the farmer who fulfilled the order
RIDERDisbursement to the transporter who delivered the order
payout_status
ValueDescription
PENDINGPayout created, not yet actioned
PROCESSINGBatch processing has started
COMPLETEDBank transfer confirmed; completed_at is set
FAILEDTransfer attempt failed

Create a payout

payment
string
required
UUID of the associated Payment.
payout_type
string
required
FARMER or RIDER.
amount
number
required
Amount to disburse in NGN.
farmer
string
UUID of the FarmerProfile. Required when payout_type is FARMER.
rider
string
UUID of the TransporterProfile. Required when payout_type is RIDER.
curl -X POST https://api.agropulse.example/api/payouts/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "payment": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "payout_type": "FARMER",
    "farmer": "d1e2f3a4-b5c6-7890-abcd-ef0987654321",
    "amount": 12000.00
  }'
{
  "id": "9b8a7c6d-5e4f-3a2b-1c0d-abcdef012345",
  "payment": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "farmer": "d1e2f3a4-b5c6-7890-abcd-ef0987654321",
  "farmer_name": "Emeka Okafor",
  "rider": null,
  "rider_name": null,
  "payout_type": "FARMER",
  "amount": "12000.00",
  "payout_status": "PENDING",
  "bank_reference": null,
  "completed_at": null,
  "created_at": "2026-05-13T10:35:00Z"
}

Mark payout completed

Transitions a payout in PENDING or PROCESSING status to COMPLETED. Requires a bank_reference from the external transfer. Also updates the corresponding PaymentSplit processing flag.
bank_reference
string
required
Bank or Squad transfer reference confirming the disbursement.
curl -X POST https://api.agropulse.example/api/payouts/9b8a7c6d-5e4f-3a2b-1c0d-abcdef012345/mark_completed/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"bank_reference": "TRF_BANK_REF_20260513"}'

Query parameters

ParameterTypeDescription
payout_statusstringFilter by PENDING, PROCESSING, COMPLETED, or FAILED
payout_typestringFilter by FARMER or RIDER
orderingstringSort by created_at or amount (prefix - for descending)

Payout object

id
string
UUID of the payout record.
payment
string
UUID of the associated payment.
farmer
string
UUID of the FarmerProfile recipient. null for rider payouts.
rider
string
UUID of the TransporterProfile recipient. null for farmer payouts.
payout_type
string
One of FARMER or RIDER.
amount
string
Disbursement amount in NGN (decimal string).
payout_status
string
One of PENDING, PROCESSING, COMPLETED, FAILED.
bank_reference
string
External bank or transfer reference. null until completed.
completed_at
string
ISO 8601 timestamp when the payout was marked completed. null until then.
created_at
string
ISO 8601 timestamp of payout creation.

Build docs developers (and LLMs) love