Index | Conventions

api/v1/accounts/debtors/addpayment

Path: api/v1/accounts/debtors/addpayment

This endpoint supports the following methods:
POST

Summary: Adds a new debtors payment

NoteThis call has a fair chance of failing if not submitted via the queue - eg if a user is editing the debtor for which the payment is to be added, this call will fail.

Query Parameters

ParameterOptionalDescription
QueueSet to true, 1, or t to queue the request via the Jim2 eBusiness Queue. If specified the response will be 202 Accepted and the B2B request number will be returned.
Leave out, or set to false, 0, or f to process the request immediately.
SubmitRefIdA unique reference ID for the request. This is used to prevent duplicate requests when the Queue parameter is also passed. If a SubmitRefId is passed via this query parameter and within the request content (see submitRefId in JSON content) then the two values must be the same. A check for duplication due to re-processing on the B2B queue is NOT performed unless the SubmitRefId is included in the request body (ie not passing the SubmitRefId in the message body allows an item on the B2B queue to be reprocessed and potentially creating a duplicate object).
The Queue parameter must also be specified if SubmitRefId is specified.
Note that the SubmitRefId must be unique to Jim2, so if multiple systems are making calls care must be taken to avoid clashes in SubmitRefIds between systems.

Request content

AttributeTypeRequiredDescription
amountnumberThe payment amount.
commentstringThe comment for the payment.
companyNointegerThe company number. Only relevant for multi company databases.
If ommitted defaults to the debtors company if the debtor cardfile is for a particular company, otherwise defaults to 1 (the database default company).
currencyCodestringThe currency code for the payment. If omitted this is the database home currency is assumed.
debtorCardCodestringThe CardFile Card Code for the debtor. You must supply one of debtorCardCode or debtorCardNo to identify the debtor.
debtorCardNointegerThe CardFile Card number for the debtor. You must supply one of debtorCardCode or debtorCardNo to identify the debtor.
glaccountstringthe account into which funds are to be received, this will be unbanked funds if omitted.
invoicesarray of integerThe invoices that the payment should be applied to (if any). The payment will be applied to these invoices in order untill the payment amount is used up, or there are no more invoices (in which case any balance will be left on the payment)
jobNointegerJob number that the prepayment should be linked to (if any).
paymentBystringA valid payment type for debtors per Jim2 setup (ie this sets the Payment By as shown in debtors)
paymentDatestringThe date the payment was received. If omitted the current date will be used. Must be in ISO date format - eg "2023-01-31"

Response content

AttributeTypeDescription
payNointegerThe unique number identifying the payment record that was created. Use it to reference this specific payment.
tranNointegerThe debtor transaction number recorded for this payment. It identifies the payment in the debtor's transaction history and on statements.

Example POST

Path: api/v1/accounts/debtors/addpayment

Request:

{
    "debtorCardCode": "CUST.1",
    "companyNo": 1,
    "paymentBy": "Cash",
    "paymentDate": "2025-03-31",
    "glaccount": "1-1110",
    "amount": 200.50,
    "currencyCode": "AUD",
    "comment": "Payment received via EFT",
    "invoices": [
        4, 7
    ],
    "jobNo": 10
}

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "tranNo": 80432,
    "payNo": 1175
}