Record a customer payment
Admin, branch manager, or cashier. Records a payment and lowers the customer’s balance. The amount must be positive and no more than the balance, and the write is one transaction.
POST
/api/v1/customers/{customerId}/paymentsAuthorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Path parameters
customerIdstringrequiredThe customer paying.
Request body
requiredapplication/jsonamountnumberrequirednotesstringdefault: ""
Responses
201
Payment recorded
ledger_idstringrequiredcustomer_idstringrequiredamount_paidstringrequiredprevious_balancestringrequirednew_balancestringrequiredpaid_atstringrequired400
The amount is not positive, or it exceeds the customer's outstanding balance
detailstringrequired401
Not authenticated
detailstringrequired403
Caller is not an admin, branch manager, pharmacist, or cashier
detailstringrequired404
Customer not found
detailstringrequired