Create Debtor
Request
POST:/{accountBookId}/debtor
Important Note
Please ensure "Automatic Generate Customer Code Format" conforms to "Account Code Format" in Cloud Accounting settings.
When accNo
field is left empty, the value will be auto generated as shown here.
The accNo
value will be generated according to the specified "Automatic Generate Customer Code Format". When auto generating accNo
value upon creditor creation, system will not validate auto generated accNo
value against "Account Code Format" .
However, when trying to update the accNo
value of that record, the system will validate the new accNo
value against "Account Code Format".
Therefore, if the configured "Automatic Generate Customer Code Format" does not conform to the configured "Account Code Format", errors may occur.
Example scenario that will trigger error
Account Code Format: AAAA-AAAA
Automatic Generate Customer Code Format: PPP-F000
Character reference for formats can be found here.
Given the formats configured above, the "Automatic Generate Customer Code Format" does not conform to the "Account Code Format".
Example scenario and values:
- Auto generated
accNo
value based on automatic generate customer code format = "300-D001". - When trying to update
accNo
value to "300-D002", the system will validate the newaccNo
value against "Account Code Format". - In this case, the string length of "300-D002" will not pass validation when validated against account code format "AAAA-AAAA", errors will occur.
Request Body
object: Debtor Data Model
Example Request Body
{
"accNo": "300-D001",
"parentAccNo": "300-0000",
"companyName": "Customer A",
"desc2": "",
"registerNo": "202301000001",
"isActive": true,
"address": "116 Jalan Damai, Kuala Lumpur, Wilayah Persekutuan",
"postCode": "55000",
"phone1": "03-2161 2168",
"phone2": "",
"fax1": "",
"fax2": "",
"deliverAddress": "116 Jalan Damai, Kuala Lumpur, Wilayah Persekutuan",
"deliverPostCode": "55000",
"areaCode": "KUL",
"emailAddress": "debtorA@gmail.com",
"webURL": "",
"attention": "",
"natureOfBusiness": "",
"salesAgent": "Ali",
"currencyCode": "MYR",
"creditTerm": "C.O.D.",
"taxCode": "",
"taxRegisterNo": "C 2584563202",
"note": ""
}
Example Request URL:
Parameters:accountBookId
= 1 URL:
POST: https://accounting-api.autocountcloud.com/1/debtor
Response
Success Response
Code: 201
Response Headers
location
: The link to the created record, similar to request url in Get Debtor API method.
Example Success Response Headers
content-length: 0
date: Fri,10 Mar 2023 07:14:20 GMT
location: https://accounting-api.autocountcloud.com/1/debtor?code=300-D001
server: Microsoft-IIS/10.0
x-powered-by: ASP.NET
x-rate-limit-limit: 1m
x-rate-limit-remaining: 99
x-rate-limit-reset: 2023-03-10T07:15:18.7294283Z
Error Response
Response Body
object: Error Response Model
Example Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}