Update Payment
Request
PUT:/{accountBookId}/payment
Important Note
When adding or removing detail data rows in payment documents, it is important to ensure that the following tally up:
- the total of the
amount
field values in the Cash Book Entry Detail Input Model array - the total of the
paymentAmt
field values in the Cash Book Entry Payment Detail Input Model array.
Request Parameters
Parameter | Description | Type | |
---|---|---|---|
docNo | Document number of record. | string | required |
Request Body
object: Cash Book Entry Input Model
TEMP OPEN
Example Request Body
Omitting the field in the request body will maintain the original value of the field while leaving the field value blank will remove the existing value of the field in the document.
Update specific fields in master data
Example: Update dealWith
field in master data.
{
"master": {
"dealWith": "Debtor A"
},
"details": [
{}
],
"paymentDetails": [
{}
]
}
Number of array elements:
When updating document detail data, adding fewer array elements than the number of elements originally held by the details array into the request body will result in removal of detail data rows.If document detail data is to remain the same, include a `details` array in request body with empty elements corresponding to the number of existing detail data records.
Example: given there are currently 4 detail data records, the request body would look like this:
"details": [{ }, { }, { }, { }]
Add a detail data row
To add a detail data row, add an additional array element at the end of the details
array of the request body.
Example: Add a new detail data row for payment.
{
"master": {
},
"details": [
{},
{
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"taxCode": "P-10",
"description": "Payment for Account",
"amount": 20.00
}
],
"paymentDetails": [
{
"paymentAmt": 220
}
],
"autoFillOption" : {
"taxCode": true,
"tariffCode": true
},
"saveApprove": null
}
Sequence of the array elements:
When updating document detail data, the sequence of the detail data array matters as the detail data rows are indexed records.When updating a specific detail data row, remember to double check the request body before submitting the request to ensure detail data rows are not unintentionally overwritten.
Update fields in detail data
Example: Update department number in detail data rows.
{
"master": {},
"details": [
{
"deptNo": "D-0001"
},
{
"deptNo": "D-0001"
}
],
"paymentDetails": [{}]
}
In order to carry out the following:
- Add a detail data records to a specific rows position
- Delete a specific detail data row
The details
input array needs to be re-entered with the intended data.
Add a detail data record to a specific row position
Example: Add a new detail data row for payment to the first position of the detail data array.
Re-enter all data in the details
field with the new detail data record at the beginning of the array.
{
"master": {},
"details": [
{
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"taxCode": "P-10",
"description": "Newly added detail data, add to first position in array",
"furtherDescription": null,
"amount": 20.00,
"salesAgent": null,
"taxPermitNo": null,
"taxAdjustment": 0.00,
"taxExportCountry": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRate": 0.000000,
"localTaxAdjustment": 0.00,
"taxRegisterNo": null,
"taxBillDate": null,
"inclusiveTax": true,
"tariffCode": null,
"deptNo": null
},
{
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"taxCode": "P-10",
"description": "Existing detail data",
"furtherDescription": null,
"amount": 200.00,
"salesAgent": null,
"taxPermitNo": null,
"taxAdjustment": 0.00,
"taxExportCountry": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRate": 0.000000,
"localTaxAdjustment": 0.00,
"taxRegisterNo": null,
"taxBillDate": null,
"inclusiveTax": true,
"tariffCode": null,
"deptNo": null
}
],
"paymentDetails": [
{
"paymentAmt": 220
}
],
"autoFillOption" : {
"taxCode": true,
"tariffCode": true
},
"saveApprove": null
}
Delete specific detail data rows
Example Data
Given the document contains the following detail data rows:
{
"master": {...},
"details": [
{
"docKey": 205,
"dtlKey": 533,
"seq": 1,
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"description": "Row A",
"furtherDescription": null,
"amount": 100.00,
"localAmount": 100.00,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": null,
"taxPermitNo": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRegisterNo": null,
"taxBillDate": null,
"amountExTax": 100.00,
"localAmountExTax": 100.00,
"tax": 0.00,
"localTax": 0.00,
"amountWithTax": 100.00,
"localAmountWithTax": 100.00,
"taxCurrencyTax": 0.00,
"taxCurrencyAmountExTax": 100.00,
"salesAgent": null,
"inclusiveTax": true,
"deptNo": null
},
{
"docKey": 205,
"dtlKey": 535,
"seq": 2,
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"description": "Row B",
"furtherDescription": null,
"amount": 200.00,
"localAmount": 200.00,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": null,
"taxPermitNo": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRegisterNo": null,
"taxBillDate": null,
"amountExTax": 200.00,
"localAmountExTax": 200.00,
"tax": 0.00,
"localTax": 0.00,
"amountWithTax": 200.00,
"localAmountWithTax": 200.00,
"taxCurrencyTax": 0.00,
"taxCurrencyAmountExTax": 200.00,
"salesAgent": null,
"inclusiveTax": true,
"deptNo": null
},
{
"docKey": 205,
"dtlKey": 536,
"seq": 3,
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"description": "Row C",
"furtherDescription": null,
"amount": 300.00,
"localAmount": 300.00,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": null,
"taxPermitNo": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRegisterNo": null,
"taxBillDate": null,
"amountExTax": 300.00,
"localAmountExTax": 300.00,
"tax": 0.00,
"localTax": 0.00,
"amountWithTax": 300.00,
"localAmountWithTax": 300.00,
"taxCurrencyTax": 0.00,
"taxCurrencyAmountExTax": 300.00,
"salesAgent": null,
"inclusiveTax": true,
"deptNo": null
}
],
"paymentDetails": [
{
"docKey": 205,
"dtlKey": 534,
"seq": 1,
"paymentMethod": "BANK",
"paymentBy": "CHEQUE",
"chequeNo": null,
"floatDay": 0,
"bankCharge": 0.00,
"paymentAmt": 600.00,
"localPaymentAmt": 600.00,
"bankChargeTaxCode": null,
"bankChargeTaxRate": 0.000000,
"bankChargeTax": 0.00,
"bankChargeTaxRefNo": null,
"toBankRate": 1.000000000000
}
]
}
Example: Remove the detail data row at the first position of the array, with description
value of "Row A".
Re-enter all data in the details
field without the first array element, and tally up the total amount for amount
and paymentAmt
.
{
"master": {},
"details": [
{
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"taxCode": "P-10",
"description": "Row B",
"furtherDescription": null,
"amount": 200.00,
"salesAgent": null,
"taxPermitNo": null,
"taxAdjustment": 0.00,
"taxExportCountry": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRate": 0.000000,
"localTaxAdjustment": 0.00,
"taxRegisterNo": null,
"taxBillDate": null,
"inclusiveTax": true,
"tariffCode": null,
"deptNo": null
},
{
"accNo": "300-D001",
"toAccountRate": 1.000000000000,
"taxCode": "P-10",
"description": "Row C",
"furtherDescription": null,
"amount": 300.00,
"salesAgent": null,
"taxPermitNo": null,
"taxAdjustment": 0.00,
"taxExportCountry": null,
"taxBRNo": null,
"taxBName": null,
"taxRefNo": null,
"taxRate": 0.000000,
"localTaxAdjustment": 0.00,
"taxRegisterNo": null,
"taxBillDate": null,
"inclusiveTax": true,
"tariffCode": null,
"deptNo": null
}
],
"paymentDetails": [
{
"paymentAmt": 500
}
],
"autoFillOption" : {
"taxCode": true,
"tariffCode": true
},
"saveApprove": null
}
Example Request URL:
Parameters:accountBookId
= 1 docNo
= PV-000001 URL:
PUT: https://accounting-api.autocountcloud.com/1/payment?docNo=PV-000001
Response
Success Response
Code: 204
Error Response
Response Body
object: Error Response Model
Example Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}