W3builders
AOP API

AOP API/Payments

Record Payment

POST/finance/documents/{id}/payments
JWT bearerPrimary write endpoint

Record a payment against a document.

Endpoint

POSThttps://api.w3builders.com/v1/finance/documents/{id}/payments

Request body

  • amount (required, > 0, cannot exceed the document's current amount_due)
  • currency (default INR), payment_date (default today), method (default bank_transfer, free text), reference, notes
  • Posts a journal entry (Dr cash/bank, Cr accounts receivable) and recomputes the document's amount_paid / amount_due / status.
  • Auto-generates a linked receipt document.
  • Sends a payment-received email and WhatsApp message to the client if contact details are on file.

Response parameters

FieldType
successvalue
amount_paidvalue
amount_duevalue
statusvalue
Record Payment
curl -X POST https://api.w3builders.com/v1/finance/documents/123/payments \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 45000,
"method": "bank_transfer",
"reference": "UTR123456"
}'
{
"success": true,
"amount_paid": 45000,
"amount_due": 8100,
"status": "partially_paid"
}
Was this page helpful?