Skip to main content

Document Data Fields

The following is a rough overview of some fields found in the API data models.

Input Data Fields

"AccNo" and "ParentAccNo"

When creating Debtor and Creditor record, fields accNo and parentAccNo, if left empty, will be automatically generated according to auto-generate format specified under "Account Code Format" tab in Cloud Accounting settings.

If user leaves parentAccNo empty, the field will be auto filled with the first creditor control account in chart of account in Cloud Accounting web application.

When manually entering accNo value, Please ensure value entered conforms to "Account Code Format" in Cloud Accounting web application.

Decimals Settings Tab

"Amount"

In Payment Voucher/Receipt Voucher, operations can be carried out like in Journal Entry to create debit and credit postings. The amount field in details will affect the posting of transactions.

  • If amount is positive in Payment Voucher details, a debit transaction is created, vice versa.
  • If amount is positive in Receipt Voucher details, a credit transaction is created, vice versa.

“DocDate”, “TaxDate” and “TaxBillDate”

  • docDate must be within the date range of fiscal year.
  • taxDate and taxBillDate should be on or after docDate.

“DocNo” and “DocNoFormatName”

These fields are only required for generating document numbers when creating new documents and will be ignored for any other API calls.

  • If docNo is entered, docNoFormatName will be ignored.
  • If docNo and docNoFormatName are both empty or null, default numbering format for each document will be used to generate the document number.

Document number formats can be found under "Master Data" > "Numbering Format" in Cloud Accounting web application.

“Discount”

There are several ways to use this field. Please refer to the available discount formulas below:

Example

Given the amount before discount is 100.

Available discount formulas include:

  • Percentage amount
    ex: "10%"
    Total after discount will be 90.

  • Specified amount
    ex: "20"
    Total after discount will be 80.

  • Percentage + Specified amount
    ex: "10%+20"
    Total after discount will be 70.

"IsRoundAdj"

This field is used when creating sales and purchase documents.

The value of this field depends on the "5 Cents Rounding" invoicing settings, this can be found in the Cloud Accounting web application under "Settings" > "Invoicing" > "5 Cents Rounding".

5 Cents Rounding Upon creating Sales & Purchase documents,

  • If 5 cents rounding is enforced, isRoundAdj will always be true.
  • If 5 cents rounding is disabled, isRoundAdj will always be false.
  • If 5 cents rounding is enabled, isRoundAdj will be set according to input data.

This means the input value will be ignored unless the "5 cents rounding" invoicing settings of Cloud Accounting web application is set to "enabled".

caution

If a document is created while 5 Cent Rounding Option is "enabled", the document will not be editable when 5 Cent Rounding is set to “enforced” or “disabled”.

Please ensure that "5 Cents Rounding Adjustment Account" is set in the account book, otherwise an error will be prompted for missing required account.

"KnockOffAmount"

In Knock Off Entry Detail Input Model, the number sign before the value in knockOffAmount indicates if the value is debit amount or credit amount for knock off.

  • Positive for Debit amount
  • Negative for Credit amount

Please ensure the correct sign is used for different document types.

Document TypeSign Value
Invoice (IV) & Purchase Return (PR)Debit (+) only
Purchase Invoice (PI) & Credit Note (CN)Credit (-) only
Journal Entry (JE), Payment Voucher (PV) & Receipt Voucher (OR)allows both Debit (+) and Credit (-)

"ProductCode" and "ProductVariant"

Please adhere to the following rules when filling in these fields:

  • If a product has no variants, only productCode should be assigned a value while productVariant should be left empty.
    (Filling in any value in productVariant will return errors.)
  • If a product has variants, both productCode and productVariant must be filled.
    (Leaving productCode empty will return errors.)
caution

For productVariant field:

  1. Value should be entered according to this format:
    "{VariantOption1}|{VariantOption2}".
  2. The order of the input matters, variant options must be filled up in proper order.
    Input format like "{VariantOption2}|{VariantOption1}" will return errors.
  3. The variant options should be separated using delimiter "|", do not add any additional spaces in between the delimiter and the variant options.

"StockCode"

  • For product without variants, product code itself is the stock code.
  • For product with variants, field value will be the stock code of the product variant.
  • In Product Variant Input Model, the value of this field value will be replaced with null value if the product is not "Inventory" type.

“TaxAdjustment” and “LocalTaxAdjustment”

caution

Please keep the following in mind when inserting values for documents with inclusive tax:

  • Accounting Document - For document with currency code similar to local currency, localTaxAdjustment should be null.
  • Sales & Purchase Document – For debtor / creditor with currency code similar to local currency, localTaxAdjustment should be null.

"TaxCode"

Sales documents allow only Supply tax code while Purchase documents allow only Purchase tax code. This field can be auto filled using the available auto fill input field.

“ToAccountRate”

  • If document currency and row account currency are same, toAccountRate will be reformatted to 1.0.
  • If row account currency is same as local currency, toAccountRate will be reformatted to document currency rate.
  • If document currency, row account currency and local currency are different, toAccountRate will be set to the field value provided.

"ToBankRate"

  • If payment method contains bank account in debtor currency, toBankRate will be reformatted to 1.0.
  • If payment method contains bank account in local currency (same as account book base currency), toBankRate will be set to document currency rate.
  • If payment method currency, debtor currency and local currency are different, toAccountRate will be set to the field value provided.

View Data Fields

“CurrencyCode”

  • In Sales and Purchase documents, currency code of documents will follow the base currency of debtor/creditor.

“Seq”

  • The seq field indicates the order of the document details displayed. The field value is determined by the order of the data list inserted in the request body when creating or updating a document.

Status

  • The status field indicates document statuses. The possible status values for each document type can be found here.

Auto Fill Input Fields

There are some fields that can be automatically filled by the system. Users can control whether these fields are automatically filled by using the available "Auto Fill Options" input models.

Auto fill options fields found in Sales and Purchase document input models include:

"AccNo"

Determines whether the document should be created with a pre-configured default account. When this field value is "true", the accNo field in the document detail input model can be left empty.

caution

Please ensure that the a default Product Posting with sales/purchase account codes has been properly set up beforehand, otherwise documents may be auto filled with empty data.

Product Posting can be configured under "Master Data > Product Posting" in Cloud Accounting web application.

info

The value that will be assigned to accNo in the document details follows this priority:

  1. Product Posting account number of product
    If product data is entered and the product has Product Posting assigned to it, the relevant account number of product posting assigned to product will take precedence as the auto fill value.

  2. Default Product Posting account number
    If no product data is entered or if the product entered does not have product posting assigned to it, relevant account number of default product posting is assigned as auto fill value.

The product posting account number is assigned based on document type and product type input:

Credit Note Document:
Sales return account number of product posting is assigned.

Invoice Document:
Sales account number of product posting is assigned.

Purchase Invoice:
If product type is "Inventory Product", inventory account number of product posting is assigned, otherwise purchase account number of product posting is assigned.

Purchase Return:
If product type is "Inventory Product", inventory account number of product posting is assigned, otherwise purchase return account number of product posting is assigned.

"LocalTotalCost"

Determines whether the invoice document should be created with a calculated cost value. When this field value is "true", the localTotalCost field in the document detail input model can be left empty.

caution

Please note that when the invoice amount is negative, the localTotalCost needs to be manually keyed in. For positive invoice amount, auto fill input can be used.

Also note that the calculated cost only works for inventory products.

"TariffCode"

Determines whether the document should be created with a pre-configured tariff code. When this field value is "true", the tariffCode field in the document detail input model can be left empty.

info

If product data is entered and the product has tariff code assigned to it, the the tariff code of the product will be assigned as the auto fill value.

If the product entered does not have a tariff code assigned to it or if no product data is entered, tariffCode field in document detail will be left empty.

"TaxCode"

Determines whether the document should be created with a pre-configured tax code. When this field value is "true", the taxCode field in the document detail input model can be left empty.

caution

Please ensure that default purchase/supply tax codes have been properly set up beforehand, otherwise documents may be auto filled with empty data.

Default purchase/supply tax codes can be configured under "Master Data > Tax Code" in Cloud Accounting web application.

info

The value that will be assigned to taxCode in the document details follows this priority:

  1. Debtor Tax Code
    If there is a tax code assigned to the debtor, that tax code will take precedence as the auto fill value.

  2. Product Supply/Purchase Tax Code
    If the product entered has supply/purchase tax codes assigned to it, these tax codes will take precedence when debtor has no tax code assigned to it.

  3. Default Supply/Purchase Tax Code
    If the debtor and product do not have tax codes assigned to them, the default supply/purchase tax codes will be assigned as the auto fill value.

"UnitCost"

Determines whether the credit note document should be created with an automatically calculated unit cost value. When this field value is "true", the unitCost field in the document detail input model can be left empty.

The auto fill value assigned to unitCost will be the latest average balance cost of the product at the time of document creation.

caution

Please ensure the cost field of product record has been filled with a value to avoid issues during automatic cost calculation.

Also note that the calculated cost only works for inventory products.