AgroPulse processes payments through the Squad payment gateway. When a buyer is ready to pay for an order, your client callsDocumentation 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.
initialize_payment to create a payment record and receive a Squad-hosted checkout_url. The buyer completes payment on that page, after which Squad notifies AgroPulse via webhook and/or you can call verify_payment to confirm the outcome. Successful payments automatically create an escrow account and a payment split record.
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /api/payments/ | Required | List payments visible to the authenticated user |
POST | /api/payments/initialize_payment/ | Required | Start a new payment and receive a checkout URL |
POST | /api/payments/{id}/verify_payment/ | Required | Confirm payment status against Squad |
POST | /api/payments/webhook_callback/ | None | Squad webhook receiver |
GET | /api/payments/my_payments/ | Required | Current user’s payments |
GET | /api/payments/pending_payments/ | Required | All payments with PENDING status |
Initialize payment
Creates aPayment record linked to the given order and returns a Squad checkout_url to redirect the buyer to.
UUID of the order to pay for. The order must not already have a successful payment.
checkout_url. Squad handles card, bank transfer, USSD, and virtual-account channels.
Verify payment
Queries Squad directly for the current transaction status and updates the payment record. If the payment is successful and escrow is enabled, anEscrowAccount and PaymentSplit are created automatically.
Payment object on success, or {"error": "Payment verification failed"} with 400 on failure.
Webhook
Squad callsPOST /api/payments/webhook_callback/ automatically after every transaction outcome. This endpoint requires no authentication but validates the x-squad-signature header using HMAC-SHA512.
Expected payload structure:
status will be "success" or "failed". AgroPulse responds {"status": "received"} with 200 on success.
Payment status values
| Value | Meaning |
|---|---|
PENDING | Payment initiated, buyer has not completed checkout |
SUCCESS | Payment confirmed by Squad |
FAILED | Squad reported a failure or verification failed |
REFUNDED | Payment was refunded |
Payment object
UUID of the payment record.
UUID of the
BuyerProfile who initiated the payment.UUID of the associated order.
One of
PENDING, SUCCESS, FAILED, REFUNDED.Total amount in NGN (decimal string).
NGN or USD.Payment channel used:
CARD, USSD, TRANSFER, or VIRTUAL-ACCOUNT.Squad-hosted checkout URL. Redirect the buyer here to complete payment.
Transaction reference assigned by Squad.
Whether funds are held in escrow after a successful payment. Defaults to
true.ISO 8601 timestamp of payment creation.