Skip to main content

Update Knock Off Entry

Request

PUT:/{accountBookId}/knockOffEntry

Request Parameters

ParameterDescriptionType
docNoDocument number of record.stringrequired

Request Body

object: Knock Off Entry Input Model

Example Request Body
caution
When updating document master data, only the fields to be updated need to be added to the request body. Fields that do not need to be updated should be omitted entirely instead of being left with a blank value.

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 reason field in master data.

{
"master": {
"deptNo": "D-0001"
},
"details": [{},{}]
}
caution

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 rows

To add more detail data rows to be knocked off, add additional array elements at the end of the details array of the request body.

Example: Add detail data rows to be knocked off.

{
"master": {},
"details": [
{},
{},
{
"docNo": "JV-000004",
"docType": "JE",
"knockOffAmount": 472.50
},
{
"docNo": "CN-000002",
"docType": "CN",
"knockOffAmount": -472.50
}
]
}
caution

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
Original document detail values before update
{
"master": {...},
"details": [
{
"docNo": "JV-000003",
"docType": "JE",
"knockOffAmount": 472.50
},
{
"docNo": "CN-000001",
"docType": "CN",
"knockOffAmount": -472.50
}
]
}

Example: Update docNo and docType fields in detail data rows to knock off a different document with unchanged knock off amount.

{
"master": {},
"details": [
{
"docNo": "IV-000003",
"docType": "IV"
},
{
"docNo": "JV-000001",
"docType": "JV"
}
]
}
caution

Be mindful of the sequence when updating detail data rows, it is important to pay attention to the sign value of each row.

Certain documents can have different knockOffAmount values depending on whether they are debit or credit. Refer to the "KnockOffAmount" table here for more info.

Example knock off detail data

PI (-)

{
"docNo": "PI-000001",
"docType": "PI",
"knockOffAmount": -472.50
}

PR (+)

{
"docNo": "PR-000001",
"docType": "PR",
"knockOffAmount": 472.50
}

OR (+)(-)

{
"docNo": "OR-000002",
"docType": "OR",
"knockOffAmount": -472.50
}

PV (+)(-)

{
"docNo": "PV-000009",
"docType": "PV",
"knockOffAmount": 472.50
}

Example Scenarios:

Replacing detail data rows to be knocked off

When replacing detail data rows to be knocked off, try to maintain the sign value of the rows.

Example:

Based on the example knock off detail data above, the PI document is being knocked off against the PR document.

If the PI document is to be replaced in knock off details, the OR document should be added in its place as they are both Credit amount values.

It is important to pay attention to this, especially for Journal Entry (JE), Purchase Vourcher (PV) and Receipt Voucher (OR) documents as these documents can be have either Debit or Credit amount values.

Removing a detail data row for knock off entry

When removing a detail data row for knock off entry, make sure to remove the corresponding row its being knocked off against.

Example:

Based on the example knock off detail data above, the PI document is being knocked off against the PR document.

If the PI document is removed from the detail data rows, the PR document it is being knocked off againsts should be removed as well in order to avoid errors caused by credit amount not being equal to debit amount.

Example Request URL:

Parameters:
accountBookId = 1
docNo = KO-000001

URL:
PUT: https://accounting-api.autocountcloud.com/1/knockOffEntry?docNo=KO-000001

Response

Success Response

Code: 204

Error Response

Response Body

object: Error Response Model

Example Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}