Skip to main content

Payments

Payments are money received from customers or paid to vendors, allocated against one or more transactions.

Payment types (paymentHeader.paymentType): CustomerPayment, VendorPayment, SalesReturnAllocation, PurchaseReturnAllocation.

Record a payment​

POST /txndata/upsertPayment — Permission: CustomerPayment · Write or VendorPayment · Write — multipart/form-data

Form fieldTypeNotes
paymentDtostring (JSON)Required. A Payment object serialised to a JSON string.
filefileOptional attachment.

Response 200:

{ "message": "Transaction Saved!" }

Validation rules (each violation returns 400):

  • paymentHeader.totalAmt must equal paymentAmt + discountAmt + withHoldingAmt + otherChargesAmt.
  • paymentHeader.paymentAcct (the bank or cash account) is required for CustomerPayment and VendorPayment.
  • The sum of paymentLines[].allocAmt cannot exceed totalAmt.
  • Each line's allocAmt cannot exceed what is actually still due on that transaction — the server checks the live balance, not the dueAmt you send.
  • You cannot pay a cancelled transaction.
  • A payment linked to a bank transaction cannot have its amount, date or account changed.
  • The payment date cannot be in a locked financial year.

Example: customer payment against the invoice above​

curl -X POST "$BASE_URL/txndata/upsertPayment" \
-H "x-api-key: YOUR_API_KEY" \
-F 'paymentDto={
"paymentHeader": {
"paymentId": "a1b2c3d4-0000-4000-8000-00000000abcd",
"paymentType": "CustomerPayment",
"paymentNo": "PMT-0007",
"paymentDate": "2026-09-26",
"contactId": "c3b1f0e2-6a52-4c1a-9d0e-2f6b9a7d1e10",
"contactName": "Acme Traders",
"paymentAmt": 1180,
"totalAmt": 1180,
"paymentAcct": "BANK_ACCOUNT_ID",
"paymentMode": "Bank Transfer"
},
"paymentLines": [
{
"txnId": "5d0c9a7e-3b1f-4a52-8c64-0e9f2b7a1c88",
"txnNo": "INV-0042",
"totalAmt": 1180,
"dueAmt": 1180,
"allocAmt": 1180
}
]
}'

Read payments​

EndpointPermissionDescription
GET /txndata/getPayments/{paymentType}CustomerPayment · Read or VendorPayment · ReadQuery dateFilter (JSON, required). Returns Payment[], or 204.
GET /txndata/getPayment/{paymentId}CustomerPayment · Read or VendorPayment · ReadOne Payment, or 404.
GET /txndata/getPaymentsByTxnId/{txnId}any roleAll payments allocated to a transaction, or 204.
GET /txndata/getPaymentsByReturnId/{returnTxnId}any roleAll payments/allocations for a return transaction, or 204.
GET /txndata/getReturnPayment/{returnTxnId}Read on a transaction typeThe refund payment for a return transaction, or 404.
GET /txndata/getPaymentView/{paymentId}CustomerPayment · Read or VendorPayment · ReadThe payment receipt rendered as an HTML string.

Delete payments​

EndpointPermissionDescription
DELETE /txndata/deletePayment/{paymentId}CustomerPayment · Full or VendorPayment · FullReturns { "message": "Delete Success!" }.
DELETE /txndata/bulkDeletePaymentCustomerPayment · Full or VendorPayment · FullBody: { "paymentIds": ["id1","id2"] }. Same response shape as bulkDeleteTxn.

Send a payment receipt​

POST /txndata/sendPayment — Permission: CustomerPayment · Write or VendorPayment · Write. Emails a payment receipt to up to 3 recipients. Body and limits are the same as sendTxn (including the required htmlContent); rate-limited to 3 per 10 minutes.


Data model​

Only the commonly used properties are listed. Unless marked required, every property is optional. Properties that the server sets itself (bizId, createdBy, modifiedBy, app, and creation/modification timestamps) should be left out of requests. The OpenAPI document has the complete definitions.

Payment​

{
"paymentHeader": { },
"paymentLines": [ ]
}

paymentHeader​

PropertyTypeNotes
paymentIdstringRequired. Caller-generated unique ID.
paymentTypestringCustomerPayment, VendorPayment, SalesReturnAllocation, PurchaseReturnAllocation.
paymentNostringYour receipt/payment number.
paymentDatedate
contactId, contactNamestring
paymentAmtnumberMoney actually paid.
discountAmt, withHoldingAmt, otherChargesAmtnumber
totalAmtnumberMust equal paymentAmt + discountAmt + withHoldingAmt + otherChargesAmt.
paymentAcctstringRequired for customer and vendor payments. The bank or cash account ID.
paymentModestringFor example Cash, Bank Transfer, Cheque.
currencyId, fxRateAmtstring, number
reference, notesstring
isAdvancePaymentbooleanAn unallocated advance from the contact.
returnTxnId, cashRefundAcct, cashRefundAmtmixedFor refunds against returns.
tagsstring[]

paymentLines[]​

PropertyTypeNotes
txnIdstringThe transaction being paid.
txnNo, txnDatestring, dateFor display.
totalAmtnumberThe transaction's total.
dueAmtnumberBalance due when you read it.
allocAmtnumberAmount of this payment applied to the transaction.
discountAmtnumberSettlement discount on this line.
deleteFlagbooleantrue to remove the allocation when updating.