Skip to main content

Create Creditor

Request

POST:/{accountBookId}/creditor

caution
Important Note

Please ensure "Automatic Generate Supplier 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 Supplier 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 Supplier 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 Supplier Code Format: PPP-F000
Character reference for formats can be found here.

Given the formats configured above, the "Automatic Generate Supplier Code Format" does not conform to the "Account Code Format".

Example scenario and values:

  • Auto generated accNo value based on automatic generate supplier code format = "400-A001".
  • When trying to update accNo value to "400-A002", the system will validate the new accNo value against "Account Code Format".
  • In this case, the string length of "400-A002" will not pass validation when validated against account code format "AAAA-AAAA", errors will occur.

Request Body

object: Creditor Data Model

Example Request Body
{
"accNo": "400-0001",
"parentAccNo": "400-0000",
"companyName": "Apparel Supplier",
"desc2": "",
"registerNo": "202201524856",
"isActive": true,
"address": "Jalan Wawasan 4/12, Pusat Bandar Puchong, Puchong, Selangor",
"postCode": "47100",
"phone1": "03-5192 9527",
"phone2": "",
"fax1": "",
"fax2": "",
"areaCode": "SLG",
"emailAddress": "apparelSupplier@gmail.com",
"webURL": "",
"attention": "",
"natureOfBusiness": "Manufacturing",
"currencyCode": "MYR",
"creditTerm": "C.O.D.",
"taxCode": "P-5",
"taxRegisterNo": "C 0564394372 ",
"note": ""
}

Example Request URL:

Parameters:
accountBookId = 1

URL:
POST: https://accounting-api.autocountcloud.com/1/creditor

Response

Success Response

Code: 201

Response Headers

location: The link to the created record, similar to request url in Get Creditor API method.

Example Success Response Headers
content-length: 0 
date: Thu,09 Mar 2023 09:08:39 GMT
location: https://accounting-api.autocountcloud.com/1/creditor?code=400-0001
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-09T09:09:38.2738255Z

Error Response

Response Body

object: Error Response Model

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