Update Journal Entry
Request
PUT:/{accountBookId}/journalEntry
Request Parameters
Parameter | Description | Type | |
---|---|---|---|
docNo | Document number of record. | string | required |
Request Body
object: Journal Entry Input Model
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 description
field in master data.
{
"master": {
"description": "Payment for I-000006"
},
"details": [{},{}]
}
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 invoice document.
{
"master": {},
"details": [
{},
{},
{
"accNo": "300-D003",
"toAccountRate": 1,
"description": "Payment for I-000004",
"dr": 0,
"cr": 200,
"inclusiveTax": true
},
{
"accNo": "310-1000",
"toAccountRate": 1,
"description": "Payment for I-000004",
"dr": 200,
"cr": 0,
"inclusiveTax": true
}]
}
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 salesAgent
field in detail data rows.
{
"master": {},
"details": [
{
"salesAgent": "Ali"
},
{
"salesAgent": "Ali"
}
]
}
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 with DR
and CR
values of "20" to the first 2 row of the detail data records.
Re-enter all data in the details
field with the new records at the beginning of the array.
{
"master": {},
"details": [
{
"accNo": "300-D003",
"toAccountRate": 1,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 0,
"cr": 20,
"taxCode": "",
"taxAdjustment": 0,
"localTaxAdjustment": 0,
"tariffCode": "",
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"salesAgent": "",
"name": "",
"inclusiveTax": true,
"deptNo": ""
},
{
"accNo": "310-1000",
"toAccountRate": 1,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 20,
"cr": 0,
"taxCode": "",
"taxAdjustment": 0,
"localTaxAdjustment": 0,
"tariffCode": "",
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"salesAgent": "",
"name": "",
"inclusiveTax": false,
"deptNo": ""
},
{
"accNo": "300-D003",
"toAccountRate": 1,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 0,
"cr": 825,
"taxCode": "",
"taxAdjustment": 0,
"localTaxAdjustment": 0,
"tariffCode": "",
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"salesAgent": "",
"name": "",
"inclusiveTax": true,
"deptNo": ""
},
{
"accNo": "310-1000",
"toAccountRate": 1,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 825,
"cr": 0,
"taxCode": "",
"taxAdjustment": 0,
"localTaxAdjustment": 0,
"tariffCode": "",
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"salesAgent": "",
"name": "",
"inclusiveTax": false,
"deptNo": ""
}
],
"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": 315,
"dtlKey": 734,
"seq": 1,
"accNo": "300-D003",
"toAccountRate": 1.000000000000,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": null,
"cr": 20.00,
"localDR": null,
"localCR": 20.00,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxBName": null,
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"taxDR": null,
"taxCR": null,
"localTaxDR": null,
"localTaxCR": null,
"totalDR": null,
"totalCR": 20.00,
"localTotalDR": null,
"localTotalCR": 20.00,
"totalDRExTax": null,
"totalCRExTax": null,
"localTotalDRExTax": null,
"localTotalCRExTax": null,
"taxCurrencyTaxDR": null,
"taxCurrencyTaxCR": null,
"taxCurrencyDR": null,
"taxCurrencyCR": 20.00,
"salesAgent": null,
"inclusiveTax": true,
"name": "",
"deptNo": null
},
{
"docKey": 315,
"dtlKey": 735,
"seq": 2,
"accNo": "310-1000",
"toAccountRate": 1.000000000000,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 20.00,
"cr": null,
"localDR": 20.00,
"localCR": null,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxBName": null,
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"taxDR": null,
"taxCR": null,
"localTaxDR": null,
"localTaxCR": null,
"totalDR": 20.00,
"totalCR": null,
"localTotalDR": null,
"localTotalCR": null,
"totalDRExTax": null,
"totalCRExTax": null,
"localTotalDRExTax": null,
"localTotalCRExTax": null,
"taxCurrencyTaxDR": null,
"taxCurrencyTaxCR": null,
"taxCurrencyDR": 20.00,
"taxCurrencyCR": null,
"salesAgent": null,
"inclusiveTax": false,
"name": "",
"deptNo": null
},
{
"docKey": 315,
"dtlKey": 746,
"seq": 3,
"accNo": "300-D003",
"toAccountRate": 1.000000000000,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": null,
"cr": 825.00,
"localDR": null,
"localCR": 825.00,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxBName": null,
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"taxDR": null,
"taxCR": null,
"localTaxDR": null,
"localTaxCR": null,
"totalDR": null,
"totalCR": 825.00,
"localTotalDR": null,
"localTotalCR": 825.00,
"totalDRExTax": null,
"totalCRExTax": null,
"localTotalDRExTax": null,
"localTotalCRExTax": null,
"taxCurrencyTaxDR": null,
"taxCurrencyTaxCR": null,
"taxCurrencyDR": null,
"taxCurrencyCR": 825.00,
"salesAgent": null,
"inclusiveTax": true,
"name": "",
"deptNo": null
},
{
"docKey": 315,
"dtlKey": 747,
"seq": 4,
"accNo": "310-1000",
"toAccountRate": 1.000000000000,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 825.00,
"cr": null,
"localDR": 825.00,
"localCR": null,
"taxCode": null,
"taxRate": null,
"taxAdjustment": 0.00,
"localTaxAdjustment": 0.00,
"tariffCode": null,
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxBName": null,
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"taxDR": null,
"taxCR": null,
"localTaxDR": null,
"localTaxCR": null,
"totalDR": 825.00,
"totalCR": null,
"localTotalDR": null,
"localTotalCR": null,
"totalDRExTax": null,
"totalCRExTax": null,
"localTotalDRExTax": null,
"localTotalCRExTax": null,
"taxCurrencyTaxDR": null,
"taxCurrencyTaxCR": null,
"taxCurrencyDR": 825.00,
"taxCurrencyCR": null,
"salesAgent": null,
"inclusiveTax": false,
"name": "",
"deptNo": null
}
]
}
Example: Remove the first 2 rows of detail data records (record with DR
and CR
field values of "20").
Re-enter all data in the details
field without the first 2 array elements.
{
"master": {},
"details": [
{
"accNo": "300-D003",
"toAccountRate": 1,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 0,
"cr": 825,
"taxCode": "",
"taxAdjustment": null,
"localTaxAdjustment": null,
"tariffCode": "94036090",
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"salesAgent": "",
"name": "",
"inclusiveTax": true,
"deptNo": ""
},
{
"accNo": "310-1000",
"toAccountRate": 1,
"ref": "",
"description": "Payment for I-000003",
"furtherDescription": "",
"dr": 825,
"cr": 0,
"taxCode": "",
"taxAdjustment": null,
"localTaxAdjustment": null,
"tariffCode": "",
"taxExportCountry": "",
"taxPermitNo": "",
"taxBRNo": "",
"taxRefNo": "",
"taxRegisterNo": "",
"taxBillDate": null,
"salesAgent": "",
"name": "",
"inclusiveTax": false,
"deptNo": ""
}
],
"autoFillOption": {
"taxCode": true,
"tariffCode": true
},
"saveApprove": null
}
Example Request URL:
Parameters:accountBookId
= 1 docNo
= JV-000001 URL:
PUT: https://accounting-api.autocountcloud.com/1/journalentry?docNo=JV-000001
Response
Success Response
Code: 204
Error Response
Response Body
object: Error Response Model
Example Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}