One catalog, two views

Developer recipes for humans and AI

These examples are generated from the same command catalog as /openapi.json and /ai/manifest.json. Humans get explanations and copy-ready code. AI tools get strict JSON rules.

Copy AI Instructions

Paste this into Mac Soft AI, ChatGPT, Claude, or another coding assistant before asking it to call AutoCount.

AutoCount API setup for Mac Soft AI
Use cloud API only: https://api.autocount.cloud
Do not call local connector URLs such as 127.0.0.1 or LAN IP.
Queue command: POST https://api.autocount.cloud/v1/commands
Check result: GET https://api.autocount.cloud/v1/commands/{commandId}
Auth: Authorization: Bearer YOUR_API_KEY
Use connectorId and companyId from the customer dashboard.
Read /ai/autocount-ontology.json, /ai/manifest.json, and /developers/recipes.json before choosing command types.
AR is customer/debtor and debtorCode. AP is supplier/creditor and creditorCode.
Use unique commandId. Poll until done or failed.

Tax API / e-Invoice Tax Fields

Use this when building e-Invoice, tax setup, or accounting automation that needs AutoCount tax data. Tax/compliance writes use AutoCount SDK save paths only; unproven settings/payment writes stay guarded.

Tax setup commands

  • Tax code: list-tax-codes or list-tax-types returns all tax codes; get-tax-code or get-tax-type gets one code; create/update aliases are also accepted.
  • Tax entity: list-tax-entities, get-tax-entity, create-tax-entity, update-tax-entity.
  • Tariff: list-tariff-codes, get-tariff-code, create-tariff-code, update-tariff-code.
  • Withholding: list-withholding-tax-codes, get-withholding-tax-code, create-withholding-tax-code, update-withholding-tax-code.
  • GST/SST: read-gst-settings, read-sst-settings; processor/payment writes remain guarded until proof is complete.

taxEntityID support

  • Master data: debtor and creditor create/update/read.
  • Sales/purchase: common document header create/update/read; tested on SO-000034 and PO-000036.
  • AR/AP: header update/read where AutoCount exposes the field; AP invoice create supports it.
  • GL cash book: payment, receipt, update, and read; tested on PV-000009 and OR-000011.
{
  "commandId": "tax-entity-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "taxEntityID": 1,
    "lines": [
      { "itemCode": "ITEM001", "qty": 1, "unitPrice": 100 }
    ]
  }
}

Choose AutoCount Module

This page exposes every command currently in the AutoCount command catalog. Total recipes: 709.

Start HereConnector basics, common request shape, first safe reads, and setup references.0 key recipesSalesAdvance quotation, quotation, sales order, delivery order, sales invoice, cash sale, credit note, debit note, transfers, and sales PDFs.90 key recipesPurchasePurchase order, GRN, purchase invoice, cash purchase, purchase return, transfer, and purchase PDFs.54 key recipesARCustomer/debtor invoice, payment, refund, credit note, debit note, outstanding documents, statement, and knock-off.52 key recipesAPSupplier/creditor invoice, payment, refund, credit note, debit note, outstanding documents, statement, and knock-off.51 key recipesStockItems, balance, stock adjustment, receive, issue, transfer, UOM conversion, stock take, write-off, BOM, package, and assembly.140 key recipesGLChart of accounts, GL account maintenance, journal entries, journal PDF, and account balances.22 key recipesGL Cash BookCash book document grid, payment voucher, official receipt, bank/cash accounts, and voucher PDF.14 key recipesBank ReconciliationBank reconciliation list, detail, uncleared rows, create, edit, and delete.8 key recipesReportsAutoCount report templates, statement data, statement HTML, sales/purchase/stock/AR/AP/GL PDFs.15 key recipesMaster DataDebtor, creditor, item, item package, item BOM, and safe General Maintenance setup tables.16 key recipese-Invoicee-Invoice settings, status, consolidated/self-billed flow, supplier item mapping, import, and sync.16 key recipesBulk / ToolsBulk creation and tooling recipes for larger imports or automation batches.59 key recipesTaxTax code, tax entity, tariff, withholding tax, GST/SST reads, and taxEntityID usage for e-Invoice fields.43 key recipes

Sales

Advance quotation, quotation, sales order, delivery order, sales invoice, cash sale, credit note, debit note, transfers, and sales PDFs.

list-advanced-quotationsRead

List advanced quotations.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/list

Full JSON Payload

{
  "commandId": "list-advanced-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-advanced-quotations",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-advanced-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-advanced-quotations",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-advanced-quotations.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-advanced-quotation-linesRead

Read advanced quotation detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/list

Full JSON Payload

{
  "commandId": "read-advanced-quotation-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-advanced-quotation-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-advanced-quotation-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-advanced-quotation-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-advanced-quotation-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-advanced-quotationRead

Get one advanced quotation by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/get

Full JSON Payload

{
  "commandId": "get-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001"
  }
}

Payload Fields

docNo
required advanced quotation document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-advanced-quotationValidate

Validate a advanced quotation without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/validate

Full JSON Payload

{
  "commandId": "validate-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-advanced-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-advanced-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-advanced-quotationCreate

Create an advanced quotation.

Creates advanced quotation through AutoCount SDK. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/create

Full JSON Payload

{
  "commandId": "create-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-advanced-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-advanced-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-advanced-quotationEdit

Update advanced quotation header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/edit

Full JSON Payload

{
  "commandId": "update-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-advanced-quotationVoid

Cancel a advanced quotation when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/cancel

Full JSON Payload

{
  "commandId": "cancel-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-advanced-quotationVoid

Void a advanced quotation while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/void

Full JSON Payload

{
  "commandId": "void-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-advanced-quotationDelete

Delete/void request for a advanced quotation.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/delete

Full JSON Payload

{
  "commandId": "delete-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-advanced-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-advanced-quotation",
  "payload": {
    "docNo": "AQ-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-advanced-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-quotationsRead

List quotations.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/list

Full JSON Payload

{
  "commandId": "list-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-quotations",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-quotations",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-quotations.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-quotation-linesRead

Read quotation detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/list

Full JSON Payload

{
  "commandId": "read-quotation-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-quotation-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-quotation-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-quotation-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-quotation-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-quotationRead

Get one quotation by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/get

Full JSON Payload

{
  "commandId": "get-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-quotation",
  "payload": {
    "docNo": "QT-000001"
  }
}

Payload Fields

docNo
required quotation document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-quotation",
  "payload": {
    "docNo": "QT-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-quotationValidate

Validate a quotation without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/validate

Full JSON Payload

{
  "commandId": "validate-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-quotationCreate

Create a quotation.

Creates quotation through AutoCount SDK. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/create

Full JSON Payload

{
  "commandId": "create-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-quotation",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-quotationEdit

Update quotation header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/edit

Full JSON Payload

{
  "commandId": "update-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-quotationVoid

Cancel a quotation when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/cancel

Full JSON Payload

{
  "commandId": "cancel-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-quotationVoid

Void a quotation while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/void

Full JSON Payload

{
  "commandId": "void-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-quotationDelete

Delete/void request for a quotation.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/quotation/delete

Full JSON Payload

{
  "commandId": "delete-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-quotation",
  "payload": {
    "docNo": "QT-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-sales-ordersRead

List sales orders.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/list

Full JSON Payload

{
  "commandId": "list-sales-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-orders",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-sales-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-orders",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-sales-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-sales-order-linesRead

Read sales order detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/list

Full JSON Payload

{
  "commandId": "read-sales-order-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-order-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-sales-order-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-order-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-sales-order-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-sales-orderRead

Get one sales order by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/get

Full JSON Payload

{
  "commandId": "get-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-order",
  "payload": {
    "docNo": "SO-000001"
  }
}

Payload Fields

docNo
required sales order document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-order",
  "payload": {
    "docNo": "SO-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-sales-orderValidate

Validate a sales order without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/validate

Full JSON Payload

{
  "commandId": "validate-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-sales-orderCreate

Create a sales order.

Creates sales order through AutoCount SDK. If a stock line omits accountNo, connector uses AutoCount's default sales account where needed. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/create

Full JSON Payload

{
  "commandId": "create-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100,
        "accountNo": "500-0000"
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100,
        "accountNo": "500-0000"
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-sales-orderCreate

Create stock-item-only Sales Order for MacSoft AI Agent.

Separate opt-in command. Uses AutoCount SalesOrder SDK Save path but does not resolve, apply, validate, or fall back to any default Sales Account / AccNo. Save failures return exceptionText. Create stock-item-only Sales Order for MacSoft AI Agent. This is a separate opt-in command and does not modify create-sales-order. Every line must include itemCode. Do not send accountNo, accNo, glAccount, or postingAccountNo; the connector will reject those fields and will not resolve or apply a default Sales Account / AccNo. If AutoCount Save fails, result.exceptionText includes the full SDK exception text for diagnosis.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/create

Full JSON Payload

{
  "commandId": "create-stock-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-08-30",
    "salesLocation": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT",
        "location": "HQ",
        "unitPrice": 14,
        "description": "Stock item line"
      }
    ],
    "salesAgent": "SA01",
    "multiPricing": "P2",
    "inclusiveTax": false
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on numbering rules
lines
required array of stock-item rows only. Every line must include itemCode. accountNo, accNo, glAccount, and postingAccountNo are rejected.
docNo
optional AutoCount Sales Order number; omit to let AutoCount numbering generate it
displayTerm
optional credit term
currencyCode
optional currency code such as MYR
salesLocation
optional exact active stock location; copied only to lines that omit location
salesAgent
optional Sales Agent Maintenance code
multiPricing
optional AutoCount multi-pricing code/category
inclusiveTax
optional boolean; true when line prices include tax
items
optional alias for lines

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-sales-order",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-08-30",
    "salesLocation": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT",
        "location": "HQ",
        "unitPrice": 14,
        "description": "Stock item line"
      }
    ],
    "salesAgent": "SA01",
    "multiPricing": "P2",
    "inclusiveTax": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-sales-orderEdit

Update sales order header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/edit

Full JSON Payload

{
  "commandId": "update-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-sales-orderVoid

Cancel a sales order when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/cancel

Full JSON Payload

{
  "commandId": "cancel-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-sales-orderVoid

Void a sales order while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/void

Full JSON Payload

{
  "commandId": "void-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-sales-orderDelete

Delete/void request for a sales order.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/delete

Full JSON Payload

{
  "commandId": "delete-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-order",
  "payload": {
    "docNo": "SO-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-delivery-ordersRead

List delivery orders.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/list

Full JSON Payload

{
  "commandId": "list-delivery-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-delivery-orders",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-delivery-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-delivery-orders",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-delivery-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-delivery-order-linesRead

Read delivery order detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/list

Full JSON Payload

{
  "commandId": "read-delivery-order-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-delivery-order-lines",
  "payload": {
    "docNo": "DO-000001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-delivery-order-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-delivery-order-lines",
  "payload": {
    "docNo": "DO-000001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-delivery-order-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-delivery-orderRead

Get one delivery order by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/get

Full JSON Payload

{
  "commandId": "get-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-delivery-order",
  "payload": {
    "docNo": "DO-000001"
  }
}

Payload Fields

docNo
required delivery order document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-delivery-order",
  "payload": {
    "docNo": "DO-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-delivery-orderValidate

Validate a delivery order without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/validate

Full JSON Payload

{
  "commandId": "validate-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-delivery-order",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-delivery-order",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-delivery-orderCreate

Create a delivery order.

Creates delivery order through AutoCount SDK. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/create

Full JSON Payload

{
  "commandId": "create-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-delivery-order",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-delivery-order",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-delivery-orderEdit

Update delivery order header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/edit

Full JSON Payload

{
  "commandId": "update-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-delivery-orderVoid

Cancel a delivery order when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/cancel

Full JSON Payload

{
  "commandId": "cancel-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-delivery-orderVoid

Void a delivery order while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/void

Full JSON Payload

{
  "commandId": "void-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-delivery-orderDelete

Delete/void request for a delivery order.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/delete

Full JSON Payload

{
  "commandId": "delete-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-delivery-order",
  "payload": {
    "docNo": "DO-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-sales-invoicesRead

List sales invoices. Supports fast date-filtered rich headers so AI does not need one get-sales-invoice command per invoice.

Uses one bounded read-only AutoCount DBSetting header query. Returned fields include DocKey, DocNo, DocDate, DebtorCode, DebtorName, DocType, Description, Ref, CurrencyCode, NetTotal, Tax, FinalTotal, OutstandingAmount, Cancelled, EInvoiceStatus, CustomerEmail, CustomerMobile, pdfAvailable, PDFStatus, and PDFCommand. For Sales Invoice, DocType is RI and OutstandingAmount is the current live AR open balance from ARInvoice; fully settled invoices return 0.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/list

Full JSON Payload

{
  "commandId": "list-sales-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-invoices",
  "payload": {
    "fromDate": "2026-08-01",
    "toDate": "2026-08-31",
    "limit": 500,
    "includeCustomer": true,
    "includeContact": true,
    "includeTotals": true
  }
}

Payload Fields

fromDate
YYYY-MM-DD optional
toDate
YYYY-MM-DD optional
docNos
optional array or comma-separated DocNo list
limit
optional maximum rows, default 100, max 500
top
optional alias for limit
take
optional alias for limit
includeCustomer
optional boolean; returns DebtorName/CreditorName where available
includeContact
optional boolean; returns Attention, CustomerPhone, CustomerMobile, CustomerEmail where available
includeTotals
optional boolean; returns NetTotal, Tax, FinalTotal, current live AR open balance as OutstandingAmount, EInvoiceStatus, and DocType RI
orderBy
optional; latest-first ordering is DocDate desc, DocNo desc

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-sales-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-invoices",
  "payload": {
    "fromDate": "2026-08-01",
    "toDate": "2026-08-31",
    "limit": 500,
    "includeCustomer": true,
    "includeContact": true,
    "includeTotals": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-sales-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-sales-invoice-linesRead

Read sales invoice detail lines only.

Returns header keys plus raw AutoCount invoice detail columns such as ItemCode, AccNo, Qty, UOM, UnitPrice, TaxCode, ProjNo, DeptNo, and Detail_* fields.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/list

Full JSON Payload

{
  "commandId": "read-sales-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-invoice-lines",
  "payload": {
    "itemCode": "ITEM001",
    "dateFrom": "2026-01-01",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-sales-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-invoice-lines",
  "payload": {
    "itemCode": "ITEM001",
    "dateFrom": "2026-01-01",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-sales-invoice-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-sales-invoiceRead

Get one sales invoice by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/get

Full JSON Payload

{
  "commandId": "get-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-invoice",
  "payload": {
    "docNo": "IV-000001"
  }
}

Payload Fields

docNo
required sales invoice document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-invoice",
  "payload": {
    "docNo": "IV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-sales-invoiceValidate

Validate a sales invoice without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/validate

Full JSON Payload

{
  "commandId": "validate-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-sales-invoiceCreate

Create a sales invoice. MyInvois disaster recovery is available only through the guarded TSM recovery mode.

Normal create requires write access. Recovery is companyId=tsm only, UUID guarded, reload verified, and never submits or resubmits to LHDN. See the MyInvois disaster recovery runbook. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/create

Full JSON Payload

{
  "commandId": "create-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
restoreMode
optional internal recovery value recover-existing-myinvois-direct
confirmNoLhdnSubmit
required true in recovery mode
taxEntity
required authoritative taxpayer identity in recovery mode
eInvoiceRecovery
required authoritative UUID, timestamps, status, link, totals and tax in recovery mode
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-sales-invoiceEdit

Update sales invoice header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/edit

Full JSON Payload

{
  "commandId": "update-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-sales-invoiceVoid

Cancel a sales invoice when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/cancel

Full JSON Payload

{
  "commandId": "cancel-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-sales-invoiceVoid

Void a sales invoice while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/void

Full JSON Payload

{
  "commandId": "void-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-sales-invoiceDelete

Delete/void request for a sales invoice.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/delete

Full JSON Payload

{
  "commandId": "delete-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-invoice",
  "payload": {
    "docNo": "IV-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-cash-salesRead

List cash sales.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/list

Full JSON Payload

{
  "commandId": "list-cash-sales-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-cash-sales",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-cash-sales-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-cash-sales",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-cash-sales.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-cash-sale-linesRead

Read cash sale detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/list

Full JSON Payload

{
  "commandId": "read-cash-sale-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-cash-sale-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-cash-sale-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-cash-sale-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-cash-sale-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-cash-saleRead

Get one cash sale by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/get

Full JSON Payload

{
  "commandId": "get-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-cash-sale",
  "payload": {
    "docNo": "CS-000001"
  }
}

Payload Fields

docNo
required cash sale document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-cash-sale",
  "payload": {
    "docNo": "CS-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-cash-saleValidate

Validate a cash sale without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/validate

Full JSON Payload

{
  "commandId": "validate-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-cash-sale",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-cash-sale",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-cash-saleCreate

Create a cash sale.

Create Cash Sale with payment. Creates cash sale through AutoCount SDK and returns paymentLines where AutoCount exposes the payment table. Use read-payment-methods first; payments[].paymentMethod must match an active AutoCount Payment Method code, and paymentAmount totals should equal the document total. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/create

Full JSON Payload

{
  "commandId": "create-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-cash-sale",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
items
optional alias for lines
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-cash-sale",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-cash-saleEdit

Update cash sale header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/edit

Full JSON Payload

{
  "commandId": "update-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-cash-saleVoid

Cancel a cash sale when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/cancel

Full JSON Payload

{
  "commandId": "cancel-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-cash-saleVoid

Void a cash sale while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/void

Full JSON Payload

{
  "commandId": "void-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-cash-saleDelete

Delete/void request for a cash sale.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/cash-sale/delete

Full JSON Payload

{
  "commandId": "delete-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-cash-sale-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-cash-sale",
  "payload": {
    "docNo": "CS-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-cash-sale.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-sales-credit-notesRead

List sales credit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/list

Full JSON Payload

{
  "commandId": "list-sales-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-credit-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-sales-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-credit-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-sales-credit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-sales-credit-note-linesRead

Read sales credit note detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/list

Full JSON Payload

{
  "commandId": "read-sales-credit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-credit-note-lines",
  "payload": {
    "docNo": "CN-000001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-sales-credit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-credit-note-lines",
  "payload": {
    "docNo": "CN-000001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-sales-credit-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-sales-credit-noteRead

Get one sales credit note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/get

Full JSON Payload

{
  "commandId": "get-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-credit-note",
  "payload": {
    "docNo": "CN-000001"
  }
}

Payload Fields

docNo
required sales credit note document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-credit-note",
  "payload": {
    "docNo": "CN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-sales-credit-noteValidate

Validate a sales credit note without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/validate

Full JSON Payload

{
  "commandId": "validate-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-sales-credit-noteCreate

Create a sales credit note; guarded MyInvois type 02 recovery is supported for TSM.

Normal create uses AutoCount Sales CreditNote SDK. Recovery is companyId=tsm only, UUID guarded, reload verified, and does not submit to LHDN. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/create

Full JSON Payload

{
  "commandId": "create-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
restoreMode
optional internal recovery value recover-existing-myinvois-direct
confirmNoLhdnSubmit
required true in recovery mode
taxEntity
required in recovery mode
eInvoiceRecovery
required UUID, timestamps, status, link, totals and tax in recovery mode
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-sales-credit-noteEdit

Update sales credit note header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/edit

Full JSON Payload

{
  "commandId": "update-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-sales-credit-noteVoid

Cancel a sales credit note when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/cancel

Full JSON Payload

{
  "commandId": "cancel-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-sales-credit-noteVoid

Void a sales credit note while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/void

Full JSON Payload

{
  "commandId": "void-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-sales-credit-noteDelete

Delete/void request for a sales credit note.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/delete

Full JSON Payload

{
  "commandId": "delete-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-sales-debit-notesRead

List sales debit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/list

Full JSON Payload

{
  "commandId": "list-sales-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-debit-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-sales-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sales-debit-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-sales-debit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-sales-debit-note-linesRead

Read sales debit note detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/list

Full JSON Payload

{
  "commandId": "read-sales-debit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-debit-note-lines",
  "payload": {
    "docNo": "DN-000001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-sales-debit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-debit-note-lines",
  "payload": {
    "docNo": "DN-000001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-sales-debit-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-sales-debit-noteRead

Get one sales debit note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/get

Full JSON Payload

{
  "commandId": "get-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-debit-note",
  "payload": {
    "docNo": "DN-000001"
  }
}

Payload Fields

docNo
required sales debit note document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sales-debit-note",
  "payload": {
    "docNo": "DN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-sales-debit-noteValidate

Validate a sales debit note without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/validate

Full JSON Payload

{
  "commandId": "validate-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
items
optional alias for lines
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-sales-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-sales-debit-noteCreate

Create a sales debit note; guarded MyInvois type 03 recovery is supported for TSM.

Normal create uses AutoCount Sales DebitNote SDK. Recovery is companyId=tsm only, UUID guarded, reload verified, and does not submit to LHDN. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. If a sales account book requires a line posting account, the connector uses AutoCount's default sales account when lines[].accountNo is omitted; send accountNo / accNo / glAccount / postingAccountNo on a line to override it. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. salesLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/create

Full JSON Payload

{
  "commandId": "create-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
restoreMode
optional internal recovery value recover-existing-myinvois-direct
confirmNoLhdnSubmit
required true in recovery mode
taxEntity
required in recovery mode
eInvoiceRecovery
required UUID, timestamps, status, link, totals and tax in recovery mode
debtorName
optional customer display name; AutoCount debtor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional debtor branch code/name where the customer uses branches
salesLocation
optional exact active AutoCount sales/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
multiPricing
optional price category/multi-pricing value such as Price 1
salesAgent
optional Sales Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
deliverContact
optional delivery contact person
deliverPhone1
optional delivery phone number
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
deliverAddress1
optional delivery address line 1
deliverAddress2
optional delivery address line 2
deliverAddress3
optional delivery address line 3
deliverAddress4
optional delivery address line 4
description
optional document description/narration
ref
optional reference
ourRef
optional our reference
yourRef
optional customer reference
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional top-level GL posting account fallback; line-level accountNo / accNo / glAccount / postingAccountNo wins, otherwise the connector uses AutoCount's default sales account where needed
payments
optional array for cash sale style documents; send multiple payment rows for AutoCount Multi Payment
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sales-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "salesLocation": "HQ",
    "multiPricing": "Price 1",
    "salesAgent": "SA01",
    "attention": "Purchasing Department",
    "contact": "Purchasing Department",
    "deliverContact": "Store Receiver",
    "deliverPhone1": "012-3456789",
    "phone": "03-11111111",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "description": "Sales document created through API",
    "ref": "WEB-ORDER-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 100,
        "discount": "5%",
        "taxType": "S-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 190,
        "accountNo": "500-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "deliveryDate": "2026-06-30",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "500-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 50,
        "taxType": "S-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 130,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "CARD",
        "paymentBy": "Credit Card",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "APPROVED-001"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-sales-debit-noteEdit

Update sales debit note header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/edit

Full JSON Payload

{
  "commandId": "update-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorCode
optional Customer/debtor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
debtorName
optional Customer display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgent
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesAgentCode
optional Sales agent code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional Delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
withholdingTaxVersion
optional Optional native enum only when this document exposes the field. Omission preserves the existing value. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Note. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
salesLocation
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Sales location where supported. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing SDK-materialized UDF fields; exact reload verification required. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "Correct customer reference",
    "ref": "Updated reference"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict Sales update: editable SDK scalar fields via friendly fields, Master or nativeFields.Master; details via lines with explicit detailMode and existing dtlKey for update/delete. Omitted fields stay unchanged; explicit null/empty clears only optional fields. Unknown, unavailable, calculated, system and lifecycle fields are rejected before Save. Existing UDFs must be present in the SDK schema; no invented columns. validateOnly:true runs native preflight without Save and is not persistence certification. Save success requires a fresh SDK reload with writeVerification.matched=true, identity and linkage verification. saved:true with ok:false means a persisted mismatch or failed verification, not rollback; inspect the existing document and never recreate it automatically. Existing payment, transfer, package and eInvoice protections remain. Runtime get-document fields/fieldCapabilities expose SDK field discovery and fields.readErrors; availability varies by document and account book. Native acceptance covers reference/detail descriptions across eight Sales types and one final-build Sales Order price change, not all fields or SDK versions. Generic native UDF saves remain unproven. Cash Sale creation did not persist its fixture payment; this is a separate unresolved create-path issue. Update acceptance covers that existing unpaid Cash Sale only, not paid-CS support. See docs/document-update-fields.md.
cancel-sales-debit-noteVoid

Cancel a sales debit note when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/cancel

Full JSON Payload

{
  "commandId": "cancel-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-sales-debit-noteVoid

Void a sales debit note while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/void

Full JSON Payload

{
  "commandId": "void-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-sales-debit-noteDelete

Delete/void request for a sales debit note.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/delete

Full JSON Payload

{
  "commandId": "delete-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-sales-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-sales-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-sales-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-advanced-quotation-to-delivery-orderTransfer

Transfer Advanced Quotation to delivery-order through AutoCount SDK.

Requires a connector build exposing this command. Uses source DocKey with SDK FullTransfer; preserves source reference and transferred quantity. Ordinary Quotation destination remains guarded after SDK failure. Full-document transfer only; partial-transfer-document does not yet support Advanced Quotation. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/transfer

Full JSON Payload

{
  "commandId": "transfer-advanced-quotation-to-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-delivery-order",
  "payload": {
    "fromDocNo": "Q-000001",
    "docDate": "2026-06-24",
    "sourceDocNo": "DOC-000001",
    "targetDocNo": "",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer advanced quotation to delivery order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

fromDocNo
required Advanced Quotation number
docDate
optional YYYY-MM-DD target document date
docNo
optional target number
sourceDocNo
required source advanced quotation document number
targetDocNo
optional target delivery order document number; omit to let AutoCount numbering generate it
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-advanced-quotation-to-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-delivery-order",
  "payload": {
    "fromDocNo": "Q-000001",
    "docDate": "2026-06-24",
    "sourceDocNo": "DOC-000001",
    "targetDocNo": "",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer advanced quotation to delivery order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-advanced-quotation-to-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-advanced-quotation-to-quotationTransfer

Guarded: Advanced Quotation to ordinary Quotation is not currently supported.

This command rejects before creating a target. The installed SDK failed the native transfer test. Do not use as a working transfer or cancel/recreate documents automatically.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/transfer

Full JSON Payload

{
  "commandId": "transfer-advanced-quotation-to-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-quotation",
  "payload": {
    "fromDocNo": "Q-000001"
  }
}

Payload Fields

fromDocNo
Advanced Quotation number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-advanced-quotation-to-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-quotation",
  "payload": {
    "fromDocNo": "Q-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-advanced-quotation-to-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-advanced-quotation-to-sales-invoiceTransfer

Transfer Advanced Quotation to sales-invoice through AutoCount SDK.

Requires a connector build exposing this command. Uses source DocKey with SDK FullTransfer; preserves source reference and transferred quantity. Ordinary Quotation destination remains guarded after SDK failure. Full-document transfer only; partial-transfer-document does not yet support Advanced Quotation. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/transfer

Full JSON Payload

{
  "commandId": "transfer-advanced-quotation-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-sales-invoice",
  "payload": {
    "fromDocNo": "Q-000001",
    "docDate": "2026-06-24",
    "sourceDocNo": "DOC-000001",
    "targetDocNo": "",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer advanced quotation to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

fromDocNo
required Advanced Quotation number
docDate
optional YYYY-MM-DD target document date
docNo
optional target number
sourceDocNo
required source advanced quotation document number
targetDocNo
optional target sales invoice document number; omit to let AutoCount numbering generate it
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-advanced-quotation-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-sales-invoice",
  "payload": {
    "fromDocNo": "Q-000001",
    "docDate": "2026-06-24",
    "sourceDocNo": "DOC-000001",
    "targetDocNo": "",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer advanced quotation to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-advanced-quotation-to-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-advanced-quotation-to-sales-orderTransfer

Transfer Advanced Quotation to sales-order through AutoCount SDK.

Requires a connector build exposing this command. Uses source DocKey with SDK FullTransfer; preserves source reference and transferred quantity. Ordinary Quotation destination remains guarded after SDK failure. Full-document transfer only; partial-transfer-document does not yet support Advanced Quotation. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/advanced-quotation/transfer

Full JSON Payload

{
  "commandId": "transfer-advanced-quotation-to-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-sales-order",
  "payload": {
    "fromDocNo": "Q-000001",
    "docDate": "2026-06-24",
    "sourceDocNo": "DOC-000001",
    "targetDocNo": "",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer advanced quotation to sales order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

fromDocNo
required Advanced Quotation number
docDate
optional YYYY-MM-DD target document date
docNo
optional target number
sourceDocNo
required source advanced quotation document number
targetDocNo
optional target sales order document number; omit to let AutoCount numbering generate it
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-advanced-quotation-to-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-advanced-quotation-to-sales-order",
  "payload": {
    "fromDocNo": "Q-000001",
    "docDate": "2026-06-24",
    "sourceDocNo": "DOC-000001",
    "targetDocNo": "",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer advanced quotation to sales order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-advanced-quotation-to-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-delivery-order-to-sales-invoiceTransfer

Transfer delivery order to sales invoice.

Uses AutoCount transfer logic. Transfer delivery order to sales invoice as draft when saveAsDraft=true. This uses AutoCount transfer logic and the SDK Save(true) draft save path, so the DO -> Invoice linkage stays intact; it does not create a separate standalone invoice.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/transfer

Full JSON Payload

{
  "commandId": "transfer-delivery-order-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-delivery-order-to-sales-invoice",
  "payload": {
    "sourceDocNo": "DO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": true,
    "description": "Transfer delivery order to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source delivery order document number
targetDocNo
optional target sales invoice document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-delivery-order-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-delivery-order-to-sales-invoice",
  "payload": {
    "sourceDocNo": "DO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": true,
    "description": "Transfer delivery order to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-delivery-order-to-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-quotation-to-delivery-orderTransfer

Transfer quotation directly to delivery order.

Uses AutoCount transfer logic where the account book allows direct quotation-to-delivery-order transfer. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/delivery-order/transfer

Full JSON Payload

{
  "commandId": "transfer-quotation-to-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-quotation-to-delivery-order",
  "payload": {
    "sourceDocNo": "QT-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer quotation to delivery order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source quotation document number
targetDocNo
optional target delivery order document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-quotation-to-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-quotation-to-delivery-order",
  "payload": {
    "sourceDocNo": "QT-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer quotation to delivery order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-quotation-to-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-quotation-to-sales-invoiceTransfer

Transfer quotation directly to sales invoice.

Uses AutoCount transfer logic where the account book allows direct quotation-to-sales-invoice transfer. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/transfer

Full JSON Payload

{
  "commandId": "transfer-quotation-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-quotation-to-sales-invoice",
  "payload": {
    "sourceDocNo": "QT-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer quotation to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source quotation document number
targetDocNo
optional target sales invoice document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-quotation-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-quotation-to-sales-invoice",
  "payload": {
    "sourceDocNo": "QT-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer quotation to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-quotation-to-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-quotation-to-sales-orderTransfer

Transfer quotation to sales order.

Uses AutoCount transfer logic. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/transfer

Full JSON Payload

{
  "commandId": "transfer-quotation-to-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-quotation-to-sales-order",
  "payload": {
    "sourceDocNo": "QT-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer quotation to sales order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source quotation document number
targetDocNo
optional target sales order document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-quotation-to-sales-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-quotation-to-sales-order",
  "payload": {
    "sourceDocNo": "QT-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer quotation to sales order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-quotation-to-sales-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-sales-invoice-to-sales-credit-noteTransfer

Transfer sales invoice to sales credit note.

Uses AutoCount transfer logic. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/transfer

Full JSON Payload

{
  "commandId": "transfer-sales-invoice-to-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-invoice-to-sales-credit-note",
  "payload": {
    "sourceDocNo": "IV-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales invoice to sales credit note",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source sales invoice document number
targetDocNo
optional target sales credit note document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-sales-invoice-to-sales-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-invoice-to-sales-credit-note",
  "payload": {
    "sourceDocNo": "IV-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales invoice to sales credit note",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-sales-invoice-to-sales-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-sales-order-to-delivery-orderTransfer

Transfer sales order to delivery order.

Uses AutoCount transfer logic. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/transfer

Full JSON Payload

{
  "commandId": "transfer-sales-order-to-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-order-to-delivery-order",
  "payload": {
    "sourceDocNo": "SO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales order to delivery order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source sales order document number
targetDocNo
optional target delivery order document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-sales-order-to-delivery-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-order-to-delivery-order",
  "payload": {
    "sourceDocNo": "SO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales order to delivery order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-sales-order-to-delivery-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-sales-order-to-purchase-orderTransfer

Transfer sales order to purchase order.

Uses AutoCount transfer logic where supported by the account book. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/transfer

Full JSON Payload

{
  "commandId": "transfer-sales-order-to-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-order-to-purchase-order",
  "payload": {
    "sourceDocNo": "SO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales order to purchase order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source sales order document number
creditorCode
optional supplier code where transfer creates a purchase document
targetDocNo
optional target purchase order document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-sales-order-to-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-order-to-purchase-order",
  "payload": {
    "sourceDocNo": "SO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales order to purchase order",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-sales-order-to-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-sales-order-to-sales-invoiceTransfer

Transfer sales order directly to sales invoice.

Uses AutoCount transfer logic where the account book allows direct sales-order-to-invoice transfer. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/transfer

Full JSON Payload

{
  "commandId": "transfer-sales-order-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-order-to-sales-invoice",
  "payload": {
    "sourceDocNo": "SO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales order to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source sales order document number
targetDocNo
optional target sales invoice document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-sales-order-to-sales-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-sales-order-to-sales-invoice",
  "payload": {
    "sourceDocNo": "SO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer sales order to sales invoice",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-sales-order-to-sales-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-get-sales-invoicesread

Read many sales invoice headers in one connector execution.

Preferred when an AI already has invoice numbers. It avoids queueing one get-sales-invoice command per document. PDFStatus is available-on-demand; use sales-document-autocount-pdf for the actual PDF artifact.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/bulk-get-sales-invoices

Full JSON Payload

{
  "commandId": "bulk-get-sales-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-get-sales-invoices",
  "payload": {
    "docNos": [
      "I-2608-001",
      "I-2608-046"
    ],
    "headerOnly": true,
    "includeCustomer": true,
    "includeContact": true,
    "includeTotals": true
  }
}

Payload Fields

docNos
required array or comma-separated DocNo list, or use fromDate/toDate
fromDate
YYYY-MM-DD optional
toDate
YYYY-MM-DD optional
headerOnly
optional boolean; currently true only
includeCustomer
optional boolean, default true
includeContact
optional boolean, default true
includeTotals
optional boolean, default true
limit
optional maximum rows, default 100, max 500

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-get-sales-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-get-sales-invoices",
  "payload": {
    "docNos": [
      "I-2608-001",
      "I-2608-046"
    ],
    "headerOnly": true,
    "includeCustomer": true,
    "includeContact": true,
    "includeTotals": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-get-sales-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-item-sales-by-customerRead

Rank customers who bought an item by quantity and amount.

Use this when asking who bought the most of one item. It reads sales invoice and cash sale detail lines, groups by debtor/customer, and returns TotalQty, TotalAmount, DocumentCount, FirstDocDate, and LastDocDate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales/list

Full JSON Payload

{
  "commandId": "read-item-sales-by-customer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-item-sales-by-customer",
  "payload": {
    "itemCode": "00002",
    "fromDate": "2020-01-01",
    "toDate": "2026-07-19",
    "limit": 10
  }
}

Payload Fields

itemCode
required stock item code
fromDate
YYYY-MM-DD optional; dateFrom also accepted
toDate
YYYY-MM-DD optional; dateTo also accepted
limit
optional maximum customer rows, default 100, max 500
includeInvoices
optional boolean, default true
includeCashSales
optional boolean, default true

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-item-sales-by-customer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-item-sales-by-customer",
  "payload": {
    "itemCode": "00002",
    "fromDate": "2020-01-01",
    "toDate": "2026-07-19",
    "limit": 10
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-item-sales-by-customer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-sales-detail-linesRead

Read all sales document lines together, or filter with document.

Prefer the document-specific read-*-lines commands when the document family is known.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales/list

Full JSON Payload

{
  "commandId": "read-sales-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-detail-lines",
  "payload": {
    "document": "sales-invoice",
    "itemCode": "ITEM001",
    "dateFrom": "2026-01-01",
    "dateTo": "2026-07-19",
    "limit": 50
  }
}

Payload Fields

document
optional: sales-invoice | cash-sale | delivery-order | sales-order | quotation | advanced-quotation | sales-credit-note | sales-debit-note
itemCode
optional
debtorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional, default 100, max 500

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-sales-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sales-detail-lines",
  "payload": {
    "document": "sales-invoice",
    "itemCode": "ITEM001",
    "dateFrom": "2026-01-01",
    "dateTo": "2026-07-19",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-sales-detail-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-sales-agentwrite

Change a sales agent code.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales/change-sales-agent

Full JSON Payload

{
  "commandId": "change-sales-agent-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-sales-agent",
  "payload": {
    "oldAgent": "OLD-AGENT",
    "newAgent": "NEW-AGENT",
    "confirm": true
  }
}

Payload Fields

oldAgent
required old value for oldAgent
newAgent
required new value for newAgent
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-sales-agent-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-sales-agent",
  "payload": {
    "oldAgent": "OLD-AGENT",
    "newAgent": "NEW-AGENT",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-sales-agent.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
print-sales-documentwrite

Print a native sales document and verify Print Count.

Requires connector 2026.09.11.01 and Sales Edit permission. Sales invoice verified on Canon MF240; other templates require site testing. Returns printCountBefore/After/Verified, printerJobId and spoolerCompleted, not proof of physical delivery. Reuse the SAME commandId on retry. Interrupted output is blocked for manual reconciliation; never bypass with a new ID.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales/print-sales-document

Full JSON Payload

{
  "commandId": "print-sales-document-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "print-sales-document",
  "payload": {
    "document": "invoice",
    "docNo": "IV-000001",
    "reportName": "Invoice",
    "printerName": "MF240 Series"
  }
}

Payload Fields

document
invoice | sales-order | delivery-order | quotation | advanced-quotation | cash-sale | sales-credit-note | sales-debit-note
docNo
required
reportName
required exact installed AutoCount template name
printerName
required exact installed Windows printer name

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "print-sales-document-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "print-sales-document",
  "payload": {
    "document": "invoice",
    "docNo": "IV-000001",
    "reportName": "Invoice",
    "printerName": "MF240 Series"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to print-sales-document.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Purchase

Purchase order, GRN, purchase invoice, cash purchase, purchase return, transfer, and purchase PDFs.

list-purchase-ordersRead

List purchase orders.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/list

Full JSON Payload

{
  "commandId": "list-purchase-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-purchase-orders",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-purchase-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-purchase-orders",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-purchase-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-purchase-order-linesRead

Read purchase order detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/list

Full JSON Payload

{
  "commandId": "read-purchase-order-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-order-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
creditorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-purchase-order-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-order-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-purchase-order-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-purchase-orderRead

Get one purchase order by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/get

Full JSON Payload

{
  "commandId": "get-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-purchase-order",
  "payload": {
    "docNo": "PO-000001"
  }
}

Payload Fields

docNo
required purchase order document number

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-purchase-order",
  "payload": {
    "docNo": "PO-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-purchase-orderValidate

Validate a purchase order without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/validate

Full JSON Payload

{
  "commandId": "validate-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-purchase-order",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-purchase-order",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-purchase-orderCreate

Create a purchase order.

Creates purchase order through AutoCount SDK. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/create

Full JSON Payload

{
  "commandId": "create-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-purchase-order",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-purchase-order",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-purchase-orderEdit

Update purchase order header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/edit

Full JSON Payload

{
  "commandId": "update-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorCode
optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorName
optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseAgent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseLocation
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierDONo
optional Supplier delivery order number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierInvoiceNo
optional Supplier invoice number; distinct from SupplierCNNo on purchase returns. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
dueDate
optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone2
optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax1
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
inclusiveTax
optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxDate
optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxEntityID
optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
project
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
projNo
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
department
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deptNo
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.
cancel-purchase-orderVoid

Cancel a purchase order when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/cancel

Full JSON Payload

{
  "commandId": "cancel-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-purchase-orderVoid

Void a purchase order while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/void

Full JSON Payload

{
  "commandId": "void-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-purchase-orderDelete

Delete/void request for a purchase order.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/delete

Full JSON Payload

{
  "commandId": "delete-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-purchase-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-purchase-order",
  "payload": {
    "docNo": "PO-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-purchase-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-goods-received-notesRead

List goods received notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/list

Full JSON Payload

{
  "commandId": "list-goods-received-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-goods-received-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-goods-received-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-goods-received-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-goods-received-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-goods-received-note-linesRead

Read goods received note detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/list

Full JSON Payload

{
  "commandId": "read-goods-received-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-goods-received-note-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
creditorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-goods-received-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-goods-received-note-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-goods-received-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-goods-received-noteRead

Get one goods received note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/get

Full JSON Payload

{
  "commandId": "get-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-goods-received-note",
  "payload": {
    "docNo": "GRN-000001"
  }
}

Payload Fields

docNo
required goods received note document number

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-goods-received-note",
  "payload": {
    "docNo": "GRN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-goods-received-noteValidate

Validate a goods received note without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/validate

Full JSON Payload

{
  "commandId": "validate-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-goods-received-note",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-goods-received-note",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-goods-received-noteCreate

Create a goods received note.

Creates goods received note through AutoCount SDK. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/create

Full JSON Payload

{
  "commandId": "create-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-goods-received-note",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-goods-received-note",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-goods-received-noteEdit

Update goods received note header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/edit

Full JSON Payload

{
  "commandId": "update-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorCode
optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorName
optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseAgent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseLocation
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierDONo
optional Supplier delivery order number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierInvoiceNo
optional Supplier invoice number; distinct from SupplierCNNo on purchase returns. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
dueDate
optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone2
optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax1
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
inclusiveTax
optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxDate
optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxEntityID
optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
project
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
projNo
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
department
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deptNo
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.
cancel-goods-received-noteVoid

Cancel a goods received note when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/cancel

Full JSON Payload

{
  "commandId": "cancel-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-goods-received-noteVoid

Void a goods received note while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/void

Full JSON Payload

{
  "commandId": "void-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-goods-received-noteDelete

Delete/void request for a goods received note.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/delete

Full JSON Payload

{
  "commandId": "delete-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-goods-received-note",
  "payload": {
    "docNo": "GRN-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-purchase-invoicesRead

List purchase invoices.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/list

Full JSON Payload

{
  "commandId": "list-purchase-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-purchase-invoices",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-purchase-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-purchase-invoices",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-purchase-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-purchase-invoice-linesRead

Read purchase invoice detail lines only.

Returns account/project/tax/detail columns where AutoCount stores them.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/list

Full JSON Payload

{
  "commandId": "read-purchase-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-invoice-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-purchase-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-invoice-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-purchase-invoice-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-purchase-invoiceRead

Get one purchase invoice by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/get

Full JSON Payload

{
  "commandId": "get-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-purchase-invoice",
  "payload": {
    "docNo": "PI-000001"
  }
}

Payload Fields

docNo
required purchase invoice document number

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-purchase-invoice",
  "payload": {
    "docNo": "PI-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-purchase-invoiceValidate

Validate a purchase invoice without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/validate

Full JSON Payload

{
  "commandId": "validate-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-purchase-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-purchase-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-purchase-invoiceCreate

Create a purchase invoice; guarded MyInvois type 11 self-billed recovery is supported for TSM.

Normal create uses AutoCount SDK. If default account is missing, call read-default-accounts and use purchaseAccNo, or choose a valid purchase/expense GL account from read-chart-accounts. Recovery is companyId=tsm only, UUID guarded, reload verified, and does not submit to LHDN. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/create

Full JSON Payload

{
  "commandId": "create-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-purchase-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100,
        "accountNo": "610-0000"
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
restoreMode
optional internal recovery value recover-existing-myinvois-direct
confirmNoLhdnSubmit
required true in recovery mode
taxEntity
supplier taxpayer identity required in recovery mode
buyerTaxEntity
buyer taxpayer identity used by self-billed recovery
eInvoiceRecovery
required UUID, timestamps, status, link, totals and tax in recovery mode
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-purchase-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100,
        "accountNo": "610-0000"
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-purchase-invoiceEdit

Update purchase invoice header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/edit

Full JSON Payload

{
  "commandId": "update-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorCode
optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorName
optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseAgent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseLocation
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierDONo
optional Supplier delivery order number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierInvoiceNo
optional Supplier invoice number; distinct from SupplierCNNo on purchase returns. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
dueDate
optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone2
optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax1
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
inclusiveTax
optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxDate
optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxEntityID
optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
project
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
projNo
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
department
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deptNo
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.
cancel-purchase-invoiceVoid

Cancel a purchase invoice when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/cancel

Full JSON Payload

{
  "commandId": "cancel-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-purchase-invoiceVoid

Void a purchase invoice while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/void

Full JSON Payload

{
  "commandId": "void-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-purchase-invoiceDelete

Delete/void request for a purchase invoice.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/delete

Full JSON Payload

{
  "commandId": "delete-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-purchase-invoice",
  "payload": {
    "docNo": "PI-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-cash-purchasesRead

List cash purchases.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/list

Full JSON Payload

{
  "commandId": "list-cash-purchases-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-cash-purchases",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-cash-purchases-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-cash-purchases",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-cash-purchases.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-cash-purchase-linesRead

Read cash purchase detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/list

Full JSON Payload

{
  "commandId": "read-cash-purchase-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-cash-purchase-lines",
  "payload": {
    "accountNo": "610-0000",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-cash-purchase-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-cash-purchase-lines",
  "payload": {
    "accountNo": "610-0000",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-cash-purchase-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-cash-purchaseRead

Get one cash purchase by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/get

Full JSON Payload

{
  "commandId": "get-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-cash-purchase",
  "payload": {
    "docNo": "CP-000001"
  }
}

Payload Fields

docNo
required cash purchase document number

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-cash-purchase",
  "payload": {
    "docNo": "CP-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-cash-purchaseValidate

Validate a cash purchase without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/validate

Full JSON Payload

{
  "commandId": "validate-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-cash-purchase",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-cash-purchase",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-cash-purchaseCreate

Create a cash purchase.

Creates cash purchase when the installed AutoCount SDK exposes the command. If default account is missing, call read-default-accounts and use purchaseAccNo, or choose a valid purchase/expense GL account from read-chart-accounts. Use read-payment-methods first; payments[].paymentMethod must match an active AutoCount Payment Method code, and paymentAmount totals should equal the document total. Line-level project overrides top-level project. Direct void/delete stay guarded until linked payment/cash-book reversal is proven. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/create

Full JSON Payload

{
  "commandId": "create-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-cash-purchase",
  "payload": {
    "creditorCode": "400-S001",
    "supplierInvoiceNo": "SUP-INV-1001",
    "docDate": "2026-06-24",
    "project": "PRJAPI",
    "projNo": "PRJAPI",
    "department": "HQ",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100,
        "accountNo": "610-0000",
        "project": "PRJAPI",
        "projNo": "PRJAPI"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
supplierInvoiceNo
optional supplier invoice number
project
optional project code
projNo
project code alias
projectNo
project code alias
department
optional department code
deptNo
department code alias
items
optional alias for lines
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-cash-purchase",
  "payload": {
    "creditorCode": "400-S001",
    "supplierInvoiceNo": "SUP-INV-1001",
    "docDate": "2026-06-24",
    "project": "PRJAPI",
    "projNo": "PRJAPI",
    "department": "HQ",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100,
        "accountNo": "610-0000",
        "project": "PRJAPI",
        "projNo": "PRJAPI"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-cash-purchaseEdit

Update cash purchase header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/edit

Full JSON Payload

{
  "commandId": "update-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorCode
optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorName
optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseAgent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseLocation
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierDONo
optional Supplier delivery order number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierInvoiceNo
optional Supplier invoice number; distinct from SupplierCNNo on purchase returns. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
dueDate
optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone2
optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax1
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
inclusiveTax
optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxDate
optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxEntityID
optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
project
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
projNo
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
department
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deptNo
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.
cancel-cash-purchaseVoid

Cancel a cash purchase when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/cancel

Full JSON Payload

{
  "commandId": "cancel-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-cash-purchaseVoid

Void a cash purchase while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/void

Full JSON Payload

{
  "commandId": "void-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-cash-purchaseDelete

Delete/void request for a cash purchase.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/cash-purchase/delete

Full JSON Payload

{
  "commandId": "delete-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-cash-purchase-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-cash-purchase",
  "payload": {
    "docNo": "CP-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-cash-purchase.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-purchase-returnsRead

List purchase returns.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/list

Full JSON Payload

{
  "commandId": "list-purchase-returns-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-purchase-returns",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-purchase-returns-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-purchase-returns",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-purchase-returns.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-purchase-return-linesRead

Read purchase return detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/list

Full JSON Payload

{
  "commandId": "read-purchase-return-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-return-lines",
  "payload": {
    "docNo": "PR-000001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
creditorCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-purchase-return-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-return-lines",
  "payload": {
    "docNo": "PR-000001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-purchase-return-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-purchase-returnRead

Get one purchase return by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/get

Full JSON Payload

{
  "commandId": "get-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-purchase-return",
  "payload": {
    "docNo": "PR-000001"
  }
}

Payload Fields

docNo
required purchase return document number

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-purchase-return",
  "payload": {
    "docNo": "PR-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-purchase-returnValidate

Validate a purchase return without saving.

Validation only; does not save. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/validate

Full JSON Payload

{
  "commandId": "validate-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-purchase-return",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-purchase-return",
  "payload": {
    "creditorCode": "400-S001",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "docDate": "2026-06-24",
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-purchase-returnCreate

Create a purchase return.

Creates purchase return through AutoCount Purchase Return SDK when available. Full payload example is for human/Postman reference. For stock-item lines, send itemCode/uom/location and call read-locations for the exact active location code. For account/service lines, omit itemCode and send accountNo / accNo / glAccount / postingAccountNo; many account books still require lines[].location even without itemCode. purchaseLocation is copied to lines that omit location; lines[].location wins. The connector verifies AutoCount accepted the requested detail location before save instead of silently using a default. For purchase invoice/cash purchase, line accountNo is a GL posting account. If AutoCount says no default account or AI does not know the account, first call read-default-accounts and use purchaseAccNo, or list read-chart-accounts and choose a valid purchase/expense account. For AP invoice, if accountNo is omitted the connector tries payload/default purchase account first, then recent AP invoice history for the same creditor. For cash purchase, create/list/get are supported where AutoCount exposes the command; direct void/delete stay guarded until the linked payment/cash-book reversal workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/create

Full JSON Payload

{
  "commandId": "create-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-purchase-return",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date depending on account-book numbering rules
items
optional alias for lines
creditorName
optional supplier display name; AutoCount creditor name is used when omitted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
displayTerm
optional credit term such as C.O.D. or 30 DAYS
dueDate
optional YYYY-MM-DD due date
branchCode
optional creditor branch code/name where the customer uses branches
purchaseLocation
optional exact active AutoCount purchase/stock location code such as HQ-RETAIL; call read-locations first. It fills only lines that omit lines[].location; an explicit line location always wins
purchaseAgent
optional Purchase Agent Maintenance code
attention
optional attention/contact person
contact
optional contact person alias for attention
phone1
optional phone number printed on document
phone
optional phone alias for phone1
phone2
optional secondary phone/mobile number
fax1
optional fax number printed on document
fax
optional fax alias for fax1
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
description
optional document description/narration
ref
optional reference
supplierInvoiceNo
optional supplier invoice number
supplierDONo
optional supplier delivery order number
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean; true when line prices include tax
taxDate
optional YYYY-MM-DD tax date
taxEntityID
optional numeric Tax Entity Maintenance ID for the document header/e-Invoice party
project
optional project code
department
optional department code
lines
required array of stock item rows or account/service rows; items is also accepted as a compatibility alias
accountNo
optional document-level fallback GL posting account for purchase invoice/cash purchase lines when item/account mapping is not enough
postingAccountRule
For create-purchase-invoice and create-cash-purchase, pass lines[].accountNo / accNo / glAccount / postingAccountNo when AutoCount has no default purchase account. Use read-default-accounts.purchaseAccNo or choose a valid purchase/expense account from read-chart-accounts. For create-ap-invoice, if accountNo is omitted the connector also tries the same creditor's recent AP invoice detail account.
payments
optional array for cash purchase style documents; send multiple payment rows for AutoCount Multi Payment. cash purchase void/delete remains guarded because linked payment/cash-book reversal needs module-specific proof
userDefinedFields
optional object of AutoCount user-defined fields; use the AutoCount UDF field name without the UDF_ column prefix, for example { APITEST: value }

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-purchase-return",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "unitPrice": 100
      }
    ],
    "displayTerm": "30 DAYS",
    "branchCode": "MAIN",
    "purchaseLocation": "HQ",
    "purchaseAgent": "PA01",
    "attention": "Supplier Sales Department",
    "contact": "Supplier Sales Department",
    "phone": "03-33333333",
    "address1": "No. 2 Jalan Supplier",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "description": "Purchase document created through API",
    "supplierInvoiceNo": "SUP-INV-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "taxEntityID": 1,
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "API purchase item line 1",
        "description2": "Line second description",
        "furtherDescription": "Optional longer line note",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 80,
        "discount": "0",
        "taxType": "P-0",
        "taxRate": 0,
        "taxAmount": 0,
        "amount": 160,
        "accountNo": "610-0000",
        "postingAccountNo": "610-0000",
        "location": "HQ",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "Blue"
        }
      },
      {
        "accountNo": "610-0000",
        "description": "Service/account line without itemCode",
        "qty": 1,
        "unitPrice": 80,
        "taxType": "P-0",
        "location": "HQ",
        "project": "PRJAPI",
        "department": "HQ"
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      },
      {
        "paymentMethod": "BANK",
        "paymentBy": "Bank Transfer",
        "paymentAmount": 60,
        "chequeNo": "",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-purchase-returnEdit

Update purchase return header/contact fields and supported detail rows.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/edit

Full JSON Payload

{
  "commandId": "update-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorCode
optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorName
optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseAgent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseLocation
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierDONo
optional Supplier delivery order number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierInvoiceNo
optional Supplier invoice number; distinct from SupplierCNNo on purchase returns. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
dueDate
optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone2
optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax1
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
inclusiveTax
optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxDate
optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxEntityID
optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
project
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
projNo
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
department
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deptNo
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierCreditNoteNo
optional Purchase-return SupplierCNNo (supplier credit note number); not SupplierInvoiceNo. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
supplierCNNo
optional Purchase-return SupplierCNNo (supplier credit note number); not SupplierInvoiceNo. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.
cancel-purchase-returnVoid

Cancel a purchase return when AutoCount allows it.

Cancellation depends on AutoCount posting/link status and account-book permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/cancel

Full JSON Payload

{
  "commandId": "cancel-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "cancelled by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional cancellation reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "cancel-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "cancel-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "cancelled by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to cancel-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-purchase-returnVoid

Void a purchase return while keeping audit trail.

Uses AutoCount CancelDocument and returns operationUsed: CancelDocument. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/void

Full JSON Payload

{
  "commandId": "void-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "voided by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional void reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "voided by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-purchase-returnDelete

Delete/void request for a purchase return.

Safely maps to AutoCount cancellation/void behavior. AutoCount may reject if the document is posted, linked, transferred, or blocked by permissions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/delete

Full JSON Payload

{
  "commandId": "delete-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "deleted by API request"
  }
}

Payload Fields

docNo
required document number
reason
optional delete reason

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-purchase-return",
  "payload": {
    "docNo": "PR-000001",
    "reason": "deleted by API request"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-goods-received-note-to-purchase-invoiceTransfer

Transfer goods received note to purchase invoice.

Multi-GRN support requires an updated connector; verify installation before using fromDocNos. Sources must share supplier, currency/rate and inclusive-tax mode. Native PartialTransfer preserves GRN linkage, source price/tax/UOM/location/batch; one native PI Save is followed by read-back of identity, amounts, links and source quantities. Supports normal stock lines; serial items, FOC, packages and unsupported discount calculations are guarded. No batch/expiry or price overrides. A failed transfer never calls Save. If saved is null or true with ok=false, reconcile the returned DocNo/DocKey before retrying; do not cancel/recreate or claim rollback. Reuse the same commandId when polling/retrying the same request.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/transfer

Full JSON Payload

{
  "commandId": "transfer-goods-received-note-to-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-goods-received-note-to-purchase-invoice",
  "payload": {
    "fromDocNos": [
      "GR-016420",
      "GR-016421"
    ],
    "docDate": "2026-06-30",
    "supplierInvoiceNo": "SUP-000861",
    "saveAsDraft": false
  }
}

Payload Fields

fromDocNos
array of 1-100 distinct GRN numbers for one new PI; use this OR a single fromDocNo/sourceDocNo
fromDocNo
optional single GRN number; must be text, never an array
sourceDocNo
alias for the single fromDocNo; cannot combine with fromDocNos
docNo
optional new PI number; omit for AutoCount numbering. An existing PI is never overwritten
targetDocNo
alias for docNo
docDate
optional target date YYYY-MM-DD
supplierInvoiceNo
optional supplier invoice reference for the new PI
creditorCode
optional assertion; must match every source GRN
currencyCode
optional assertion; must match every source GRN
inclusiveTax
optional assertion; must match every source GRN
lines
optional nonempty array [{sourceDocNo, sourceDtlKey, qty}]; source UOM quantities. Read each GRN's DtlKey first. Each listed GRN needs at least one selected row; duplicate source/key pairs are rejected. Omit lines to transfer outstanding quantities. Maximum 5000 rows
transferQtyMode
outstanding only for multi-GRN/selected-line mode; includes pending draft reservations when calculating availability
transferOption
FullDetails only; unsummarized native transfer
saveAsDraft
optional boolean; true uses SDK Save(true) and verifies Draft status and pending source quantities
description
optional target narration
ref
optional target reference

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-goods-received-note-to-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-goods-received-note-to-purchase-invoice",
  "payload": {
    "fromDocNos": [
      "GR-016420",
      "GR-016421"
    ],
    "docDate": "2026-06-30",
    "supplierInvoiceNo": "SUP-000861",
    "saveAsDraft": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-goods-received-note-to-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-purchase-invoice-to-purchase-returnTransfer

Transfer purchase invoice to purchase return.

Uses AutoCount transfer logic. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/transfer

Full JSON Payload

{
  "commandId": "transfer-purchase-invoice-to-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-purchase-invoice-to-purchase-return",
  "payload": {
    "sourceDocNo": "PI-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer purchase invoice to purchase return",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source purchase invoice document number
targetDocNo
optional target purchase return document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-purchase-invoice-to-purchase-return-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-purchase-invoice-to-purchase-return",
  "payload": {
    "sourceDocNo": "PI-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer purchase invoice to purchase return",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-purchase-invoice-to-purchase-return.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-purchase-order-to-goods-received-noteTransfer

Transfer purchase order to goods received note.

Uses AutoCount transfer logic. AutoCount transfer rules decide which source lines and quantities are allowed. Omit lines to transfer the normal outstanding balance where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/transfer

Full JSON Payload

{
  "commandId": "transfer-purchase-order-to-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-purchase-order-to-goods-received-note",
  "payload": {
    "sourceDocNo": "PO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer purchase order to goods received note",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
}

Payload Fields

sourceDocNo
required source purchase order document number
targetDocNo
optional target goods received note document number; omit to let AutoCount numbering generate it
docDate
optional YYYY-MM-DD target document date
creditorCode
optional supplier code where transfer creates a purchase document
debtorCode
optional customer code where transfer creates a sales document
transferQtyMode
optional transfer quantity mode such as all or outstanding
saveAsDraft
optional boolean; for delivery-order to sales-invoice, true saves the transferred invoice as an AutoCount draft
lines
optional selected source line rows with itemCode, sourceLineNo, qty, uom
description
optional target document narration
ref
optional target reference

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-purchase-order-to-goods-received-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-purchase-order-to-goods-received-note",
  "payload": {
    "sourceDocNo": "PO-000001",
    "targetDocNo": "",
    "docDate": "2026-06-24",
    "creditorCode": "400-S001",
    "transferQtyMode": "outstanding",
    "saveAsDraft": false,
    "description": "Transfer purchase order to goods received note",
    "ref": "API-TRANSFER-1001",
    "lines": [
      {
        "sourceLineNo": 1,
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-purchase-order-to-goods-received-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
transfer-purchase-order-to-purchase-invoiceTransfer

Transfer purchase order to purchase invoice, optionally assigning item batches and batch expiry.

Requires local-mvp-2026.09.29.01 or later installed on the selected connector; publishing the download does not install it. Older builds may ignore batchAllocations and full-transfer; never trial against an older or unconfirmed build. Legacy mode without batchAllocations uses native PO FullDetails transfer. lines is NOT a selection or partial-quantity list; legacy mode still transfers all available source lines with optional single-batch assignments. batchAllocations cannot combine with lines and transfers only explicitly allocated rows; repeated sourceDtlKey splits a source row across batches. Each qty is positive in the source UOM; remaining = Qty - (TransferedQty + PendingTransferredQty) / Rate because those PO counters use smallest-UOM units. Native TSM 22-check acceptance passed for native PO linkage, source price/tax and saved totals, BOX Rate10 draft reservation, simple percent and prorated fixed discount, and 8% tax. No itemCode/UOM/price/tax/total overrides. Guards reject compound discounts, serial items, item packages and FOC allocations. Proportional DiscountAmt/SubTotal/Tax checks apply per-row and per-source aggregate tolerance 0.01 within each request; larger rounding drift rejects. Read actual sourceDtlKey and source quantities with read-purchase-order-lines filtered by docNo or get-purchase-order. createMissingBatches=true permits missing batches; lines[].batchExpiryDate or batchAllocations[].batchExpiryDate uses YYYY-MM-DD. updateExistingBatchExpiry=true explicitly permits shared Item Master expiry changes, not just this PI. Both flags require update-item policy permission; omit expiry to preserve it. Expiry conflicts and ambiguous mappings reject. Response includes writeVerification, batchMasterVerification, linkageVerified, sourceQuantityVerification and totalsVerified after fresh reload. Batch master and PI use separate SDK saves: inspect stage, batchMasterChanges and saved on failure (null means unknown), and read back before retrying; a duplicate-PI failure with a retained batch commit was verified. Sequential stale-reader native proof PASS: second stale PI aborted and was absent; truly simultaneous external-writer atomicity remains unproven. No connector SQL writes or source deletion/recreation. Native acceptance is bounded to tested cases, not every account book or discount/tax expression.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/transfer

Full JSON Payload

{
  "commandId": "transfer-purchase-order-to-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-purchase-order-to-purchase-invoice",
  "payload": {
    "fromDocNo": "PO-000001",
    "docDate": "2026-06-29",
    "createMissingBatches": false,
    "updateExistingBatchExpiry": false,
    "lines": [
      {
        "sourceDtlKey": 12345,
        "batchNo": "BATCH-001"
      }
    ]
  }
}

Payload Fields

fromDocNo
required source PO number
docNo
optional target PI number; omit for AutoCount numbering
docDate
optional target date YYYY-MM-DD
lines
optional batch assignments only: [{sourceDtlKey, batchNo, batchExpiryDate?}]. Read DtlKey from get-purchase-order or read-purchase-order-lines first. batchno aliases batchNo. No itemCode/qty/price overrides; omitted lines retain native transfer values. Batch-enabled full transfers reject POs with prior or pending transferred quantities to prevent duplicate transfer.
batchAllocations
optional non-empty array [{sourceDtlKey, qty, batchNo, batchExpiryDate?}]; only explicitly allocated rows transfer. Positive source-UOM quantities, repeated sourceDtlKey allowed for batch splits. Cannot combine with lines. Read actual source DtlKey and available quantity first. Requires local-mvp-2026.09.29.01 or later installed on the selected connector; older builds may ignore this field and full-transfer.
createMissingBatches
optional boolean, default false; create missing ItemCode + BatchNo through SDK; requires update-item policy permission
updateExistingBatchExpiry
optional boolean, default false; explicitly permit changing shared batch master expiry; requires update-item policy permission
saveAsDraft
optional boolean; native SDK draft save when supported by the account book

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "transfer-purchase-order-to-purchase-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "transfer-purchase-order-to-purchase-invoice",
  "payload": {
    "fromDocNo": "PO-000001",
    "docDate": "2026-06-29",
    "createMissingBatches": false,
    "updateExistingBatchExpiry": false,
    "lines": [
      {
        "sourceDtlKey": 12345,
        "batchNo": "BATCH-001"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to transfer-purchase-order-to-purchase-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-purchase-detail-linesRead

Read all purchase document lines together, or filter with document.

Prefer the document-specific read-*-lines commands when the document family is known.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase/list

Full JSON Payload

{
  "commandId": "read-purchase-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-detail-lines",
  "payload": {
    "document": "purchase-invoice",
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

document
optional: purchase-invoice | cash-purchase | goods-received-note | purchase-order | purchase-return
itemCode
optional
creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-purchase-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-purchase-detail-lines",
  "payload": {
    "document": "purchase-invoice",
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-purchase-detail-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-request-quotationRead

Get one request quotation (RFQ) by document number.

Reads available public SDK fields and lines. Inspect fields.readErrors for getter failures; missing values are not proof of empty fields. RFQ SDK availability is verified; per-field/account-book acceptance remains runtime-specific.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/quotation/get

Full JSON Payload

{
  "commandId": "get-request-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-request-quotation",
  "payload": {
    "docNo": "RFQ-000001"
  }
}

Payload Fields

docNo
required existing RFQ document number

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-request-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-request-quotation",
  "payload": {
    "docNo": "RFQ-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-request-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-request-quotationEdit

Update an existing request quotation (RFQ) with verified persistence or native no-save preflight.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/quotation/edit

Full JSON Payload

{
  "commandId": "update-request-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-request-quotation",
  "payload": {
    "docNo": "RFQ-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
}

Payload Fields

docNo
required existing document number (selector)
reason
required business reason
docDate
optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorCode
optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
creditorName
optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseAgent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
agent
optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
purchaseLocation
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
location
optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
ref
optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
description
optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
displayTerm
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
term
optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr1
optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone1
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone
optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
attention
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
contact
optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
branchCode
optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyCode
optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
currencyRate
optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
note
optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark1
optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark2
optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark3
optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
remark4
optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
refDocNo
optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipVia
optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
shipInfo
optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
dueDate
optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr2
optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr3
optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
address4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
invAddr4
optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
phone2
optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax1
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
fax
optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
inclusiveTax
optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxDate
optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
taxEntityID
optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
project
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
projNo
optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
department
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deptNo
optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
deliverAddress1
optional RFQ delivery address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
userDefinedFields
optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.
Master
optional header object of public SDK scalar fields
nativeFields
optional native header container: { Master: { SDKField: value } }
validateOnly
optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof
detailMode
explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates
lines
optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-request-quotation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-request-quotation",
  "payload": {
    "docNo": "RFQ-000001",
    "reason": "Correct supplier reference",
    "description": "Updated purchase header"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-request-quotation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.
change-purchase-agentwrite

Change a purchase agent code.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase/change-purchase-agent

Full JSON Payload

{
  "commandId": "change-purchase-agent-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-purchase-agent",
  "payload": {
    "oldAgent": "OLD-AGENT",
    "newAgent": "NEW-AGENT",
    "confirm": true
  }
}

Payload Fields

oldAgent
required old value for oldAgent
newAgent
required new value for newAgent
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-purchase-agent-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-purchase-agent",
  "payload": {
    "oldAgent": "OLD-AGENT",
    "newAgent": "NEW-AGENT",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-purchase-agent.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
print-purchase-documentwrite

Native purchase printing with verified Print Count; physical purchase template testing remains required.

Requires connector 2026.09.11.01 and Purchase Edit permission. Purchase invoice PDF count verified; physical purchase output is not yet proven. Spooler completion required; missing/disappearing jobs return uncertain. Reuse commandId and manually reconcile interrupted output.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase/print-purchase-document

Full JSON Payload

{
  "commandId": "print-purchase-document-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "print-purchase-document",
  "payload": {
    "document": "purchase-invoice",
    "docNo": "PI-000001",
    "reportName": "Purchase Invoice",
    "printerName": "MF240 Series"
  }
}

Payload Fields

document
purchase-invoice | purchase-order | goods-received-note | purchase-return | cash-purchase
docNo
required
reportName
required exact installed AutoCount template name
printerName
required exact installed Windows printer name

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "print-purchase-document-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "print-purchase-document",
  "payload": {
    "document": "purchase-invoice",
    "docNo": "PI-000001",
    "reportName": "Purchase Invoice",
    "printerName": "MF240 Series"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to print-purchase-document.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

AR

Customer/debtor invoice, payment, refund, credit note, debit note, outstanding documents, statement, and knock-off.

list-ar-invoicesRead

List AR invoices.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/list

Full JSON Payload

{
  "commandId": "list-ar-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-invoices",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ar-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-invoices",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ar-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-invoice-linesRead

Read AR invoice detail/account lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/list

Full JSON Payload

{
  "commandId": "read-ar-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-invoice-lines",
  "payload": {
    "accountNo": "500-0000",
    "limit": 50
  }
}

Payload Fields

debtorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-invoice-lines",
  "payload": {
    "accountNo": "500-0000",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-invoice-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-outstanding-documentsRead

List outstanding AR invoice documents with docKey for allocation and knock-off.

Returns SDK-safe docType RI plus displayDocType IV. Use the returned docType for AR payment and AR credit-note invoice knock-off.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-outstanding/list

Full JSON Payload

{
  "commandId": "read-ar-outstanding-documents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-outstanding-documents",
  "payload": {
    "debtorCode": "300-A001",
    "maxRows": 0
  }
}

Payload Fields

debtorCode
optional debtor/customer code
maxRows
optional row limit; maxRows: 0 means return all rows

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-outstanding-documents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-outstanding-documents",
  "payload": {
    "debtorCode": "300-A001",
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-outstanding-documents.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ar-invoiceRead

Get one AR invoice by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/get

Full JSON Payload

{
  "commandId": "get-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-invoice",
  "payload": {
    "docNo": "ARI-000001"
  }
}

Payload Fields

docNo
required AR invoice document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-invoice",
  "payload": {
    "docNo": "ARI-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ar-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ar-invoiceValidate

Validate an AR invoice without saving.

AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/validate

Full JSON Payload

{
  "commandId": "validate-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
amount
optional single-line amount; lines is preferred for multiple lines
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional debtor/customer branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
optional user-selected GL posting account for simple one-line payload; overrides the connector/default account
taxType
optional tax type/code
lines
optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ar-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ar-invoiceCreate

Create an AR invoice.

Requires write access permission. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/create

Full JSON Payload

{
  "commandId": "create-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
optional single-line amount; lines is preferred for multiple lines
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional debtor/customer branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
optional user-selected GL posting account for simple one-line payload; overrides the connector/default account
taxType
optional tax type/code
lines
optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-invoice",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ar-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ar-invoiceEdit

Update AR invoice header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/edit

Full JSON Payload

{
  "commandId": "update-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-invoice",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
debtorCode
optional customer/debtor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array for credit-note style documents; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-invoice",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ar-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ar-invoiceVoid

Guarded AR invoice void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/void

Full JSON Payload

{
  "commandId": "void-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-invoice",
  "payload": {
    "docNo": "ARI-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-invoice",
  "payload": {
    "docNo": "ARI-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ar-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ar-invoiceDelete

Guarded AR invoice delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/delete

Full JSON Payload

{
  "commandId": "delete-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-invoice",
  "payload": {
    "docNo": "ARI-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ar-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-invoice",
  "payload": {
    "docNo": "ARI-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ar-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ar-paymentsRead

List AR payments.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/list

Full JSON Payload

{
  "commandId": "list-ar-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-payments",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ar-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-payments",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ar-payments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-detail-linesRead

Read AR account/detail lines across AR invoices, payments, refunds, credit notes, and debit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar/list

Full JSON Payload

{
  "commandId": "read-ar-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-detail-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
}

Payload Fields

debtorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-detail-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-detail-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-payment-linesRead

Read AR payment detail/payment method lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/list

Full JSON Payload

{
  "commandId": "read-ar-payment-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-payment-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
}

Payload Fields

debtorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-payment-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-payment-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-payment-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-refund-linesRead

Read AR refund detail/payment method lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/list

Full JSON Payload

{
  "commandId": "read-ar-refund-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-refund-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
}

Payload Fields

debtorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-refund-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-refund-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-refund-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ar-paymentRead

Get one AR payment by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/get

Full JSON Payload

{
  "commandId": "get-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-payment",
  "payload": {
    "docNo": "OR-000001"
  }
}

Payload Fields

docNo
required AR payment document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-payment",
  "payload": {
    "docNo": "OR-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ar-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ar-paymentValidate

Validate an AR payment/receipt without saving. Supports one or many real invoice knock-offs.

Real positive knock-off validation is proven for outstanding AR documents. The connector also accepts old IV aliases and normalizes them to RI. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/validate

Full JSON Payload

{
  "commandId": "validate-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-payment",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-payment",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ar-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ar-depositCreate

Create an AR deposit with a real payment detail and GL transaction.

Requires write access permission. Real save is tested against AutoCount ARDepositCommand and verifies GLTrxID. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Creates a real AutoCount deposit with one payment detail row and posts a GL transaction when saved.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar/create

Full JSON Payload

{
  "commandId": "create-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-deposit",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AR deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
required deposit amount
paymentMethod
optional AutoCount Payment Method code such as CASH or MAYBANK
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
depositPaymentMethod
optional AutoCount deposit header payment method; defaults from paymentMethod
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
description
optional deposit narration
note
optional note
isSecurityDeposit
optional boolean; true for security deposit where AutoCount account book supports it
project
optional project code
department
optional department code

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-deposit",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AR deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ar-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ar-paymentCreate

Create an AR payment/receipt. Supports one or many real invoice knock-offs.

Requires write access permission. Real multi-invoice knock-off save is proven; IV aliases are normalized to RI. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/create

Full JSON Payload

{
  "commandId": "create-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-payment",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-payment",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ar-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ar-paymentEdit

Update AR payment header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/edit

Full JSON Payload

{
  "commandId": "update-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-payment",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
debtorCode
optional customer/debtor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
paymentLines
optional payment detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-payment",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ar-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ar-paymentVoid

Guarded AR payment void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/void

Full JSON Payload

{
  "commandId": "void-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-payment",
  "payload": {
    "docNo": "OR-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-payment",
  "payload": {
    "docNo": "OR-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ar-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ar-paymentDelete

Guarded AR payment delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/delete

Full JSON Payload

{
  "commandId": "delete-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-payment",
  "payload": {
    "docNo": "OR-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ar-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-payment",
  "payload": {
    "docNo": "OR-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ar-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ar-refundsRead

List AR refunds.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/list

Full JSON Payload

{
  "commandId": "list-ar-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-refunds",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ar-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-refunds",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ar-refunds.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ar-refundRead

Get one AR refund by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/get

Full JSON Payload

{
  "commandId": "get-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-refund",
  "payload": {
    "docNo": "PV-000001"
  }
}

Payload Fields

docNo
required AR refund document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-refund",
  "payload": {
    "docNo": "PV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ar-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ar-refundValidate

Validate an AR refund without saving. Refund knocks off AR credit notes, not invoices. Use docType RC or friendly CN alias; docKey is recommended.

Real AR refund knock-off save is proven against AR credit notes. CN/CreditNote aliases are normalized to RC. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/validate

Full JSON Payload

{
  "commandId": "validate-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-refund",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-refund",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ar-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ar-refundCreate

Create an AR refund. Refund knocks off AR credit notes, not invoices. Use docType RC or friendly CN alias; docKey is recommended.

Requires write access permission. Real AR refund knock-off save is proven against AR credit notes; CN aliases are normalized to RC. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/create

Full JSON Payload

{
  "commandId": "create-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-refund",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-refund",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AR payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ar-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ar-refundEdit

Update AR refund header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/edit

Full JSON Payload

{
  "commandId": "update-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-refund",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
debtorCode
optional customer/debtor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
paymentLines
optional payment detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-refund",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ar-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ar-refundVoid

Guarded AR refund void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/void

Full JSON Payload

{
  "commandId": "void-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ar-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ar-refundDelete

Guarded AR refund delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/delete

Full JSON Payload

{
  "commandId": "delete-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ar-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ar-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ar-credit-notesRead

List AR credit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/list

Full JSON Payload

{
  "commandId": "list-ar-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-credit-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ar-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-credit-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ar-credit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-credit-note-linesRead

Read AR credit note detail/account lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/list

Full JSON Payload

{
  "commandId": "read-ar-credit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-credit-note-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
}

Payload Fields

debtorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-credit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-credit-note-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-credit-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ar-credit-noteRead

Get one AR credit note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/get

Full JSON Payload

{
  "commandId": "get-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-credit-note",
  "payload": {
    "docNo": "CN-000001"
  }
}

Payload Fields

docNo
required AR credit note document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-credit-note",
  "payload": {
    "docNo": "CN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ar-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ar-credit-noteValidate

Validate an AR credit note without saving. Supports one or many real invoice knock-offs.

Real positive knock-off validation is proven for outstanding AR documents. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/validate

Full JSON Payload

{
  "commandId": "validate-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "lineDescription": "Credit adjustment",
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
amount
optional single-line amount; lines is preferred for multiple lines
lineDescription
optional
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional debtor/customer branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
optional user-selected GL posting account for simple one-line payload; overrides the connector/default account
taxType
optional tax type/code
lines
optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "lineDescription": "Credit adjustment",
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ar-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ar-credit-noteCreate

Create an AR credit note. Supports one or many real invoice knock-offs.

Requires write access permission. Real knock-off validation is proven; saving should still be tested per account book. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/create

Full JSON Payload

{
  "commandId": "create-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "lineDescription": "Credit adjustment",
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
optional single-line amount; lines is preferred for multiple lines
lineDescription
optional
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional debtor/customer branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
optional user-selected GL posting account for simple one-line payload; overrides the connector/default account
taxType
optional tax type/code
lines
optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-credit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "lineDescription": "Credit adjustment",
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ar-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ar-credit-noteEdit

Update AR credit note header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/edit

Full JSON Payload

{
  "commandId": "update-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-credit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
debtorCode
optional customer/debtor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array for credit-note style documents; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-credit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ar-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ar-credit-noteVoid

Guarded AR credit note void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/void

Full JSON Payload

{
  "commandId": "void-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ar-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ar-credit-noteDelete

Guarded AR credit note delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/delete

Full JSON Payload

{
  "commandId": "delete-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ar-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-credit-note",
  "payload": {
    "docNo": "CN-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ar-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ar-debit-notesRead

List AR debit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/list

Full JSON Payload

{
  "commandId": "list-ar-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-debit-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ar-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-debit-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ar-debit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-debit-note-linesRead

Read AR debit note detail/account lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/list

Full JSON Payload

{
  "commandId": "read-ar-debit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-debit-note-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
}

Payload Fields

debtorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-debit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-debit-note-lines",
  "payload": {
    "debtorCode": "300-A001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-debit-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ar-debit-noteRead

Get one AR debit note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/get

Full JSON Payload

{
  "commandId": "get-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-debit-note",
  "payload": {
    "docNo": "DN-000001"
  }
}

Payload Fields

docNo
required AR debit note document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-debit-note",
  "payload": {
    "docNo": "DN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ar-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ar-debit-noteValidate

Validate an AR debit note without saving.

AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/validate

Full JSON Payload

{
  "commandId": "validate-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "lineDescription": "Debit adjustment",
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
amount
optional single-line amount; lines is preferred for multiple lines
lineDescription
optional
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional debtor/customer branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
optional user-selected GL posting account for simple one-line payload; overrides the connector/default account
taxType
optional tax type/code
lines
optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "amount": 100,
    "lineDescription": "Debit adjustment",
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ar-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ar-debit-noteCreate

Create an AR debit note.

Creates AR debit note through AutoCount SDK. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/create

Full JSON Payload

{
  "commandId": "create-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "lineDescription": "Debit adjustment",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
optional single-line amount; lines is preferred for multiple lines
lineDescription
optional
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional debtor/customer branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
optional user-selected GL posting account for simple one-line payload; overrides the connector/default account
taxType
optional tax type/code
lines
optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ar-debit-note",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "lineDescription": "Debit adjustment",
    "dueDate": "2026-07-24",
    "description": "AR document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "500-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "501-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "RI",
        "docKey": "424508",
        "docNo": "IV-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ar-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ar-debit-noteEdit

Update AR debit note header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/edit

Full JSON Payload

{
  "commandId": "update-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-debit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
debtorCode
optional customer/debtor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array for credit-note style documents; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-debit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ar-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ar-debit-noteVoid

Guarded AR debit note void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/void

Full JSON Payload

{
  "commandId": "void-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ar-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ar-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ar-debit-noteDelete

Guarded AR debit note delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/delete

Full JSON Payload

{
  "commandId": "delete-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ar-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ar-debit-note",
  "payload": {
    "docNo": "DN-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ar-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ar-depositsRead

List AR deposits.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar/list

Full JSON Payload

{
  "commandId": "list-ar-deposits-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-deposits",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ar-deposits-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ar-deposits",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ar-deposits.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ar-outstandingRead

Legacy AR outstanding lookup. Prefer read-ar-outstanding-documents for docKey-based knock-off.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-outstanding/list

Full JSON Payload

{
  "commandId": "read-ar-outstanding-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-outstanding",
  "payload": {
    "debtorCode": "300-A001",
    "maxRows": 0
  }
}

Payload Fields

debtorCode
optional debtor/customer code
maxRows
optional row limit; maxRows: 0 means return all rows

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ar-outstanding-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ar-outstanding",
  "payload": {
    "debtorCode": "300-A001",
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ar-outstanding.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-debtorsRead

List debtors/customers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/list

Full JSON Payload

{
  "commandId": "read-debtors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-debtors",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-debtors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-debtors",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-debtors.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ar-depositRead

Get one AR deposit by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar/get

Full JSON Payload

{
  "commandId": "get-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-deposit",
  "payload": {
    "docNo": "OR-000001"
  }
}

Payload Fields

docNo
required AR deposit document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ar-deposit",
  "payload": {
    "docNo": "OR-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ar-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-debtor-credit-controlRead

Read one debtor/customer credit-control settings through AutoCount debtor SDK.

Returns stable fields such as companyName, controlAccount, currencyCode, creditTerm and a creditControl field map containing credit/term/limit/control fields exposed by that AutoCount DLL.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/get

Full JSON Payload

{
  "commandId": "get-debtor-credit-control-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-debtor-credit-control",
  "payload": {
    "accNo": "300-A001"
  }
}

Payload Fields

accNo
required debtor/customer code; debtorCode or customerCode also accepted

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-debtor-credit-control-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-debtor-credit-control",
  "payload": {
    "accNo": "300-A001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-debtor-credit-control.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-debtor-detailRead

Read one debtor/customer with all public SDK fields and child tables.

Uses AutoCount.ARAP.Debtor.DebtorDataAccess.GetDebtor. Returns fields and child tables such as DebtorTable, BranchTable, ContactTable, TaxExemptionTable, and GLMastTable when available. Do not queue many maxTableRows:0 single-detail calls; use export-debtor-details for large exports.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/get

Full JSON Payload

{
  "commandId": "get-debtor-detail-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-debtor-detail",
  "payload": {
    "accNo": "300-A001",
    "maxTableRows": 20
  }
}

Payload Fields

accNo
required debtor/customer code; debtorCode or customerCode also accepted
maxTableRows
optional child-table row limit; use 20-100 for normal lookup
includeTableData
optional boolean, default true

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-debtor-detail-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-debtor-detail",
  "payload": {
    "accNo": "300-A001",
    "maxTableRows": 20
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-debtor-detail.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ar-depositValidate

Validate an AR deposit without saving.

AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Creates a real AutoCount deposit with one payment detail row and posts a GL transaction when saved.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar/validate

Full JSON Payload

{
  "commandId": "validate-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-deposit",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AR deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
}

Payload Fields

debtorCode
required AutoCount debtor/customer code
docDate
required or optional YYYY-MM-DD document date
amount
required deposit amount
paymentMethod
optional AutoCount Payment Method code such as CASH or MAYBANK
_arApRule
AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
depositPaymentMethod
optional AutoCount deposit header payment method; defaults from paymentMethod
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
description
optional deposit narration
note
optional note
isSecurityDeposit
optional boolean; true for security deposit where AutoCount account book supports it
project
optional project code
department
optional department code

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ar-deposit",
  "payload": {
    "debtorCode": "300-A001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AR deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ar-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ar-depositEdit

Update an AR deposit editable SDK fields and supported detail rows with persisted verification.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Deposit editing is limited to unallocated deposits; cancelled, transferred, refunded or forfeited deposits are blocked. Native acceptance must be verified on the selected account book.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar/edit

Full JSON Payload

{
  "commandId": "update-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-deposit",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
reason
required audit reason
description
optional description; null or empty clears optional text
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values
detailMode
explicit update | append | replace | delete for detail edits
paymentLines
optional payment detail updates selected by dtlKey

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ar-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ar-deposit",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ar-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Deposit editing is limited to unallocated deposits; cancelled, transferred, refunded or forfeited deposits are blocked. Native acceptance must be verified on the selected account book.
export-debtor-detailsread

Export all debtor/customer master records in one read-only command, including more than 5000.

Requires connector local-mvp-2026.10.08.02 or later. Send one command and poll that command; do not queue thousands of get-debtor-detail calls. Fast mode reads internally in batches of at most 1000. Omit maxDebtors to export all; an explicit 5000 still limits the result to 5000. Check exportComplete, partial, rows and exportedRows. For large results, inline data is only a preview (responseTruncated:true); download result.artifactUrl / GET /v1/commands/{commandId}/artifact using the same tenant authorization, decompress gzip and parse JSON data. fullReturnedRows is the downloaded record count. The compressed artifact has an 8 MiB safety limit; excess size or a failed batch fails the command, never reports a complete export. This is a live read, not a point-in-time snapshot; detected count/boundary changes fail for retry. Full mode defaults/caps at 5000 and supplies child tables; use get-debtor-detail for one customer. Creditor export limits are unchanged. See docs/debtor-detail-export-api.md.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/export-debtor-details

Full JSON Payload

{
  "commandId": "export-debtor-details-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "export-debtor-details",
  "payload": {
    "includeTableData": false,
    "activeOnly": false
  }
}

Payload Fields

maxDebtors
optional nonnegative integer; omitted or 0 exports all master records in fast mode; positive values limit the export, including values above 5000; full SDK detail remains capped at 5000
maxTableRows
optional positive child-table row limit per debtor, default 20; maxTableRows:0 is rejected
includeTableData
optional boolean, default true; fast mode always skips child tables
activeOnly
optional boolean, default false
detailMode
optional: auto (default), fast (master fields only), full (bounded per-debtor SDK fields and child tables); auto uses fast when maxDebtors is omitted, 0 or above 1000; explicit 1-1000 retains SDK detail

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "export-debtor-details-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "export-debtor-details",
  "payload": {
    "includeTableData": false,
    "activeOnly": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to export-debtor-details.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

AP

Supplier/creditor invoice, payment, refund, credit note, debit note, outstanding documents, statement, and knock-off.

list-ap-invoicesRead

List AP invoices.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/list

Full JSON Payload

{
  "commandId": "list-ap-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-invoices",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ap-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-invoices",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ap-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-invoice-linesRead

Read AP invoice detail/account lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/list

Full JSON Payload

{
  "commandId": "read-ap-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-invoice-lines",
  "payload": {
    "accountNo": "610-0000",
    "limit": 50
  }
}

Payload Fields

creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-invoice-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-invoice-lines",
  "payload": {
    "accountNo": "610-0000",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-invoice-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-outstanding-documentsRead

List outstanding AP invoice documents with docKey for allocation and knock-off.

Returns SDK-safe docType PB plus displayDocType PI. Use the returned docType for AP payment and AP credit-note invoice knock-off.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-outstanding/list

Full JSON Payload

{
  "commandId": "read-ap-outstanding-documents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-outstanding-documents",
  "payload": {
    "creditorCode": "400-S001",
    "maxRows": 0
  }
}

Payload Fields

creditorCode
optional creditor/supplier code
maxRows
optional row limit; maxRows: 0 means return all rows

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-outstanding-documents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-outstanding-documents",
  "payload": {
    "creditorCode": "400-S001",
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-outstanding-documents.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ap-invoiceRead

Get one AP invoice by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/get

Full JSON Payload

{
  "commandId": "get-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-invoice",
  "payload": {
    "docNo": "API-000001"
  }
}

Payload Fields

docNo
required AP invoice document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-invoice",
  "payload": {
    "docNo": "API-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ap-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ap-invoiceValidate

Validate an AP invoice without saving.

Use validate before create when AI imports many supplier bills. Posting account order is: lines[].accountNo/top-level accountNo, AutoCount default purchase account, then recent AP invoice detail account for the same creditor. If no account is found, connector returns a clear validation error before AutoCount save. Send top-level project/projNo to apply one project to every line, or send line-level project/projNo for different projects per line. For taxable AP lines, use a purchase-side tax code from list-tax-codes, for example TX in Singapore GST books. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/validate

Full JSON Payload

{
  "commandId": "validate-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "supplierInvoiceNo": "SUP-INV-1001",
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "ref": "API-REF-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "project": "PRJAPI",
    "projNo": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "description": "AP document created through API",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
supplierInvoiceNo
required supplier invoice number
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
ref
optional reference
currencyCode
optional currency code such as MYR
inclusiveTax
optional boolean
project
optional top-level project fallback for all AP invoice detail lines
projNo
project code alias
projectNo
project code alias
department
optional top-level department fallback
deptNo
department code alias
lines
recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo
accountNo
required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account
amount
optional single-line amount; lines is preferred for multiple lines
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
description
optional document description/narration
branchCode
optional creditor/supplier branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyRate
optional exchange rate
taxDate
optional YYYY-MM-DD tax date
taxType
optional tax type/code
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "supplierInvoiceNo": "SUP-INV-1001",
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "ref": "API-REF-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "project": "PRJAPI",
    "projNo": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "description": "AP document created through API",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ap-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ap-invoiceCreate

Create an AP invoice.

Creates AP invoice through AutoCount SDK. The connector pre-checks creditorCode, AP journalType, detail count, and every GL posting account before SaveAPInvoice. Posting account order is: lines[].accountNo/top-level accountNo, AutoCount default purchase account, then recent AP invoice detail account for the same creditor. Send top-level project/projNo to apply one project to every line, or send line-level project/projNo for different projects per line. For taxable AP lines, use a purchase-side tax code from list-tax-codes, for example TX in Singapore GST books. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/create

Full JSON Payload

{
  "commandId": "create-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "supplierInvoiceNo": "SUP-INV-1001",
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "ref": "API-REF-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "project": "PRJAPI",
    "projNo": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "description": "AP document created through API",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
supplierInvoiceNo
required supplier invoice number
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
ref
optional reference
currencyCode
optional currency code such as MYR
inclusiveTax
optional boolean
project
optional top-level project fallback for all AP invoice detail lines
projNo
project code alias
projectNo
project code alias
department
optional top-level department fallback
deptNo
department code alias
lines
recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo
accountNo
required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account
amount
optional single-line amount; lines is preferred for multiple lines
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
description
optional document description/narration
branchCode
optional creditor/supplier branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyRate
optional exchange rate
taxDate
optional YYYY-MM-DD tax date
taxType
optional tax type/code
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-invoice",
  "payload": {
    "creditorCode": "400-S001",
    "supplierInvoiceNo": "SUP-INV-1001",
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "ref": "API-REF-1001",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "project": "PRJAPI",
    "projNo": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "description": "AP document created through API",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ap-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ap-invoiceEdit

Update AP invoice header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. docNo selects the existing invoice; newDocNo is the dedicated renumber field, supplierInvoiceNo/invoiceNo is the supplier reference.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/edit

Full JSON Payload

{
  "commandId": "update-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-invoice",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
creditorCode
optional supplier/creditor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array for credit-note style documents; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
newDocNo
optional new AutoCount document number; docNo remains the lookup key
supplierInvoiceNo
optional supplier invoice number for AP invoice
supplierInvNo
alias for supplierInvoiceNo on AP invoice updates
invoiceNo
alias for supplierInvoiceNo on AP invoice updates
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-invoice",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ap-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. docNo selects the existing invoice; newDocNo is the dedicated renumber field, supplierInvoiceNo/invoiceNo is the supplier reference.
void-ap-invoiceVoid

Guarded AP invoice void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/void

Full JSON Payload

{
  "commandId": "void-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-invoice",
  "payload": {
    "docNo": "API-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-invoice",
  "payload": {
    "docNo": "API-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ap-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ap-invoiceDelete

Guarded AP invoice delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/delete

Full JSON Payload

{
  "commandId": "delete-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-invoice",
  "payload": {
    "docNo": "API-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ap-invoice-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-invoice",
  "payload": {
    "docNo": "API-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ap-invoice.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ap-paymentsRead

List AP payments.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/list

Full JSON Payload

{
  "commandId": "list-ap-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-payments",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ap-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-payments",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ap-payments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-detail-linesRead

Read AP account/detail lines across AP invoices, payments, refunds, credit notes, and debit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap/list

Full JSON Payload

{
  "commandId": "read-ap-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-detail-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-detail-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-detail-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-payment-linesRead

Read AP payment detail/payment method lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/list

Full JSON Payload

{
  "commandId": "read-ap-payment-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-payment-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-payment-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-payment-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-payment-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-refund-linesRead

Read AP refund detail/payment method lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/list

Full JSON Payload

{
  "commandId": "read-ap-refund-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-refund-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-refund-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-refund-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-refund-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ap-paymentRead

Get one AP payment by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/get

Full JSON Payload

{
  "commandId": "get-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-payment",
  "payload": {
    "docNo": "PV-000001"
  }
}

Payload Fields

docNo
required AP payment document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-payment",
  "payload": {
    "docNo": "PV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ap-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ap-paymentValidate

Validate an AP payment without saving. Supports one or many real supplier invoice knock-offs.

Real positive knock-off validation is proven for outstanding AP documents. The connector also accepts old PI aliases and normalizes them to PB. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/validate

Full JSON Payload

{
  "commandId": "validate-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-payment",
  "payload": {
    "creditorCode": "400-S001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-payment",
  "payload": {
    "creditorCode": "400-S001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ap-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ap-depositCreate

Create an AP deposit with a real payment detail and GL transaction.

Requires write access permission. Real save is tested against AutoCount APDepositCommand and verifies GLTrxID. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Creates a real AutoCount deposit with one payment detail row and posts a GL transaction when saved.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap/create

Full JSON Payload

{
  "commandId": "create-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-deposit",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AP deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date
amount
required deposit amount
paymentMethod
optional AutoCount Payment Method code such as CASH or MAYBANK
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
depositPaymentMethod
optional AutoCount deposit header payment method; defaults from paymentMethod
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
description
optional deposit narration
note
optional note
isSecurityDeposit
optional boolean; true for security deposit where AutoCount account book supports it
project
optional project code
department
optional department code

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-deposit",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AP deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ap-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ap-paymentCreate

Create an AP payment. Supports one or many real supplier invoice knock-offs.

Requires write access permission. Real multi-invoice knock-off save is proven; PI aliases are normalized to PB. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/create

Full JSON Payload

{
  "commandId": "create-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-payment",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-payment",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ap-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ap-paymentEdit

Update AP payment header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/edit

Full JSON Payload

{
  "commandId": "update-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-payment",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
creditorCode
optional supplier/creditor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
paymentLines
optional payment detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-payment",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ap-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ap-paymentVoid

Guarded AP payment void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/void

Full JSON Payload

{
  "commandId": "void-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-payment",
  "payload": {
    "docNo": "PV-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-payment",
  "payload": {
    "docNo": "PV-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ap-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ap-paymentDelete

Guarded AP payment delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/delete

Full JSON Payload

{
  "commandId": "delete-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-payment",
  "payload": {
    "docNo": "PV-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ap-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-payment",
  "payload": {
    "docNo": "PV-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ap-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ap-refundsRead

List AP refunds.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/list

Full JSON Payload

{
  "commandId": "list-ap-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-refunds",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ap-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-refunds",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ap-refunds.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ap-refundRead

Get one AP refund by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/get

Full JSON Payload

{
  "commandId": "get-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-refund",
  "payload": {
    "docNo": "PV-000001"
  }
}

Payload Fields

docNo
required AP refund document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-refund",
  "payload": {
    "docNo": "PV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ap-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ap-refundValidate

Validate an AP refund without saving. Refund knocks off AP credit notes, not supplier invoices. Use docType PC or friendly CN alias; docKey is recommended.

Real AP refund knock-off save is proven against AP credit notes. CN/CreditNote aliases are normalized to PC. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/validate

Full JSON Payload

{
  "commandId": "validate-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-refund",
  "payload": {
    "creditorCode": "400-S001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-refund",
  "payload": {
    "creditorCode": "400-S001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "docDate": "2026-06-24",
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ap-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ap-refundCreate

Create an AP refund. Refund knocks off AP credit notes, not supplier invoices. Use docType PC or friendly CN alias; docKey is recommended.

Requires write access permission. Real AP refund knock-off save is proven against AP credit notes; CN aliases are normalized to PC. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/create

Full JSON Payload

{
  "commandId": "create-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-refund",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date
amount
required total payment/refund amount
knockOffs
optional array of documents to allocate this payment/refund against; docKey is recommended
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
paymentMethod
required or optional AutoCount Payment Method code such as CASH or MAYBANK
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
paymentAccountNo
optional GL bank/cash account number
bankChargeAccountNo
optional GL bank charge account number
creditCardApprovalCode
optional credit-card approval code/reference
description
optional payment/refund narration
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-refund",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0,
        "gainLossAmount": 0,
        "withholdingTaxAmount": 0
      }
    ],
    "paymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-PAY-1001",
    "bankCharge": 0,
    "paymentAccountNo": "110-0010",
    "bankChargeAccountNo": "810-0000",
    "creditCardApprovalCode": "",
    "description": "AP payment/refund created through API",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ap-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ap-refundEdit

Update AP refund header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/edit

Full JSON Payload

{
  "commandId": "update-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-refund",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
creditorCode
optional supplier/creditor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
paymentLines
optional payment detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-refund",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ap-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ap-refundVoid

Guarded AP refund void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/void

Full JSON Payload

{
  "commandId": "void-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ap-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ap-refundDelete

Guarded AP refund delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/delete

Full JSON Payload

{
  "commandId": "delete-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ap-refund-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-refund",
  "payload": {
    "docNo": "PV-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ap-refund.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ap-credit-notesRead

List AP credit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/list

Full JSON Payload

{
  "commandId": "list-ap-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-credit-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ap-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-credit-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ap-credit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-credit-note-linesRead

Read AP credit note detail/account lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/list

Full JSON Payload

{
  "commandId": "read-ap-credit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-credit-note-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-credit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-credit-note-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-credit-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ap-credit-noteRead

Get one AP credit note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/get

Full JSON Payload

{
  "commandId": "get-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-credit-note",
  "payload": {
    "docNo": "PCN-000001"
  }
}

Payload Fields

docNo
required AP credit note document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-credit-note",
  "payload": {
    "docNo": "PCN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ap-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ap-credit-noteValidate

Validate an AP credit note without saving. Supports one or many real supplier invoice knock-offs.

Real positive knock-off validation is proven for outstanding AP documents. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/validate

Full JSON Payload

{
  "commandId": "validate-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-credit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierCreditNoteNo": "SCN-001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
supplierCreditNoteNo
supplier credit note number
amount
optional single-line amount; lines is preferred for multiple lines
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional creditor/supplier branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account
taxType
optional tax type/code
lines
recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-credit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierCreditNoteNo": "SCN-001",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ap-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ap-credit-noteCreate

Create an AP credit note. Supports knock-offs and guarded MyInvois type 12 self-billed recovery for TSM.

Normal create requires write access. Recovery is companyId=tsm only, UUID guarded, native SelfBilled-linked, reload verified, and does not submit to LHDN. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/create

Full JSON Payload

{
  "commandId": "create-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-credit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierCreditNoteNo": "SCN-001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
supplierCreditNoteNo
supplier credit note number
docDate
required or optional YYYY-MM-DD document date
amount
optional single-line amount; lines is preferred for multiple lines
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
restoreMode
optional internal recovery value recover-existing-myinvois-direct
confirmNoLhdnSubmit
required true in recovery mode
taxEntity
supplier taxpayer identity required in recovery mode
buyerTaxEntity
buyer taxpayer identity required in recovery mode
eInvoiceRecovery
required UUID, timestamps, status, link, totals and tax in recovery mode
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional creditor/supplier branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account
taxType
optional tax type/code
lines
recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-credit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierCreditNoteNo": "SCN-001",
    "docDate": "2026-06-24",
    "amount": 100,
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ap-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ap-credit-noteEdit

Update AP credit note header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/edit

Full JSON Payload

{
  "commandId": "update-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-credit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
creditorCode
optional supplier/creditor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array for credit-note style documents; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-credit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ap-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ap-credit-noteVoid

Guarded AP credit note void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/void

Full JSON Payload

{
  "commandId": "void-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-credit-note",
  "payload": {
    "docNo": "PCN-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-credit-note",
  "payload": {
    "docNo": "PCN-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ap-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ap-credit-noteDelete

Guarded AP credit note delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/delete

Full JSON Payload

{
  "commandId": "delete-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-credit-note",
  "payload": {
    "docNo": "PCN-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ap-credit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-credit-note",
  "payload": {
    "docNo": "PCN-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ap-credit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ap-debit-notesRead

List AP debit notes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/list

Full JSON Payload

{
  "commandId": "list-ap-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-debit-notes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ap-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-debit-notes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ap-debit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-debit-note-linesRead

Read AP debit note detail/account lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/list

Full JSON Payload

{
  "commandId": "read-ap-debit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-debit-note-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
}

Payload Fields

creditorCode
optional
accountNo
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-debit-note-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-debit-note-lines",
  "payload": {
    "creditorCode": "400-S001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-debit-note-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ap-debit-noteRead

Get one AP debit note by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/get

Full JSON Payload

{
  "commandId": "get-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-debit-note",
  "payload": {
    "docNo": "PDN-000001"
  }
}

Payload Fields

docNo
required AP debit note document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-debit-note",
  "payload": {
    "docNo": "PDN-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ap-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ap-debit-noteValidate

Validate an AP debit note without saving.

AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/validate

Full JSON Payload

{
  "commandId": "validate-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-debit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierDebitNoteNo": "SDN-001",
    "amount": 100,
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
supplierDebitNoteNo
supplier debit note number optional
amount
optional single-line amount; lines is preferred for multiple lines
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional creditor/supplier branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account
taxType
optional tax type/code
lines
recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-debit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierDebitNoteNo": "SDN-001",
    "amount": 100,
    "docDate": "2026-06-24",
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ap-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-ap-debit-noteCreate

Create an AP debit note; guarded MyInvois type 13 self-billed recovery is supported for TSM.

Normal create uses AutoCount SDK. Recovery is companyId=tsm only, UUID guarded, native SelfBilled-linked, reload verified, and does not submit to LHDN. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/create

Full JSON Payload

{
  "commandId": "create-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-debit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierDebitNoteNo": "SDN-001",
    "docDate": "2026-06-24",
    "amount": 100,
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
supplierDebitNoteNo
supplier debit note number optional
docDate
required or optional YYYY-MM-DD document date
amount
optional single-line amount; lines is preferred for multiple lines
restoreMode
optional internal recovery value recover-existing-myinvois-direct
confirmNoLhdnSubmit
required true in recovery mode
taxEntity
supplier taxpayer identity required in recovery mode
buyerTaxEntity
buyer taxpayer identity required in recovery mode
eInvoiceRecovery
required UUID, timestamps, status, link, totals and tax in recovery mode
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
dueDate
optional YYYY-MM-DD due date
description
optional document description/narration
ref
optional reference
branchCode
optional creditor/supplier branch code/name where the customer uses branches
attention
optional attention/contact person
contact
optional contact person alias for attention
currencyCode
optional currency code such as MYR
currencyRate
optional exchange rate
inclusiveTax
optional boolean
taxDate
optional YYYY-MM-DD tax date
accountNo
required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account
taxType
optional tax type/code
lines
recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo
knockOffs
optional array for credit/debit note knock-off where AutoCount supports it
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-ap-debit-note",
  "payload": {
    "creditorCode": "400-S001",
    "supplierDebitNoteNo": "SDN-001",
    "docDate": "2026-06-24",
    "amount": 100,
    "dueDate": "2026-07-24",
    "description": "AP document created through API",
    "ref": "API-REF-1001",
    "branchCode": "MAIN",
    "attention": "Accounts Department",
    "contact": "Accounts Department",
    "currencyCode": "MYR",
    "inclusiveTax": false,
    "lines": [
      {
        "accountNo": "610-0000",
        "description": "Service line 1",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "taxAmount": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accountNo": "620-0000",
        "description": "Different posting account line",
        "amount": 50,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022"
      }
    ],
    "knockOffs": [
      {
        "docType": "PB",
        "docKey": "424508",
        "docNo": "PI-000001",
        "amount": 100,
        "discountAmount": 0,
        "taxAdjustment": 0
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-ap-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ap-debit-noteEdit

Update AP debit note header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/edit

Full JSON Payload

{
  "commandId": "update-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-debit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
creditorCode
optional supplier/creditor code where AutoCount allows changing it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
knockOffs
optional knock-off allocation edit array for credit-note style documents; each row supports docType, docKey, docNo, amount
knockOffMode
optional knock-off edit mode: replace | append | update
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-debit-note",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ap-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification.
void-ap-debit-noteVoid

Guarded AP debit note void request.

Returns voidBlocked until module-specific AutoCount void/cancel safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/void

Full JSON Payload

{
  "commandId": "void-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-debit-note",
  "payload": {
    "docNo": "PDN-000001",
    "reason": "void/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-ap-debit-note",
  "payload": {
    "docNo": "PDN-000001",
    "reason": "void/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-ap-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-ap-debit-noteDelete

Guarded AP debit note delete request.

Returns deleteBlocked. Use reversal, cancellation, or replacement workflow until module-specific AutoCount delete safety is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/delete

Full JSON Payload

{
  "commandId": "delete-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-debit-note",
  "payload": {
    "docNo": "PDN-000001",
    "reason": "remove/correct document"
  }
}

Payload Fields

docNo
required
reason
required

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-ap-debit-note-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-ap-debit-note",
  "payload": {
    "docNo": "PDN-000001",
    "reason": "remove/correct document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-ap-debit-note.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-ap-depositsRead

List AP deposits.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap/list

Full JSON Payload

{
  "commandId": "list-ap-deposits-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-deposits",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-ap-deposits-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-ap-deposits",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-ap-deposits.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-ap-outstandingRead

Legacy AP outstanding lookup. Prefer read-ap-outstanding-documents for docKey-based knock-off.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-outstanding/list

Full JSON Payload

{
  "commandId": "read-ap-outstanding-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-outstanding",
  "payload": {
    "creditorCode": "400-S001",
    "maxRows": 0
  }
}

Payload Fields

creditorCode
optional creditor/supplier code
maxRows
optional row limit; maxRows: 0 means return all rows

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-ap-outstanding-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-ap-outstanding",
  "payload": {
    "creditorCode": "400-S001",
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-ap-outstanding.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-creditorsRead

List creditors/suppliers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/list

Full JSON Payload

{
  "commandId": "read-creditors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-creditors",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-creditors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-creditors",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-creditors.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-ap-depositRead

Get one AP deposit by document number.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap/get

Full JSON Payload

{
  "commandId": "get-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-deposit",
  "payload": {
    "docNo": "PV-000001"
  }
}

Payload Fields

docNo
required AP deposit document number

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-ap-deposit",
  "payload": {
    "docNo": "PV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-ap-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-creditor-detailRead

Read one creditor/supplier with all public SDK fields and child tables.

Uses AutoCount.ARAP.Creditor.CreditorDataAccess.GetCreditor. Returns fields and child tables such as CreditorTable, BranchTable, ContactTable, TaxExemptionTable, and GLMastTable when available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/get

Full JSON Payload

{
  "commandId": "get-creditor-detail-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-creditor-detail",
  "payload": {
    "accNo": "400-S001",
    "maxTableRows": 0
  }
}

Payload Fields

accNo
required creditor/supplier code; creditorCode or supplierCode also accepted
maxTableRows
optional child-table row limit; maxTableRows: 0 means return all child-table rows
includeTableData
optional boolean, default true

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-creditor-detail-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-creditor-detail",
  "payload": {
    "accNo": "400-S001",
    "maxTableRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-creditor-detail.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-ap-depositValidate

Validate an AP deposit without saving.

AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Creates a real AutoCount deposit with one payment detail row and posts a GL transaction when saved.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap/validate

Full JSON Payload

{
  "commandId": "validate-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-deposit",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AP deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
}

Payload Fields

creditorCode
required AutoCount creditor/supplier code
docDate
required or optional YYYY-MM-DD document date
amount
required deposit amount
paymentMethod
optional AutoCount Payment Method code such as CASH or MAYBANK
_arApRule
AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
depositPaymentMethod
optional AutoCount deposit header payment method; defaults from paymentMethod
paymentBy
optional payment type such as Cash, Cheque, Bank Transfer, Credit Card
chequeNo
optional cheque/reference number
bankCharge
optional bank charge amount
description
optional deposit narration
note
optional note
isSecurityDeposit
optional boolean; true for security deposit where AutoCount account book supports it
project
optional project code
department
optional department code

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-ap-deposit",
  "payload": {
    "creditorCode": "400-S001",
    "docDate": "2026-06-24",
    "amount": 100,
    "paymentMethod": "CASH",
    "depositPaymentMethod": "CASH",
    "paymentBy": "Cash",
    "chequeNo": "API-DEP-1001",
    "bankCharge": 0,
    "description": "AP deposit created through API",
    "note": "Deposit received before invoice",
    "isSecurityDeposit": false,
    "project": "PRJAPI",
    "department": "HQ"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-ap-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-ap-depositEdit

Update an AP deposit editable SDK fields and supported detail rows with persisted verification.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Deposit editing is limited to unallocated deposits; cancelled, transferred, refunded or forfeited deposits are blocked. Native acceptance must be verified on the selected account book.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap/edit

Full JSON Payload

{
  "commandId": "update-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-deposit",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
reason
required audit reason
description
optional description; null or empty clears optional text
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values
detailMode
explicit update | append | replace | delete for detail edits
paymentLines
optional payment detail updates selected by dtlKey

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-ap-deposit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-ap-deposit",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-ap-deposit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Deposit editing is limited to unallocated deposits; cancelled, transferred, refunded or forfeited deposits are blocked. Native acceptance must be verified on the selected account book.
export-creditor-detailsread

Export up to 5000 creditor/supplier master records in one read-only command.

Fast mode returns flat data rows, not sequential get-creditor-detail calls. Use detailMode:"full" with includeTableData:true for contact/branch tables. Check partial, truncated, failedRows/failedCreditors and childTablesTruncated; do not treat a bounded export as complete. Large responses expose artifactUrl; download GET /v1/commands/{commandId}/artifact with the same tenant authorization. The authenticated artifact contains the original result, while inline data may be a preview.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/export-creditor-details

Full JSON Payload

{
  "commandId": "export-creditor-details-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "export-creditor-details",
  "payload": {
    "maxCreditors": 5000,
    "includeTableData": false,
    "activeOnly": false,
    "detailMode": "auto"
  }
}

Payload Fields

maxCreditors
optional integer 1-5000, default 5000
maxTableRows
optional integer 1-1000 per child table per supplier, default 20; zero is rejected
includeTableData
optional boolean, default true; child rows are available only in full mode
activeOnly
optional boolean, default false
detailMode
optional: auto (default, fast master fields) | full (bounded per-supplier SDK fields and child tables)

Full Transaction Field Reference

header

debtorCode
AR customer/debtor code
creditorCode
AP supplier/creditor code
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

knockOffs

docType
AutoCount knock-off document type, for example RI, PB, RC, PC
displayDocType
human document type, for example IV or PI
docKey
AutoCount outstanding document key, recommended
docNo
document number
amount
allocation amount
discountAmount
knock-off discount amount
taxAdjustment
tax adjustment amount
gainLossAmount
foreign exchange gain/loss amount where supported
withholdingTaxAmount
withholding tax amount where supported

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "export-creditor-details-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "export-creditor-details",
  "payload": {
    "maxCreditors": 5000,
    "includeTableData": false,
    "activeOnly": false,
    "detailMode": "auto"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to export-creditor-details.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Stock

Items, balance, stock adjustment, receive, issue, transfer, UOM conversion, stock take, write-off, BOM, package, and assembly.

list-item-batchesRead

List item batches with bounded filters.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "list-item-batches-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-item-batches",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 100
  }
}

Payload Fields

itemCode
optional AutoCount item code
batchNo
optional Optional batch-number substring search
limit
optional Page size, default500, maximum5000
manufacturedDateFrom
optional Inclusive manufactured-date lower bound YYYY-MM-DD
manufacturedDateTo
optional Inclusive manufactured-date upper bound YYYY-MM-DD
expiryDateFrom
optional Inclusive expiry lower bound YYYY-MM-DD
expiryDateTo
optional Inclusive expiry upper bound YYYY-MM-DD

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-item-batches-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-item-batches",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 100
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-item-batches.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-item-brandsRead

List Stock Item Brand Maintenance records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "list-stock-item-brands-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-brands",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-item-brands-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-brands",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-item-brands.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-item-categoriesRead

List Stock Item Category Maintenance records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "list-stock-item-categories-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-categories",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-item-categories-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-categories",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-item-categories.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-item-groupsRead

List Stock Item Group Maintenance records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "list-stock-item-groups-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-groups",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-item-groups-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-groups",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-item-groups.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-item-typesRead

List Stock Item Type Maintenance records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "list-stock-item-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-types",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-item-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-item-types",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-item-types.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-update-costsRead

List stock update cost records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/list

Full JSON Payload

{
  "commandId": "list-stock-update-costs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-update-costs",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-update-costs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-update-costs",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-update-costs.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-item-batch-transactionsRead

Read item batch transactions by date.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "read-item-batch-transactions-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-item-batch-transactions",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
required Exact item batch number
limit
optional Page size, default500, maximum5000
fromDate
optional Inclusive transaction-date lower bound YYYY-MM-DD
toDate
optional Inclusive transaction-date upper bound YYYY-MM-DD

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-item-batch-transactions-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-item-batch-transactions",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-item-batch-transactions.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-itemsRead

List stock items quickly with limit/search filters.

Bounded by default so AI tools do not block the connector queue with full item exports. Use read-items-all/export-items only when a full item master export is required.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/list

Full JSON Payload

{
  "commandId": "read-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-items",
  "payload": {
    "limit": 50,
    "search": "V274",
    "activeOnly": true
  }
}

Payload Fields

limit
optional row limit; default 100, max 500
search
optional keyword matched against item code/description
itemCode
optional item code contains search
itemGroup
optional exact item group
itemType
optional exact item type
activeOnly
optional boolean

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-items",
  "payload": {
    "limit": 50,
    "search": "V274",
    "activeOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-items.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-items-allRead

Explicit full stock item export.

Can be slow on large account books. Prefer read-items with limit/search for normal AI lookup.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/list

Full JSON Payload

{
  "commandId": "read-items-all-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-items-all",
  "payload": {
    "activeOnly": true
  }
}

Payload Fields

search
optional keyword filter
itemGroup
optional exact item group
itemType
optional exact item type
activeOnly
optional boolean

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-items-all-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-items-all",
  "payload": {
    "activeOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-items-all.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-locationsRead

List stock locations.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "read-locations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-locations",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-locations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-locations",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-locations.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-detail-linesRead

Read stock transaction lines together, or filter with document.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "read-stock-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-detail-lines",
  "payload": {
    "document": "stock-adjustment",
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

document
optional: stock-adjustment | stock-receive | stock-issue | stock-transfer | stock-uom-conversion | stock-take | stock-write-off | stock-update-cost
itemCode
optional
docNo
optional
location
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-detail-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-detail-lines",
  "payload": {
    "document": "stock-adjustment",
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-detail-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-movementRead

Read stock movement.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-movement/list

Full JSON Payload

{
  "commandId": "read-stock-movement-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-movement",
  "payload": {
    "itemCode": "ITEM001"
  }
}

Payload Fields

itemCode
optional item code
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-movement-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-movement",
  "payload": {
    "itemCode": "ITEM001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-movement.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-update-cost-linesRead

Read stock update cost detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/list

Full JSON Payload

{
  "commandId": "read-stock-update-cost-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-update-cost-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-update-cost-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-update-cost-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-update-cost-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-item-batchRead

Read one exact item batch.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/get

Full JSON Payload

{
  "commandId": "get-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
required Exact item batch number

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-item-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-item-brandRead

Get one Stock Item Brand Maintenance record.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/get

Full JSON Payload

{
  "commandId": "get-stock-item-brand-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-brand",
  "payload": {
    "code": "BRAND1"
  }
}

Payload Fields

code
required item brand code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-item-brand-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-brand",
  "payload": {
    "code": "BRAND1"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-item-brand.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-item-categoryRead

Get one Stock Item Category Maintenance record.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/get

Full JSON Payload

{
  "commandId": "get-stock-item-category-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-category",
  "payload": {
    "code": "CAT1"
  }
}

Payload Fields

code
required item category code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-item-category-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-category",
  "payload": {
    "code": "CAT1"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-item-category.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-item-detailRead

Read one stock item with all public SDK fields and child tables.

Uses AutoCount.Stock.Item.ItemDataAccess.LoadItem(View). Returns fields and child tables such as ItemUomTable, ItemPriceBook, ItemCustomerPrice, ItemSupplierPrice, ItemOpeningBalance, ItemBOMTable, ItemBatchTable, and sub-code/replacement/ingredient tables when available. If maxTableRows: 0 is requested without confirmFullDetail: true, the connector returns a bounded result with fullDetailBlocked so AI/customer calls do not hang accidentally.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/get

Full JSON Payload

{
  "commandId": "get-stock-item-detail-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-detail",
  "payload": {
    "itemCode": "ITEM001",
    "maxTableRows": 50
  }
}

Payload Fields

itemCode
required stock item code
maxTableRows
optional child-table row limit; maxTableRows: 0 is guarded for stock item detail unless confirmFullDetail: true is sent
confirmFullDetail
optional boolean; required with maxTableRows: 0 to return every child-table row
includeTableData
optional boolean, default true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-item-detail-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-detail",
  "payload": {
    "itemCode": "ITEM001",
    "maxTableRows": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-item-detail.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-item-groupRead

Get one Stock Item Group Maintenance record.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/get

Full JSON Payload

{
  "commandId": "get-stock-item-group-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-group",
  "payload": {
    "code": "FG"
  }
}

Payload Fields

code
required item group code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-item-group-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-group",
  "payload": {
    "code": "FG"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-item-group.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-item-typeRead

Get one Stock Item Type Maintenance record.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/get

Full JSON Payload

{
  "commandId": "get-stock-item-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-type",
  "payload": {
    "code": "RAW"
  }
}

Payload Fields

code
required item type code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-item-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-item-type",
  "payload": {
    "code": "RAW"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-item-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-update-costRead

Get one stock update cost by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/get

Full JSON Payload

{
  "commandId": "get-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-update-cost",
  "payload": {
    "docNo": "SUC-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-update-cost",
  "payload": {
    "docNo": "SUC-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-update-cost.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-item-batchValidate

Validate batch maintenance without saving.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/validate

Full JSON Payload

{
  "commandId": "validate-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001",
    "mode": "create"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
required Exact item batch number
description
optional Batch description
manufacturedDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
expiryDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
lastSaleDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
mode
required Maintenance mode: create or update

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001",
    "mode": "create"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-item-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-update-costValidate

Validate stock update cost without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/validate

Full JSON Payload

{
  "commandId": "validate-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-update-cost",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-update-cost",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-update-cost.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-item-batchCreate

Create an item batch master.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/create

Full JSON Payload

{
  "commandId": "create-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
required Exact item batch number
description
optional Batch description
manufacturedDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
expiryDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
lastSaleDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
validateOnly
optional True validates without saving; write permission is still required on create/update/delete

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-item-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-item-brandCreate

Create a Stock Item Brand Maintenance record.

Uses AutoCount stock item brand maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/create

Full JSON Payload

{
  "commandId": "create-stock-item-brand-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-brand",
  "payload": {
    "code": "BRAND1",
    "description": "Brand 1"
  }
}

Payload Fields

code
required item brand code
description
required description

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-item-brand-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-brand",
  "payload": {
    "code": "BRAND1",
    "description": "Brand 1"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-item-brand.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-item-categoryCreate

Create a Stock Item Category Maintenance record.

Uses AutoCount stock item category maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/create

Full JSON Payload

{
  "commandId": "create-stock-item-category-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-category",
  "payload": {
    "code": "CAT1",
    "description": "Category 1"
  }
}

Payload Fields

code
required item category code
description
required description

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-item-category-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-category",
  "payload": {
    "code": "CAT1",
    "description": "Category 1"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-item-category.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-item-groupCreate

Create a Stock Item Group Maintenance record.

Uses AutoCount stock item group maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/create

Full JSON Payload

{
  "commandId": "create-stock-item-group-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-group",
  "payload": {
    "code": "FG",
    "description": "Finished Goods"
  }
}

Payload Fields

code
required item group code
description
required description

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-item-group-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-group",
  "payload": {
    "code": "FG",
    "description": "Finished Goods"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-item-group.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-item-typeCreate

Create a Stock Item Type Maintenance record.

Uses AutoCount stock item type maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/create

Full JSON Payload

{
  "commandId": "create-stock-item-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-type",
  "payload": {
    "code": "RAW",
    "description": "Raw Material"
  }
}

Payload Fields

code
required item type code
description
required description

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-item-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-item-type",
  "payload": {
    "code": "RAW",
    "description": "Raw Material"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-item-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-update-costCreate

Create stock update cost document.

Creates one or many stock update-cost detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/create

Full JSON Payload

{
  "commandId": "create-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-update-cost",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
lines
required array of stock item rows; items is also accepted as a compatibility alias
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-update-cost",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-update-cost.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-item-batchEdit

Update batch description and dates; not its identity.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/edit

Full JSON Payload

{
  "commandId": "update-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
required Exact item batch number
description
optional Batch description
manufacturedDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
expiryDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
lastSaleDate
optional YYYY-MM-DD or explicit null to clear; omitted values are unchanged; empty strings rejected
validateOnly
optional True validates without saving; write permission is still required on create/update/delete

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-item-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-item-brandEdit

Update a Stock Item Brand Maintenance record.

Uses AutoCount stock item brand maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/edit

Full JSON Payload

{
  "commandId": "update-stock-item-brand-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-brand",
  "payload": {
    "code": "BRAND1",
    "description": "Brand 1"
  }
}

Payload Fields

code
required item brand code
description
description to update

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-item-brand-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-brand",
  "payload": {
    "code": "BRAND1",
    "description": "Brand 1"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-item-brand.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-item-categoryEdit

Update a Stock Item Category Maintenance record.

Uses AutoCount stock item category maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/edit

Full JSON Payload

{
  "commandId": "update-stock-item-category-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-category",
  "payload": {
    "code": "CAT1",
    "description": "Category 1"
  }
}

Payload Fields

code
required item category code
description
description to update

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-item-category-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-category",
  "payload": {
    "code": "CAT1",
    "description": "Category 1"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-item-category.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-item-groupEdit

Update a Stock Item Group Maintenance record.

Uses AutoCount stock item group maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/edit

Full JSON Payload

{
  "commandId": "update-stock-item-group-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-group",
  "payload": {
    "code": "FG",
    "description": "Finished Goods"
  }
}

Payload Fields

code
required item group code
description
description to update

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-item-group-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-group",
  "payload": {
    "code": "FG",
    "description": "Finished Goods"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-item-group.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-item-typeEdit

Update a Stock Item Type Maintenance record.

Uses AutoCount stock item type maintenance SDK where available.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/edit

Full JSON Payload

{
  "commandId": "update-stock-item-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-type",
  "payload": {
    "code": "RAW",
    "description": "Raw Material"
  }
}

Payload Fields

code
required item type code
description
description to update

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-item-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-item-type",
  "payload": {
    "code": "RAW",
    "description": "Raw Material"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-item-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-update-costEdit

Edit stock update cost header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/edit

Full JSON Payload

{
  "commandId": "update-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-update-cost",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-update-cost",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-update-cost.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-update-costVoid

Void/cancel stock update cost.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/void

Full JSON Payload

{
  "commandId": "void-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-update-cost",
  "payload": {
    "docNo": "SUC-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-update-cost",
  "payload": {
    "docNo": "SUC-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-update-cost.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-item-batchDelete

Delete an unused item batch subject to native safety checks.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/delete

Full JSON Payload

{
  "commandId": "delete-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
required Exact item batch number
validateOnly
optional True validates without saving; write permission is still required on create/update/delete

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-batch",
  "payload": {
    "itemCode": "ITEM001",
    "batchNo": "LOT001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-item-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-update-costDelete

Delete stock update cost.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/delete

Full JSON Payload

{
  "commandId": "delete-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-update-cost",
  "payload": {
    "docNo": "SUC-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-update-cost-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-update-cost",
  "payload": {
    "docNo": "SUC-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-update-cost.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-item-batchwrite

Change an item's batch number.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/change-item-batch

Full JSON Payload

{
  "commandId": "change-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-batch",
  "payload": {
    "itemCode": "ITEM-001",
    "oldBatchNo": "OLD-BATCH",
    "newBatchNo": "NEW-BATCH",
    "confirm": true
  }
}

Payload Fields

itemCode
required AutoCount item code
oldBatchNo
required old value for oldBatchNo
newBatchNo
required new value for newBatchNo
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-item-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-batch",
  "payload": {
    "itemCode": "ITEM-001",
    "oldBatchNo": "OLD-BATCH",
    "newBatchNo": "NEW-BATCH",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-item-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-item-codewrite

Change an item code across linked stock records.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/change-item-code

Full JSON Payload

{
  "commandId": "change-item-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-code",
  "payload": {
    "oldItemCode": "OLD-ITEM",
    "newItemCode": "NEW-ITEM",
    "confirm": true
  }
}

Payload Fields

oldItemCode
required old value for oldItemCode
newItemCode
required new value for newItemCode
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-item-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-code",
  "payload": {
    "oldItemCode": "OLD-ITEM",
    "newItemCode": "NEW-ITEM",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-item-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-locationwrite

Change a stock location ID.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/change-location

Full JSON Payload

{
  "commandId": "change-location-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-location",
  "payload": {
    "oldLocationID": "OLD-LOC",
    "newLocationID": "NEW-LOC",
    "confirm": true
  }
}

Payload Fields

oldLocationID
required old value for oldLocationID
newLocationID
required new value for newLocationID
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-location-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-location",
  "payload": {
    "oldLocationID": "OLD-LOC",
    "newLocationID": "NEW-LOC",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-location.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-serial-numberwrite

Change a serial number for an item.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities. Cloud schema does not prove native runtime support. The connector must preserve the native transaction sequence, linked-document serial lists, and fresh read-back.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/change-serial-number

Full JSON Payload

{
  "commandId": "change-serial-number-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-serial-number",
  "payload": {
    "itemCode": "ITEM-001",
    "oldSerialNumber": "OLD-SN",
    "newSerialNumber": "NEW-SN",
    "confirm": true
  }
}

Payload Fields

itemCode
required AutoCount item code
oldSerialNumber
required existing serial number
newSerialNumber
required replacement serial number
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-serial-number-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-serial-number",
  "payload": {
    "itemCode": "ITEM-001",
    "oldSerialNumber": "OLD-SN",
    "newSerialNumber": "NEW-SN",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-serial-number.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
export-itemsread

Alias for read-items-all explicit full stock item export.

Use only for export/sync jobs, not repeated quick lookups.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/export-items

Full JSON Payload

{
  "commandId": "export-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "export-items",
  "payload": {
    "activeOnly": true
  }
}

Payload Fields

activeOnly
optional boolean

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "export-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "export-items",
  "payload": {
    "activeOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to export-items.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
recalculate-stock-costingwrite

Recalculate native stock costing for one exact item.

Requires connector local-mvp-2026.09.27.01 or later, Stock Edit and native TOOLS_STKCOST_RECAL_OPEN. Calculation version 1 only; full history; both document-cost update flags false. Item method/settings are preserved. No all-items/range/date selector, cancellation or automatic retry. Preflight first, then send confirm:true with a distinct execution commandId. Identical requests reuse their commandId; partial/uncertain results require reconciliation, never a new-ID retry. Scoped native readback is not an independent valuation audit. Existing UOM rate/history guards are unchanged.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/recalculate-stock-costing

Full JSON Payload

{
  "commandId": "recalculate-stock-costing-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "recalculate-stock-costing",
  "payload": {
    "itemCode": "000013",
    "validateOnly": true
  }
}

Payload Fields

itemCode
required exact string item code; preserve leading zeros, no wildcard/list/range
validateOnly
optional boolean; true is no-change preflight and still requires Stock Edit
confirm
boolean; required true for execution unless validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "recalculate-stock-costing-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "recalculate-stock-costing",
  "payload": {
    "itemCode": "000013",
    "validateOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to recalculate-stock-costing.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-item-batch-balancesRead

Read item batch balances by location and UOM.

Connector SDK support and native safety checks are required. Validation never saves. Cloud schema presence is not native persistence proof; existing change-item-batch is separate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "read-item-batch-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-item-batch-balances",
  "payload": {
    "itemCode": "ITEM001"
  }
}

Payload Fields

itemCode
required AutoCount item code
batchNo
optional Exact item batch number
limit
optional Page size, default500, maximum5000
location
optional Optional exact location
uom
optional Optional exact UOM

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-item-batch-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-item-batch-balances",
  "payload": {
    "itemCode": "ITEM001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-item-batch-balances.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
stock-balanceRead

Inquire stock balance by item/location using AutoCount stock balance by location logic, with non-serial fallback through AutoCount.Stock.StockBalance.StockBalanceHelper.

Returns authoritative AutoCount stock quantity by location rows from the first non-empty AutoCount result table plus table summaries. Serial items may return ItemSerialNo rows. Non-serial items may return stockBalanceFallback/nonSerialFallback rows from StockBalanceHelper. If AutoCount exposes no location allocation for the item, the result sets locationBalanceUnavailable=true; AI must not guess a location split from item master total.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-balance/stock-balance

Full JSON Payload

{
  "commandId": "stock-balance-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "stock-balance",
  "payload": {
    "itemCode": "ITEM001",
    "location": "HQ",
    "maxRows": 100
  }
}

Payload Fields

itemCode
optional stock item code
location
optional stock location code
includeZeroBalance
optional true/false
includeInactiveItem
optional true/false
maxRows
optional row limit, default 500

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "stock-balance-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "stock-balance",
  "payload": {
    "itemCode": "ITEM001",
    "location": "HQ",
    "maxRows": 100
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to stock-balance.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
stock-balance-batchRead

Read live stock balances for many items and locations in one connector execution. This is the recommended command for 100-150 item stock checks.

Use this for WhatsApp orders with many items. Returns one batch asOf timestamp, per-item location balances, missingItemCodes, failedItemCodes, and diagnostics.fallbackCallCount. The connector uses AutoCount StockLevel array lookup first, then reports per-location timing/source so AI can explain slow account books without creating 50-200 cloud commands.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-balance/stock-balance-batch

Full JSON Payload

{
  "commandId": "stock-balance-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "stock-balance-batch",
  "payload": {
    "itemCodes": [
      "FI0779",
      "FI0780"
    ],
    "locations": [
      "HQ",
      "GM"
    ],
    "includeZeroBalance": true
  }
}

Payload Fields

itemCodes
required array of 1-500 stock item codes
locations
optional array of stock location codes
includeZeroBalance
optional true/false; when true, requested item/location pairs with no AutoCount rows return explicit zero-stock rows
asOfDate
optional YYYY-MM-DD; defaults to connector machine today
maxRows
optional per item/location row limit, default 500

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "stock-balance-batch-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "stock-balance-batch",
  "payload": {
    "itemCodes": [
      "FI0779",
      "FI0780"
    ],
    "locations": [
      "HQ",
      "GM"
    ],
    "includeZeroBalance": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to stock-balance-batch.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-adjustmentsRead

List stock adjustment records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/list

Full JSON Payload

{
  "commandId": "list-stock-adjustments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-adjustments",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-adjustments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-adjustments",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-adjustments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-adjustment-linesRead

Read stock adjustment detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/list

Full JSON Payload

{
  "commandId": "read-stock-adjustment-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-adjustment-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
location
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-adjustment-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-adjustment-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-adjustment-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-adjustmentRead

Get one stock adjustment by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/get

Full JSON Payload

{
  "commandId": "get-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-adjustment",
  "payload": {
    "docNo": "SA-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-adjustment",
  "payload": {
    "docNo": "SA-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-adjustment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-adjustmentValidate

Validate stock adjustment without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/validate

Full JSON Payload

{
  "commandId": "validate-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-adjustment",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-adjustment",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-adjustment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-adjustmentCreate

Create stock adjustment.

Creates one or many stock adjustment detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/create

Full JSON Payload

{
  "commandId": "create-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-adjustment",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
lines
required array of stock item rows; items is also accepted as a compatibility alias
itemCode
single-line fallback still accepted
qty
single-line fallback
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-adjustment",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-adjustment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-adjustmentEdit

Edit stock adjustment header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/edit

Full JSON Payload

{
  "commandId": "update-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-adjustment",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-adjustment",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-adjustment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-adjustmentVoid

Void/cancel stock adjustment.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/void

Full JSON Payload

{
  "commandId": "void-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-adjustment",
  "payload": {
    "docNo": "SA-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-adjustment",
  "payload": {
    "docNo": "SA-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-adjustment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-adjustmentDelete

Delete stock adjustment.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/delete

Full JSON Payload

{
  "commandId": "delete-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-adjustment",
  "payload": {
    "docNo": "SA-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-adjustment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-adjustment",
  "payload": {
    "docNo": "SA-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-adjustment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-receivesRead

List stock receive records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/list

Full JSON Payload

{
  "commandId": "list-stock-receives-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-receives",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-receives-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-receives",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-receives.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-receive-linesRead

Read stock receive detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/list

Full JSON Payload

{
  "commandId": "read-stock-receive-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-receive-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
location
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-receive-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-receive-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-receive-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-receiveRead

Get one stock receive by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/get

Full JSON Payload

{
  "commandId": "get-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-receive",
  "payload": {
    "docNo": "SR-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-receive",
  "payload": {
    "docNo": "SR-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-receive.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-receiveValidate

Validate stock receive without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/validate

Full JSON Payload

{
  "commandId": "validate-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-receive",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-receive",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-receive.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-receiveCreate

Create stock receive.

Creates one or many stock receive detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/create

Full JSON Payload

{
  "commandId": "create-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-receive",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
lines
required array of stock item rows; items is also accepted as a compatibility alias
itemCode
single-line fallback still accepted
qty
single-line fallback
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-receive",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-receive.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-receiveEdit

Edit stock receive header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/edit

Full JSON Payload

{
  "commandId": "update-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-receive",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-receive",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-receive.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-receiveVoid

Void/cancel stock receive.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/void

Full JSON Payload

{
  "commandId": "void-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-receive",
  "payload": {
    "docNo": "SR-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-receive",
  "payload": {
    "docNo": "SR-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-receive.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-receiveDelete

Delete stock receive.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/delete

Full JSON Payload

{
  "commandId": "delete-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-receive",
  "payload": {
    "docNo": "SR-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-receive-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-receive",
  "payload": {
    "docNo": "SR-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-receive.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-issuesRead

List stock issue records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/list

Full JSON Payload

{
  "commandId": "list-stock-issues-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-issues",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-issues-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-issues",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-issues.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-issue-linesRead

Read stock issue detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/list

Full JSON Payload

{
  "commandId": "read-stock-issue-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-issue-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
location
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-issue-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-issue-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-issue-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-issueRead

Get one stock issue by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/get

Full JSON Payload

{
  "commandId": "get-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-issue",
  "payload": {
    "docNo": "SI-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-issue",
  "payload": {
    "docNo": "SI-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-issue.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-issueValidate

Validate stock issue without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/validate

Full JSON Payload

{
  "commandId": "validate-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-issue",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-issue",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-issue.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-issueCreate

Create stock issue.

Creates one or many stock issue detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/create

Full JSON Payload

{
  "commandId": "create-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-issue",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
lines
required array of stock item rows; items is also accepted as a compatibility alias
itemCode
single-line fallback still accepted
qty
single-line fallback
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-issue",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-issue.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-issueEdit

Edit stock issue header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/edit

Full JSON Payload

{
  "commandId": "update-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-issue",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-issue",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-issue.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-issueVoid

Void/cancel stock issue.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/void

Full JSON Payload

{
  "commandId": "void-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-issue",
  "payload": {
    "docNo": "SI-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-issue",
  "payload": {
    "docNo": "SI-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-issue.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-issueDelete

Delete stock issue.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/delete

Full JSON Payload

{
  "commandId": "delete-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-issue",
  "payload": {
    "docNo": "SI-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-issue-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-issue",
  "payload": {
    "docNo": "SI-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-issue.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-transfersRead

List stock transfer records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/list

Full JSON Payload

{
  "commandId": "list-stock-transfers-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-transfers",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-transfers-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-transfers",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-transfers.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-transfer-linesRead

Read stock transfer detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/list

Full JSON Payload

{
  "commandId": "read-stock-transfer-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-transfer-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-transfer-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-transfer-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-transfer-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-transferRead

Get one stock transfer by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/get

Full JSON Payload

{
  "commandId": "get-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-transfer",
  "payload": {
    "docNo": "ST-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-transfer",
  "payload": {
    "docNo": "ST-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-transfer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-transferValidate

Validate stock transfer without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/validate

Full JSON Payload

{
  "commandId": "validate-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-transfer",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-transfer",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-transfer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-transferCreate

Create stock transfer.

Creates one or many stock transfer detail lines through AutoCount stock document logic. Fresh account books need at least two active stock locations before transfer. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/create

Full JSON Payload

{
  "commandId": "create-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-transfer",
  "payload": {
    "docDate": "2026-06-24",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
lines
required array of stock item rows; items is also accepted as a compatibility alias
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-transfer",
  "payload": {
    "docDate": "2026-06-24",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-transfer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-transferEdit

Edit stock transfer header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/edit

Full JSON Payload

{
  "commandId": "update-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-transfer",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-transfer",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-transfer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-transferVoid

Void/cancel stock transfer.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/void

Full JSON Payload

{
  "commandId": "void-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-transfer",
  "payload": {
    "docNo": "ST-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-transfer",
  "payload": {
    "docNo": "ST-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-transfer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-transferDelete

Delete stock transfer.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/delete

Full JSON Payload

{
  "commandId": "delete-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-transfer",
  "payload": {
    "docNo": "ST-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-transfer-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-transfer",
  "payload": {
    "docNo": "ST-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-transfer.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-takesRead

List stock take records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/list

Full JSON Payload

{
  "commandId": "list-stock-takes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-takes",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-takes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-takes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-takes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-take-linesRead

Read stock take detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/list

Full JSON Payload

{
  "commandId": "read-stock-take-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-take-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
location
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-take-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-take-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-take-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-takeRead

Get one stock take by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/get

Full JSON Payload

{
  "commandId": "get-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-take",
  "payload": {
    "docNo": "STK-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-take",
  "payload": {
    "docNo": "STK-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-take.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-takeValidate

Validate stock take without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/validate

Full JSON Payload

{
  "commandId": "validate-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-take",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-take",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-take.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-takeCreate

Create stock take.

Creates one or many stock take detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/create

Full JSON Payload

{
  "commandId": "create-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-take",
  "payload": {
    "docDate": "2026-06-24",
    "location": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
location
optional default stock location
lines
required array of stock item rows; items is also accepted as a compatibility alias
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-take",
  "payload": {
    "docDate": "2026-06-24",
    "location": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-take.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-takeEdit

Edit stock take header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/edit

Full JSON Payload

{
  "commandId": "update-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-take",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-take",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-take.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-takeVoid

Void/cancel stock take.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/void

Full JSON Payload

{
  "commandId": "void-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-take",
  "payload": {
    "docNo": "STK-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-take",
  "payload": {
    "docNo": "STK-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-take.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-takeDelete

Delete stock take.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/delete

Full JSON Payload

{
  "commandId": "delete-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-take",
  "payload": {
    "docNo": "STK-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-take-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-take",
  "payload": {
    "docNo": "STK-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-take.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-write-offsRead

List stock write-off records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/list

Full JSON Payload

{
  "commandId": "list-stock-write-offs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-write-offs",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-write-offs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-write-offs",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-write-offs.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-write-off-linesRead

Read stock write-off detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/list

Full JSON Payload

{
  "commandId": "read-stock-write-off-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-write-off-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
location
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-write-off-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-write-off-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-write-off-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-write-offRead

Get one stock write-off by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/get

Full JSON Payload

{
  "commandId": "get-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-write-off",
  "payload": {
    "docNo": "SWO-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-write-off",
  "payload": {
    "docNo": "SWO-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-write-off.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-write-offValidate

Validate stock write-off without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/validate

Full JSON Payload

{
  "commandId": "validate-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-write-off",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-write-off",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-write-off.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-write-offCreate

Create stock write-off.

Creates one or many stock write-off detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/create

Full JSON Payload

{
  "commandId": "create-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-write-off",
  "payload": {
    "docDate": "2026-06-24",
    "location": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
location
optional default stock location
lines
required array of stock item rows; items is also accepted as a compatibility alias
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-write-off",
  "payload": {
    "docDate": "2026-06-24",
    "location": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-write-off.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-write-offEdit

Edit stock write-off header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/edit

Full JSON Payload

{
  "commandId": "update-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-write-off",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-write-off",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-write-off.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-write-offVoid

Void/cancel stock write-off.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/void

Full JSON Payload

{
  "commandId": "void-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-write-off",
  "payload": {
    "docNo": "SWO-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-write-off",
  "payload": {
    "docNo": "SWO-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-write-off.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-write-offDelete

Delete stock write-off.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/delete

Full JSON Payload

{
  "commandId": "delete-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-write-off",
  "payload": {
    "docNo": "SWO-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-write-off-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-write-off",
  "payload": {
    "docNo": "SWO-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-write-off.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-uom-conversionsRead

List stock UOM conversion records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/list

Full JSON Payload

{
  "commandId": "list-stock-uom-conversions-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-uom-conversions",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-uom-conversions-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-uom-conversions",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-uom-conversions.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-stock-uom-conversion-linesRead

Read stock UOM conversion detail lines only.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/list

Full JSON Payload

{
  "commandId": "read-stock-uom-conversion-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-uom-conversion-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
}

Payload Fields

itemCode
optional
docNo
optional
dateFrom
YYYY-MM-DD optional
dateTo
YYYY-MM-DD optional
limit
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-stock-uom-conversion-lines-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-stock-uom-conversion-lines",
  "payload": {
    "itemCode": "ITEM001",
    "limit": 50
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-stock-uom-conversion-lines.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-uom-conversionRead

Get one stock UOM conversion by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/get

Full JSON Payload

{
  "commandId": "get-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-uom-conversion",
  "payload": {
    "docNo": "UC-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-uom-conversion",
  "payload": {
    "docNo": "UC-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-uom-conversion.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-uom-conversionValidate

Validate stock UOM conversion without saving.

Validation only; does not save. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/validate

Full JSON Payload

{
  "commandId": "validate-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-uom-conversion",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

items
optional alias for lines
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
lines
required array of stock item rows; items is also accepted as a compatibility alias
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-uom-conversion",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-uom-conversion.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-uom-conversionCreate

Create stock UOM conversion.

Creates one or many stock UOM conversion detail lines through AutoCount stock document logic. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/create

Full JSON Payload

{
  "commandId": "create-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-uom-conversion",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
lines
required array of stock item rows; items is also accepted as a compatibility alias
itemCode
single-line fallback still accepted
docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
description
optional stock document narration
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-uom-conversion",
  "payload": {
    "docDate": "2026-06-24",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "description": "Stock document created through API",
    "reason": "API stock operation",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-uom-conversion.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-uom-conversionEdit

Edit stock UOM conversion header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Batch, serial, UOM, project, department, and location fields depend on AutoCount item/account-book settings. The connector validates through AutoCount SDK before saving.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/edit

Full JSON Payload

{
  "commandId": "update-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-uom-conversion",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docNo
optional AutoCount document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional stock document narration
detailMode
optional: update | append | delete | replace
lines
required array of stock item rows; items is also accepted as a compatibility alias
reason
optional reason/remark
location
optional default stock location
fromLocation
optional source location for transfer/conversion documents
toLocation
optional destination location for transfer/conversion documents
project
optional project code
department
optional department code
items
optional alias for lines
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-uom-conversion",
  "payload": {
    "docNo": "STK-000001",
    "description": "Stock document created through API",
    "detailMode": "update",
    "lines": [
      {
        "itemCode": "ITEM001",
        "description": "Stock line 1",
        "description2": "Stock line second description",
        "barCode": "9550000000011",
        "qty": 2,
        "uom": "UNIT",
        "unitCost": 80,
        "unitPrice": 100,
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "batchNo": "BATCH-001",
        "serialNo": "SN-0001",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "reason": "API stock operation",
    "docDate": "2026-06-24",
    "location": "HQ",
    "fromLocation": "HQ",
    "toLocation": "STORE",
    "project": "PRJAPI",
    "department": "HQ",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-uom-conversion.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-uom-conversionVoid

Void/cancel stock UOM conversion.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/void

Full JSON Payload

{
  "commandId": "void-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-uom-conversion",
  "payload": {
    "docNo": "UC-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-uom-conversion",
  "payload": {
    "docNo": "UC-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-uom-conversion.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-uom-conversionDelete

Delete stock UOM conversion.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/delete

Full JSON Payload

{
  "commandId": "delete-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-uom-conversion",
  "payload": {
    "docNo": "UC-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-uom-conversion-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-uom-conversion",
  "payload": {
    "docNo": "UC-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-uom-conversion.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-item-uomwrite

Change an item's unit of measure.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/change-item-uom

Full JSON Payload

{
  "commandId": "change-item-uom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-uom",
  "payload": {
    "itemCode": "ITEM-001",
    "oldUOM": "OLD-UOM",
    "newUOM": "NEW-UOM",
    "confirm": true
  }
}

Payload Fields

itemCode
required AutoCount item code
oldUOM
required old value for oldUOM
newUOM
required new value for newUOM
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-item-uom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-uom",
  "payload": {
    "itemCode": "ITEM-001",
    "oldUOM": "OLD-UOM",
    "newUOM": "NEW-UOM",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-item-uom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-item-uom-ratewrite

Change an item's UOM conversion rate.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities. The native Int64 return is an optional POS ChangeLog ID; zero is valid and it is not a job ID. New connectors verify rate/dependent structure before automatic selected-item costing, in separate commits; TOOLS_STKCOST_RECAL_OPEN is also required. Native rate maintenance can repair batch balances book-wide, authorized by confirm:true. Historical guards remain; rateSaved with failed costing requires reconciliation, never an automatic rate retry.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/change-item-uom-rate

Full JSON Payload

{
  "commandId": "change-item-uom-rate-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-uom-rate",
  "payload": {
    "itemCode": "ITEM-001",
    "uom": "BOX",
    "newRate": 12,
    "confirm": true
  }
}

Payload Fields

itemCode
required AutoCount item code
uom
required unit of measure
newRate
required positive new UOM rate
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-item-uom-rate-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-item-uom-rate",
  "payload": {
    "itemCode": "ITEM-001",
    "uom": "BOX",
    "newRate": 12,
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-item-uom-rate.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
swap-item-uom-rateswrite

Swap an item's UOM conversion rates.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities. Native StartSwapUOMRate; isBaseUOM is optional per row. Exactly one resulting base UOM at rate 1 is required. New connectors structurally verify the save before selected-item costing in a separate commit; the native costing right is required. Rate maintenance may repair batch balances book-wide. Historical guards remain; no automatic retry after partial completion.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/swap-item-uom-rates

Full JSON Payload

{
  "commandId": "swap-item-uom-rates-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "swap-item-uom-rates",
  "payload": {
    "itemCode": "ITEM-001",
    "rates": [
      {
        "uom": "BOX",
        "newRate": 12,
        "isBaseUOM": false
      },
      {
        "uom": "PCS",
        "newRate": 1,
        "isBaseUOM": true
      }
    ],
    "confirm": true
  }
}

Payload Fields

itemCode
required AutoCount item code
rates
required modified UOM rates; each row has uom, positive newRate, and optional isBaseUOM
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "swap-item-uom-rates-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "swap-item-uom-rates",
  "payload": {
    "itemCode": "ITEM-001",
    "rates": [
      {
        "uom": "BOX",
        "newRate": 12,
        "isBaseUOM": false
      },
      {
        "uom": "PCS",
        "newRate": 1,
        "isBaseUOM": true
      }
    ],
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to swap-item-uom-rates.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-item-packagesRead

List item package records.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/list

Full JSON Payload

{
  "commandId": "list-item-packages-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-item-packages",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-item-packages-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-item-packages",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-item-packages.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-item-packageRead

Get one item package by document/code.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/get

Full JSON Payload

{
  "commandId": "get-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-item-package",
  "payload": {
    "packageCode": "PKG-API"
  }
}

Payload Fields

packageCode
required Package identity

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-item-package",
  "payload": {
    "packageCode": "PKG-API"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-item-package.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-item-packageValidate

Validate item package without saving.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately. Omitted lines/items preserve all existing details unless legacy component fields are supplied. Omitted header/detail values are preserved. update/delete require stable positive lineKey or dtlKey from get-item-package, not row position or item code alone. append and replace reject keys. append adds components; replace supplies the complete desired non-empty detail set and removes omitted components. Empty arrays are rejected in every mode, including update and previews; omit arrays for header-only update. Legacy component updates also need a stable key. validateOnly:true never saves. Create and create validation require description and lines, items, or legacy top-level itemCode. validate-item-package never saves; select edit validation using detailMode or operation:update for header-only preview; reason is optional. update-item-package requires reason even for validateOnly:true previews. validateOnly:true never saves. Header unitPrice is distinct from legacy lineUnitPrice.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/validate

Full JSON Payload

{
  "commandId": "validate-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "description": "API Package",
    "unitPrice": 120,
    "isActive": true,
    "limitedQty": 10,
    "lines": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT",
        "unitPrice": 100
      },
      {
        "itemCode": "ITEM002",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 10
      }
    ]
  }
}

Payload Fields

packageCode
required Package identity
description
optional Package description
barCode
optional Package barcode
unitPrice
optional Package selling price, distinct from component unitPrice; finite invariant decimal, native precision/validation applies
isActive
optional Package active flag; false deactivates without deleting
limitedQty
optional Package limited quantity; numeric value, not a boolean flag; finite invariant decimal, native precision/validation applies
allowDuplicateItemCode
optional Per-request duplicate permission, not stored as a Master flag; set true for creates/edits introducing duplicate component item codes
lines
optional Component rows; use lines OR items OR legacy top-level itemCode, never mix forms. Empty arrays are rejected in every mode; omit arrays for header-only update. Create/append/replace need itemCode. update/delete use existing positive lineKey/dtlKey; append/replace reject keys
items
optional Alias for lines; do not send both
itemCode
optional Legacy single-component item code; do not mix with lines/items
qty
optional Component quantity; legacy default 1; finite invariant decimal, native precision/validation applies
uom
optional Existing component UOM
lineDescription
optional Component description
lineDescription2
optional Component second description; conditional SDK/version availability. TSM Detail lacks Desc2 despite the SDK property; unsupported explicit requests fail before save
furtherDescription
optional Component further description
lineUnitPrice
optional Component selling price; finite invariant decimal, native precision/validation applies
purchasePrice
optional Component purchase price; finite invariant decimal, native precision/validation applies
taxCode
optional Component sales tax code; empty string maps to native null; TSM native save/reload verified, edge2 PASS
purchaseTaxCode
optional Component purchase tax code; empty string maps to native null; TSM native save/reload verified, edge2 PASS
validateOnly
optional True validates without saving; create/update still require write permission
Master
optional Known native header columns only; parent validates support, conflicting aliases and persistence
fields
optional Known native header columns only; parent validates support, conflicting aliases and persistence
detailMode
optional update (default for update commands with lines/items), append, delete, or replace; any detailMode selects edit validation; update/delete target stable lineKey or dtlKey
reason
optional Business reason; not required for validate-item-package edit previews
lineKey
optional Stable native detail key from get-item-package; prefer a string to preserve Int64 precision
dtlKey
optional Stable native detail key from get-item-package; prefer a string to preserve Int64 precision
operation
optional Default create; operation:update selects header-only edit validation. Any detailMode selects edit validation; reason is optional on validate-item-package

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "description": "API Package",
    "unitPrice": 120,
    "isActive": true,
    "limitedQty": 10,
    "lines": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT",
        "unitPrice": 100
      },
      {
        "itemCode": "ITEM002",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 10
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-item-package.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-item-packageCreate

Create item package definition.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately. Create and create validation require description and lines, items, or legacy top-level itemCode. validate-item-package never saves; select edit validation using detailMode or operation:update for header-only preview; reason is optional. update-item-package requires reason even for validateOnly:true previews. validateOnly:true never saves. Header unitPrice is distinct from legacy lineUnitPrice.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/create

Full JSON Payload

{
  "commandId": "create-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "description": "API Package",
    "unitPrice": 120,
    "isActive": true,
    "limitedQty": 10,
    "lines": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT",
        "unitPrice": 100
      },
      {
        "itemCode": "ITEM002",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 10
      }
    ]
  }
}

Payload Fields

packageCode
required Package identity
description
required Package description
barCode
optional Package barcode
unitPrice
optional Package selling price, distinct from component unitPrice; finite invariant decimal, native precision/validation applies
isActive
optional Package active flag; false deactivates without deleting
limitedQty
optional Package limited quantity; numeric value, not a boolean flag; finite invariant decimal, native precision/validation applies
allowDuplicateItemCode
optional Per-request duplicate permission, not stored as a Master flag; set true for creates/edits introducing duplicate component item codes
lines
optional Component rows; use lines OR items OR legacy top-level itemCode, never mix forms. Empty arrays are rejected in every mode; omit arrays for header-only update. Create/append/replace need itemCode. update/delete use existing positive lineKey/dtlKey; append/replace reject keys
items
optional Alias for lines; do not send both
itemCode
optional Legacy single-component item code; do not mix with lines/items
qty
optional Component quantity; legacy default 1; finite invariant decimal, native precision/validation applies
uom
optional Existing component UOM
lineDescription
optional Component description
lineDescription2
optional Component second description; conditional SDK/version availability. TSM Detail lacks Desc2 despite the SDK property; unsupported explicit requests fail before save
furtherDescription
optional Component further description
lineUnitPrice
optional Component selling price; finite invariant decimal, native precision/validation applies
purchasePrice
optional Component purchase price; finite invariant decimal, native precision/validation applies
taxCode
optional Component sales tax code; empty string maps to native null; TSM native save/reload verified, edge2 PASS
purchaseTaxCode
optional Component purchase tax code; empty string maps to native null; TSM native save/reload verified, edge2 PASS
validateOnly
optional True validates without saving; create/update still require write permission
Master
optional Known native header columns only; parent validates support, conflicting aliases and persistence
fields
optional Known native header columns only; parent validates support, conflicting aliases and persistence

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "description": "API Package",
    "unitPrice": 120,
    "isActive": true,
    "limitedQty": 10,
    "lines": [
      {
        "itemCode": "ITEM001",
        "qty": 1,
        "uom": "UNIT",
        "unitPrice": 100
      },
      {
        "itemCode": "ITEM002",
        "qty": 2,
        "uom": "UNIT",
        "unitPrice": 10
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-item-package.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-item-packageEdit

Update item package header/components or deactivate; requires native support and verification.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately. Omitted lines/items preserve all existing details unless legacy component fields are supplied. Omitted header/detail values are preserved. update/delete require stable positive lineKey or dtlKey from get-item-package, not row position or item code alone. append and replace reject keys. append adds components; replace supplies the complete desired non-empty detail set and removes omitted components. Empty arrays are rejected in every mode, including update and previews; omit arrays for header-only update. Legacy component updates also need a stable key. validateOnly:true never saves.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/edit

Full JSON Payload

{
  "commandId": "update-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "reason": "Retire package from use",
    "isActive": false
  }
}

Payload Fields

packageCode
required Package identity
description
optional Package description
barCode
optional Package barcode
unitPrice
optional Package selling price, distinct from component unitPrice; finite invariant decimal, native precision/validation applies
isActive
optional Package active flag; false deactivates without deleting
limitedQty
optional Package limited quantity; numeric value, not a boolean flag; finite invariant decimal, native precision/validation applies
allowDuplicateItemCode
optional Per-request duplicate permission, not stored as a Master flag; set true for creates/edits introducing duplicate component item codes
lines
optional Component rows; use lines OR items OR legacy top-level itemCode, never mix forms. Empty arrays are rejected in every mode; omit arrays for header-only update. Create/append/replace need itemCode. update/delete use existing positive lineKey/dtlKey; append/replace reject keys
items
optional Alias for lines; do not send both
itemCode
optional Legacy single-component item code; do not mix with lines/items
qty
optional Component quantity; legacy default 1; finite invariant decimal, native precision/validation applies
uom
optional Existing component UOM
lineDescription
optional Component description
lineDescription2
optional Component second description; conditional SDK/version availability. TSM Detail lacks Desc2 despite the SDK property; unsupported explicit requests fail before save
furtherDescription
optional Component further description
lineUnitPrice
optional Component selling price; finite invariant decimal, native precision/validation applies
purchasePrice
optional Component purchase price; finite invariant decimal, native precision/validation applies
taxCode
optional Component sales tax code; empty string maps to native null; TSM native save/reload verified, edge2 PASS
purchaseTaxCode
optional Component purchase tax code; empty string maps to native null; TSM native save/reload verified, edge2 PASS
validateOnly
optional True validates without saving; create/update still require write permission
Master
optional Known native header columns only; parent validates support, conflicting aliases and persistence
fields
optional Known native header columns only; parent validates support, conflicting aliases and persistence
detailMode
optional update (default for update commands with lines/items), append, delete, or replace; any detailMode selects edit validation; update/delete target stable lineKey or dtlKey
reason
required Business reason for update, including deactivation and validateOnly previews
lineKey
optional Stable native detail key from get-item-package; prefer a string to preserve Int64 precision
dtlKey
optional Stable native detail key from get-item-package; prefer a string to preserve Int64 precision

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "reason": "Retire package from use",
    "isActive": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-item-package.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-item-packageVoid

Guarded item package void request.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately. void-item-package stays guarded: no actual native void. Use update-item-package with isActive:false and a reason instead.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/void

Full JSON Payload

{
  "commandId": "void-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "reason": "Retire unused package"
  }
}

Payload Fields

packageCode
required Package identity
reason
required Business reason

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "reason": "Retire unused package"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-item-package.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-item-packageDelete

Delete an unreferenced item package or preview early checks; native maintenance2 PASS.

Static Item Package contract, not native persistence proof. Parent native connector owns strict field validation: Master/fields map known columns with support checks and readback verification; unknown/unsupported fields must be rejected, never silently ignored. Installed SDK support and Save/readback must be verified separately. Referenced packages are blocked from deletion. Early guards use recorded SoldQty/PurchasedQty/OpeningQty usage and GetPackageTransaction(code,string.Empty); this inquiry is permission-filtered, so an empty result is not proof of no references. Do not rely on the Master UsedQty getter: it throws for a missing column in TSM. Parent SDK IL inspection proves native DeleteData checks 22 tables including SO, PO, QT, ADVQT and consignment before its transaction/write, without inquiry permission filters. There is no reusable read-only helper for those comprehensive checks; actual native Delete performs them. reason is required; confirmDelete:true is required only for actual deletion. validateOnly:true checks without deleting or saving and may omit confirmDelete; preview returns saved:false, deleted:false, referenceCheckComplete:false, readyToDelete:false, nativeDeleteChecksReferences:true. No connector-owned SQL was added. Native maintenance2 PASS: unused package IPT0C160407583AA deleted with absence proof; used package IPT0C160407583AB and SO KHSO2606/0339 preserved after delete refusal. Native absence readback remains required for future deletions. Prefer update-item-package with isActive:false. Successful actual delete returns saved:true, deleted:true, verified:true, validateOnly:false, referenceCheckComplete:true, readyToDelete:false, nativeDeleteChecksReferences:true. readyToDelete stays false because the deletion has already completed; preview also returns verified:false and validateOnly:true.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/delete

Full JSON Payload

{
  "commandId": "delete-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "reason": "Retire unused package",
    "validateOnly": true
  }
}

Payload Fields

packageCode
required Package identity
reason
required Business reason
confirmDelete
optional Explicit true confirmation required for actual deletion; may be omitted when validateOnly:true
validateOnly
optional True runs early reference/usage checks without deleting; incomplete preview, not proof of readiness to delete

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-item-package-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-package",
  "payload": {
    "packageCode": "PKG-API",
    "reason": "Retire unused package",
    "validateOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-item-package.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-bom-itemsRead

List item BOM records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/list

Full JSON Payload

{
  "commandId": "list-bom-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-bom-items",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-bom-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-bom-items",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-bom-items.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-item-bomRead

Get one item BOM by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/get

Full JSON Payload

{
  "commandId": "get-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-item-bom",
  "payload": {
    "docNo": "BOM-API"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-item-bom",
  "payload": {
    "docNo": "BOM-API"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-item-bom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-item-bomValidate

Validate item BOM without saving.

Use lines or legacy subItemCode, never both. Update preserves omitted details/values; remove:true requires stable lineKey and permits optional matching subItemCode, never subItemCode alone. Replace supplies the complete desired detail set. Description changes and company-wide autoUpdateMethod changes are unsupported and must be rejected before native mutation. Native costing can change costs during saves; no no-cost-change guarantee is made. Native connector validates references, performs a single Save and reload verification; validate-item-bom never saves. Schema availability alone does not prove native support.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/validate

Full JSON Payload

{
  "commandId": "validate-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "updateBOMCost": true,
    "lines": [
      {
        "subItemCode": "RAW-API-1",
        "qty": 2
      },
      {
        "subItemCode": "RAW-API-2",
        "qty": 3
      }
    ]
  }
}

Payload Fields

itemCode
required finished item code
description
optional expected existing description; differing values are not supported for BOM persistence
assemblyCost
optional assembly cost
finishGoodCost
optional finished-good cost
autoUpdateMethod
unsupported company-wide setting; omit this field
detailMode
existing BOM only: update (default for update command) or replace; replace removes omitted lines
validateOnly
optional boolean; true prevents saving even on create/update and retains their write permission
updateBOMCost
true required for all lines[] including previews: acknowledges native save sets parent UOM Cost = FinishGoodCost * Rate; false unsupported
lines
array of {subItemCode?, qty?, lineKey?, seq?, remove?, overheadCost?, fields?, nativeFields?}; new lines need code and qty, keyed update preserves omitted values
subItemCode
legacy single component code; cannot be mixed with lines
qty
legacy single component positive quantity, default 1; cannot be mixed with lines
overheadCost
optional legacy component overhead cost

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "updateBOMCost": true,
    "lines": [
      {
        "subItemCode": "RAW-API-1",
        "qty": 2
      },
      {
        "subItemCode": "RAW-API-2",
        "qty": 3
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-item-bom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-item-bomCreate

Create item BOM definition.

Use lines or legacy subItemCode, never both. Update preserves omitted details/values; remove:true requires stable lineKey and permits optional matching subItemCode, never subItemCode alone. Replace supplies the complete desired detail set. Description changes and company-wide autoUpdateMethod changes are unsupported and must be rejected before native mutation. Native costing can change costs during saves; no no-cost-change guarantee is made. Native connector validates references, performs a single Save and reload verification; validate-item-bom never saves. Schema availability alone does not prove native support.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/create

Full JSON Payload

{
  "commandId": "create-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "updateBOMCost": true,
    "lines": [
      {
        "subItemCode": "RAW-API-1",
        "qty": 2
      },
      {
        "subItemCode": "RAW-API-2",
        "qty": 3
      }
    ]
  }
}

Payload Fields

itemCode
required finished item code
description
optional expected existing description; differing values are not supported for BOM persistence
assemblyCost
optional assembly cost
finishGoodCost
optional finished-good cost
autoUpdateMethod
unsupported company-wide setting; omit this field
detailMode
existing BOM only: update (default for update command) or replace; replace removes omitted lines
validateOnly
optional boolean; true prevents saving even on create/update and retains their write permission
updateBOMCost
true required for all lines[] including previews: acknowledges native save sets parent UOM Cost = FinishGoodCost * Rate; false unsupported
lines
array of {subItemCode?, qty?, lineKey?, seq?, remove?, overheadCost?, fields?, nativeFields?}; new lines need code and qty, keyed update preserves omitted values
subItemCode
legacy single component code; cannot be mixed with lines
qty
legacy single component positive quantity, default 1; cannot be mixed with lines
overheadCost
optional legacy component overhead cost

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "updateBOMCost": true,
    "lines": [
      {
        "subItemCode": "RAW-API-1",
        "qty": 2
      },
      {
        "subItemCode": "RAW-API-2",
        "qty": 3
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-item-bom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-item-bomEdit

Update item BOM definition.

Use lines or legacy subItemCode, never both. Update preserves omitted details/values; remove:true requires stable lineKey and permits optional matching subItemCode, never subItemCode alone. Replace supplies the complete desired detail set. Description changes and company-wide autoUpdateMethod changes are unsupported and must be rejected before native mutation. Native costing can change costs during saves; no no-cost-change guarantee is made. Native connector validates references, performs a single Save and reload verification; validate-item-bom never saves. Schema availability alone does not prove native support.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/edit

Full JSON Payload

{
  "commandId": "update-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item-bom",
  "payload": {
    "reason": "correct BOM",
    "itemCode": "FINISHED-API",
    "updateBOMCost": true,
    "lines": [
      {
        "subItemCode": "RAW-API-1",
        "qty": 2
      },
      {
        "subItemCode": "RAW-API-2",
        "qty": 3
      }
    ]
  }
}

Payload Fields

reason
optional business reason
itemCode
required finished item code
description
optional expected existing description; differing values are not supported for BOM persistence
assemblyCost
optional assembly cost
finishGoodCost
optional finished-good cost
autoUpdateMethod
unsupported company-wide setting; omit this field
detailMode
existing BOM only: update (default for update command) or replace; replace removes omitted lines
validateOnly
optional boolean; true prevents saving even on create/update and retains their write permission
updateBOMCost
true required for all lines[] including previews: acknowledges native save sets parent UOM Cost = FinishGoodCost * Rate; false unsupported
lines
array of {subItemCode?, qty?, lineKey?, seq?, remove?, overheadCost?, fields?, nativeFields?}; new lines need code and qty, keyed update preserves omitted values
subItemCode
legacy single component code; cannot be mixed with lines
qty
legacy single component positive quantity, default 1; cannot be mixed with lines
overheadCost
optional legacy component overhead cost

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item-bom",
  "payload": {
    "reason": "correct BOM",
    "itemCode": "FINISHED-API",
    "updateBOMCost": true,
    "lines": [
      {
        "subItemCode": "RAW-API-1",
        "qty": 2
      },
      {
        "subItemCode": "RAW-API-2",
        "qty": 3
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-item-bom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-item-bomVoid

Guarded item BOM void request.

Master definitions do not have a proven safe void path; request is guarded.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/void

Full JSON Payload

{
  "commandId": "void-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "reason": "void BOM"
  }
}

Payload Fields

itemCode
required finished item
reason
required

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "reason": "void BOM"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-item-bom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-item-bomDelete

Delete an unreferenced item BOM or preview native reference checks.

Stock/Delete and write queue apply even to validateOnly:true. Native checks require the BOM to exist and reject use as another BOM component before Delete. Preview returns saved:false/deleted:false. Actual deletion reloads parent/detail absence; installed connector capability and native acceptance must be verified separately.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/delete

Full JSON Payload

{
  "commandId": "delete-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "validateOnly": true
  }
}

Payload Fields

itemCode
required finished item code
validateOnly
optional boolean; true checks references without deleting
reason
optional business reason

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-item-bom-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-bom",
  "payload": {
    "itemCode": "FINISHED-API",
    "validateOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-item-bom.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-assembliesRead

List stock assembly records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock/list

Full JSON Payload

{
  "commandId": "list-stock-assemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-assemblies",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-assemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-assemblies",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-assemblies.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-assembly-ordersRead

List stock assembly order records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/list

Full JSON Payload

{
  "commandId": "list-stock-assembly-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-assembly-orders",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-assembly-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-assembly-orders",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-assembly-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-stock-disassembliesRead

List stock disassembly records.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/list

Full JSON Payload

{
  "commandId": "list-stock-disassemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-disassemblies",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-stock-disassemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-stock-disassemblies",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-stock-disassemblies.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-assemblyRead

Get one stock assembly by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly/get

Full JSON Payload

{
  "commandId": "get-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-assembly",
  "payload": {
    "docNo": "ASM-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-assembly",
  "payload": {
    "docNo": "ASM-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-assembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-assembly-orderRead

Get one stock assembly order by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/get

Full JSON Payload

{
  "commandId": "get-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-assembly-order",
  "payload": {
    "docNo": "ASO-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-assembly-order",
  "payload": {
    "docNo": "ASO-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-assembly-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-stock-disassemblyRead

Get one stock disassembly by document/code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/get

Full JSON Payload

{
  "commandId": "get-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-disassembly",
  "payload": {
    "docNo": "DSA-000001"
  }
}

Payload Fields

docNo
required document number or code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-stock-disassembly",
  "payload": {
    "docNo": "DSA-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-stock-disassembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-assemblyValidate

Validate stock assembly without saving.

Validation only; does not save. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly/validate

Full JSON Payload

{
  "commandId": "validate-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-assembly",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "description": "Stock assembly created through API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail"
  }
}

Payload Fields

items
module-specific stock lines
docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
itemCode
required finished/main item code
description
optional document description
location
required or optional stock location
qty
required finished/main quantity
uom
optional finished/main UOM
unitCost
optional finished/main unit cost
detailMode
optional update mode such as replace or update
lines
required component/detail rows
reason
optional business reason for update requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-assembly",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "description": "Stock assembly created through API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-assembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-assembly-orderValidate

Validate stock assembly order without saving.

Validation only; does not save. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/validate

Full JSON Payload

{
  "commandId": "validate-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-assembly-order",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "description": "Stock assembly order created through API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail"
  }
}

Payload Fields

items
module-specific stock lines
docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
itemCode
required finished/main item code
description
optional document description
location
required or optional stock location
qty
required finished/main quantity
uom
optional finished/main UOM
unitCost
optional finished/main unit cost
detailMode
optional update mode such as replace or update
lines
required component/detail rows
reason
optional business reason for update requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-assembly-order",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "description": "Stock assembly order created through API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-assembly-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-stock-disassemblyValidate

Validate stock disassembly without saving.

Validation only; does not save. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/validate

Full JSON Payload

{
  "commandId": "validate-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-disassembly",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "description": "Stock disassembly created through API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail"
  }
}

Payload Fields

items
module-specific stock lines
docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
itemCode
required finished/main item code
description
optional document description
location
required or optional stock location
qty
required finished/main quantity
uom
optional finished/main UOM
unitCost
optional finished/main unit cost
detailMode
optional update mode such as replace or update
lines
required component/detail rows
reason
optional business reason for update requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-stock-disassembly",
  "payload": {
    "items": [
      {
        "itemCode": "ITEM001",
        "qty": 1
      }
    ],
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "description": "Stock disassembly created through API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-stock-disassembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-assemblyCreate

Create stock assembly.

Creates stock assembly with optional multiple component/detail lines through AutoCount manufacturing/stock logic. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly/create

Full JSON Payload

{
  "commandId": "create-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-assembly",
  "payload": {
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "description": "Stock assembly created through API",
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "reason": "correct assembly detail"
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
itemCode
required finished/main item code
qty
required finished/main quantity
location
required or optional stock location
lines
required component/detail rows
docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
description
optional document description
uom
optional finished/main UOM
unitCost
optional finished/main unit cost
detailMode
optional update mode such as replace or update
reason
optional business reason for update requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-assembly",
  "payload": {
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "description": "Stock assembly created through API",
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "reason": "correct assembly detail"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-assembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-assembly-orderCreate

Create stock assembly order.

Creates stock assembly order with optional multiple component/detail lines through AutoCount manufacturing/stock logic. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/create

Full JSON Payload

{
  "commandId": "create-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-assembly-order",
  "payload": {
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "description": "Stock assembly order created through API",
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "reason": "correct assembly detail"
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
itemCode
required finished/main item code
qty
required finished/main quantity
location
required or optional stock location
lines
required component/detail rows
docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
description
optional document description
uom
optional finished/main UOM
unitCost
optional finished/main unit cost
detailMode
optional update mode such as replace or update
reason
optional business reason for update requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-assembly-order",
  "payload": {
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "description": "Stock assembly order created through API",
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "reason": "correct assembly detail"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-assembly-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-stock-disassemblyCreate

Create stock disassembly.

Creates stock disassembly with optional multiple detail lines through AutoCount manufacturing/stock logic. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/create

Full JSON Payload

{
  "commandId": "create-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-disassembly",
  "payload": {
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "description": "Stock disassembly created through API",
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "reason": "correct assembly detail"
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
itemCode
required finished/main item code
qty
required finished/main quantity
location
required or optional stock location
lines
required component/detail rows
docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
description
optional document description
uom
optional finished/main UOM
unitCost
optional finished/main unit cost
detailMode
optional update mode such as replace or update
reason
optional business reason for update requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-stock-disassembly",
  "payload": {
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "description": "Stock disassembly created through API",
    "uom": "UNIT",
    "unitCost": 100,
    "detailMode": "replace",
    "reason": "correct assembly detail"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-stock-disassembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-assemblyEdit

Edit stock assembly header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly/edit

Full JSON Payload

{
  "commandId": "update-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-assembly",
  "payload": {
    "docNo": "ASM-000001",
    "description": "Stock assembly created through API",
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail",
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100
  }
}

Payload Fields

docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional document description
detailMode
optional update mode such as replace or update
lines
required component/detail rows
reason
optional business reason for update requests
itemCode
required finished/main item code
location
required or optional stock location
qty
required finished/main quantity
uom
optional finished/main UOM
unitCost
optional finished/main unit cost

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-assembly",
  "payload": {
    "docNo": "ASM-000001",
    "description": "Stock assembly created through API",
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail",
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-assembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-assembly-orderEdit

Edit stock assembly order header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/edit

Full JSON Payload

{
  "commandId": "update-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-assembly-order",
  "payload": {
    "docNo": "ASM-000001",
    "description": "Stock assembly order created through API",
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail",
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100
  }
}

Payload Fields

docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional document description
detailMode
optional update mode such as replace or update
lines
required component/detail rows
reason
optional business reason for update requests
itemCode
required finished/main item code
location
required or optional stock location
qty
required finished/main quantity
uom
optional finished/main UOM
unitCost
optional finished/main unit cost

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-assembly-order",
  "payload": {
    "docNo": "ASM-000001",
    "description": "Stock assembly order created through API",
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail",
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-assembly-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-stock-disassemblyEdit

Edit stock disassembly header fields and detail lines.

Uses AutoCount SDK EditDetail/AddDetail/DeleteDetail/ClearDetails + Save. Supported line fields include itemCode, qty, uom, location, batchNo, unitCost, oldCost, newCost, fromQty, toQty, fromUom, toUom, itemCost, rate, description, projNo, and deptNo where the document type exposes them. Full human payload reference for stock assembly/order/disassembly. Batch, serial, and costing behavior depends on item and account-book settings.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/edit

Full JSON Payload

{
  "commandId": "update-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-disassembly",
  "payload": {
    "docNo": "ASM-000001",
    "description": "Stock disassembly created through API",
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail",
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100
  }
}

Payload Fields

docNo
optional stock assembly document number; omit to let AutoCount numbering generate it
docDate
required or optional YYYY-MM-DD document date
description
optional document description
detailMode
optional update mode such as replace or update
lines
required component/detail rows
reason
optional business reason for update requests
itemCode
required finished/main item code
location
required or optional stock location
qty
required finished/main quantity
uom
optional finished/main UOM
unitCost
optional finished/main unit cost

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-stock-disassembly",
  "payload": {
    "docNo": "ASM-000001",
    "description": "Stock disassembly created through API",
    "detailMode": "replace",
    "lines": [
      {
        "lineNo": 1,
        "itemCode": "RAW-API-1",
        "description": "Raw material 1",
        "qty": 2,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 10,
        "batchNo": "BATCH-001",
        "serialNo": ""
      },
      {
        "lineNo": 2,
        "itemCode": "RAW-API-2",
        "description": "Raw material 2",
        "qty": 3,
        "uom": "UNIT",
        "location": "HQ",
        "unitCost": 5,
        "batchNo": "",
        "serialNo": ""
      }
    ],
    "reason": "correct assembly detail",
    "docDate": "2026-06-24",
    "itemCode": "FINISHED-API",
    "location": "HQ",
    "qty": 1,
    "uom": "UNIT",
    "unitCost": 100
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-stock-disassembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-assemblyVoid

Void/cancel stock assembly.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly/void

Full JSON Payload

{
  "commandId": "void-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-assembly",
  "payload": {
    "docNo": "ASM-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-assembly",
  "payload": {
    "docNo": "ASM-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-assembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-assembly-orderVoid

Void/cancel stock assembly order.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/void

Full JSON Payload

{
  "commandId": "void-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-assembly-order",
  "payload": {
    "docNo": "ASO-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-assembly-order",
  "payload": {
    "docNo": "ASO-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-assembly-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-stock-disassemblyVoid

Void/cancel stock disassembly.

Uses AutoCount SDK CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/void

Full JSON Payload

{
  "commandId": "void-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-disassembly",
  "payload": {
    "docNo": "DSA-000001",
    "reason": "void/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-stock-disassembly",
  "payload": {
    "docNo": "DSA-000001",
    "reason": "void/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-stock-disassembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-assemblyDelete

Delete stock assembly.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly/delete

Full JSON Payload

{
  "commandId": "delete-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-assembly",
  "payload": {
    "docNo": "ASM-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-assembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-assembly",
  "payload": {
    "docNo": "ASM-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-assembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-assembly-orderDelete

Delete stock assembly order.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/delete

Full JSON Payload

{
  "commandId": "delete-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-assembly-order",
  "payload": {
    "docNo": "ASO-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-assembly-order-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-assembly-order",
  "payload": {
    "docNo": "ASO-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-assembly-order.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-stock-disassemblyDelete

Delete stock disassembly.

Uses AutoCount SDK Delete. Use carefully because stock transactions affect costing and audit history.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/delete

Full JSON Payload

{
  "commandId": "delete-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-disassembly",
  "payload": {
    "docNo": "DSA-000001",
    "reason": "remove/correct stock document"
  }
}

Payload Fields

docNo
required document number or code
reason
optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
location
default stock location
fromLocation
source stock location
toLocation
destination stock location

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-stock-disassembly-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-stock-disassembly",
  "payload": {
    "docNo": "DSA-000001",
    "reason": "remove/correct stock document"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-stock-disassembly.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

GL

Chart of accounts, GL account maintenance, journal entries, journal PDF, and account balances.

read-chart-accountsRead

List GL chart of accounts.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/list

Full JSON Payload

{
  "commandId": "read-chart-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-chart-accounts",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-chart-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-chart-accounts",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-chart-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-gl-account-balanceRead

Read one GL account balance.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/list

Full JSON Payload

{
  "commandId": "read-gl-account-balance-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-account-balance",
  "payload": {
    "accNo": "500-0000",
    "fromDate": "2026-01-01",
    "toDate": "2026-06-15"
  }
}

Payload Fields

accNo
required
fromDate
YYYY-MM-DD required
toDate
YYYY-MM-DD required

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-gl-account-balance-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-account-balance",
  "payload": {
    "accNo": "500-0000",
    "fromDate": "2026-01-01",
    "toDate": "2026-06-15"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-gl-account-balance.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-gl-account-balancesRead

Read many/all GL account balances in one connector execution.

Returns account metadata plus numeric balance for every returned account. Use this instead of calling read-gl-account-balance thousands of times.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/list

Full JSON Payload

{
  "commandId": "read-gl-account-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-account-balances",
  "payload": {
    "fromDate": "2026-08-01",
    "toDate": "2026-08-31",
    "limit": 5000,
    "includeZeroBalance": true
  }
}

Payload Fields

fromDate
YYYY-MM-DD required
toDate
YYYY-MM-DD required
limit
optional, default 5000, max 10000
accountType
optional AccType filter
includeZeroBalance
optional boolean, default true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-gl-account-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-account-balances",
  "payload": {
    "fromDate": "2026-08-01",
    "toDate": "2026-08-31",
    "limit": 5000,
    "includeZeroBalance": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-gl-account-balances.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-gl-accountRead

Get one GL Account Maintenance account.

Reads from AutoCount AccountInquiry chart data.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/get

Full JSON Payload

{
  "commandId": "get-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gl-account",
  "payload": {
    "accNo": "610-0000"
  }
}

Payload Fields

accNo
required account code

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gl-account",
  "payload": {
    "accNo": "610-0000"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-gl-account.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-fixed-asset-gl-accountsCreate

Create the two GL accounts from AutoCount's Create New Fixed Asset Account screen.

Creates both GL Account Maintenance records through AutoCount AccountCommand.NewAccount and SaveAccount. The connector checks both account numbers before saving either record. Use create-gl-account only when creating one account. Matches AutoCount Create New Fixed Asset Account screen. It saves two GL Account Maintenance records through AutoCount AccountCommand: the fixed asset account with specialAccType SFA and the accumulated depreciation account with specialAccType SAD. Use list-general-account-types first; accType must be a real account type code in that account book.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/create

Full JSON Payload

{
  "commandId": "create-fixed-asset-gl-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-fixed-asset-gl-accounts",
  "payload": {
    "fixedAsset": {
      "accNo": "150-1000",
      "description": "Motor Vehicle",
      "accType": "use an Asset code from list-general-account-types",
      "parentAccNo": "<<FIXED ASSETS>>",
      "currencyCode": "MYR",
      "cashFlowCategory": "InvestingActivities",
      "specialAccType": "SFA"
    },
    "accumulatedDepreciation": {
      "accNo": "159-1000",
      "description": "Accumulated Depreciation - Motor Vehicle",
      "accType": "use an Asset code from list-general-account-types",
      "parentAccNo": "<<FIXED ASSETS>>",
      "currencyCode": "MYR",
      "cashFlowCategory": "OperatingActivities",
      "specialAccType": "SAD"
    }
  }
}

Payload Fields

fixedAsset
{"accNo":"required fixed asset GL account number","description":"required fixed asset GL account description","accType":"required valid Asset account type code from list-general-account-types","parentAccNo":"optional fixed asset parent account","currencyCode":"optional currency code, for example MYR","cashFlowCategory":"optional, defaults to InvestingActivities","specialAccType":"optional, defaults to SFA / FixedAsset"}
accumulatedDepreciation
{"accNo":"required accumulated depreciation GL account number","description":"required accumulated depreciation GL account description","accType":"required valid Asset account type code from list-general-account-types","parentAccNo":"optional accumulated depreciation parent account","currencyCode":"optional currency code, for example MYR","cashFlowCategory":"optional, defaults to OperatingActivities","specialAccType":"optional, defaults to SAD / AccumulatedDepreciation"}

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-fixed-asset-gl-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-fixed-asset-gl-accounts",
  "payload": {
    "fixedAsset": {
      "accNo": "150-1000",
      "description": "Motor Vehicle",
      "accType": "use an Asset code from list-general-account-types",
      "parentAccNo": "<<FIXED ASSETS>>",
      "currencyCode": "MYR",
      "cashFlowCategory": "InvestingActivities",
      "specialAccType": "SFA"
    },
    "accumulatedDepreciation": {
      "accNo": "159-1000",
      "description": "Accumulated Depreciation - Motor Vehicle",
      "accType": "use an Asset code from list-general-account-types",
      "parentAccNo": "<<FIXED ASSETS>>",
      "currencyCode": "MYR",
      "cashFlowCategory": "OperatingActivities",
      "specialAccType": "SAD"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-fixed-asset-gl-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-gl-accountCreate

Create a GL Account Maintenance account.

Requires write access permission. Uses AutoCount.GL.AccountMaintenance.AccountCommand.NewAccount and AccountCommand.SaveAccount, with duplicate account check before save. Use list-general-account-types to discover valid account type codes for the account book. For fixed asset, use a valid Asset accType returned by list-general-account-types and set specialAccType: "SFA" or "FixedAsset". Do not put fixed asset into accType unless that exact AccType code exists. Full human payload reference for GL Account Maintenance. Account type, parent account, and special account type must match the account book's chart of accounts rules. Use list-general-account-types to discover valid account type codes. For a fixed asset GL account, use a valid Asset accType returned by list-general-account-types and set specialAccType: "SFA" or "FixedAsset". Do not put fixed asset into accType unless that exact AccType code exists in the account book.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/create

Full JSON Payload

{
  "commandId": "create-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-account",
  "payload": {
    "accNo": "690-9000",
    "description": "API Expense Account",
    "accType": "EP",
    "parentAccNo": "610-0000",
    "cashFlowCategory": "OperatingActivities",
    "specialAccType": "Normal",
    "desc2": "API expense second description",
    "currencyCode": "MYR",
    "isActive": true,
    "remark1": "Created by API",
    "remark2": "GL account setup example"
  }
}

Payload Fields

accNo
required GL account number
description
required account description/name
accType
required AutoCount account type
parentAccNo
optional parent account number
currencyCode
optional currency code
cashFlowCategory
optional cash flow category
specialAccType
optional special account type such as Normal, Bank, Cash, FixedAsset/SFA, AccumulatedDepreciation/SAD, DebtorControl, or CreditorControl
desc2
optional second description
isActive
optional boolean active flag
remark1
optional remark field 1
remark2
optional remark field 2

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-account",
  "payload": {
    "accNo": "690-9000",
    "description": "API Expense Account",
    "accType": "EP",
    "parentAccNo": "610-0000",
    "cashFlowCategory": "OperatingActivities",
    "specialAccType": "Normal",
    "desc2": "API expense second description",
    "currencyCode": "MYR",
    "isActive": true,
    "remark1": "Created by API",
    "remark2": "GL account setup example"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-gl-account.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gl-accountEdit

Guarded GL account edit request.

Returns editBlocked until AccountCommand edit/save safety is proven. Full human payload reference for GL Account Maintenance. Account type, parent account, and special account type must match the account book's chart of accounts rules. Use list-general-account-types to discover valid account type codes. For a fixed asset GL account, use a valid Asset accType returned by list-general-account-types and set specialAccType: "SFA" or "FixedAsset". Do not put fixed asset into accType unless that exact AccType code exists in the account book.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/edit

Full JSON Payload

{
  "commandId": "update-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-account",
  "payload": {
    "accNo": "690-9000",
    "reason": "correct account description",
    "description": "API Expense Account",
    "desc2": "API expense second description",
    "accType": "EP",
    "parentAccNo": "610-0000",
    "currencyCode": "MYR",
    "cashFlowCategory": "OperatingActivities",
    "specialAccType": "Normal",
    "isActive": true,
    "remark1": "Created by API",
    "remark2": "GL account setup example"
  }
}

Payload Fields

accNo
required GL account number
reason
required
description
required account description/name
desc2
optional second description
accType
required AutoCount account type
parentAccNo
optional parent account number
currencyCode
optional currency code
cashFlowCategory
optional cash flow category
specialAccType
optional special account type such as Normal, Bank, Cash, FixedAsset/SFA, AccumulatedDepreciation/SAD, DebtorControl, or CreditorControl
isActive
optional boolean active flag
remark1
optional remark field 1
remark2
optional remark field 2

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-account",
  "payload": {
    "accNo": "690-9000",
    "reason": "correct account description",
    "description": "API Expense Account",
    "desc2": "API expense second description",
    "accType": "EP",
    "parentAccNo": "610-0000",
    "currencyCode": "MYR",
    "cashFlowCategory": "OperatingActivities",
    "specialAccType": "Normal",
    "isActive": true,
    "remark1": "Created by API",
    "remark2": "GL account setup example"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gl-account.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-gl-accountVoid

Guarded GL account void request.

Returns voidBlocked; chart accounts may be linked to posted transactions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/void

Full JSON Payload

{
  "commandId": "void-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-gl-account",
  "payload": {
    "accNo": "610-0000",
    "reason": "deactivate account"
  }
}

Payload Fields

accNo
required account code
reason
required

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-gl-account",
  "payload": {
    "accNo": "610-0000",
    "reason": "deactivate account"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-gl-account.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-gl-accountDelete

Guarded GL account delete request.

Returns deleteBlocked; chart accounts may be linked to posted transactions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/delete

Full JSON Payload

{
  "commandId": "delete-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-gl-account",
  "payload": {
    "accNo": "610-0000",
    "reason": "remove unused account"
  }
}

Payload Fields

accNo
required account code
reason
required

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-gl-account-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-gl-account",
  "payload": {
    "accNo": "610-0000",
    "reason": "remove unused account"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-gl-account.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-journal-entriesRead

List journal entries.

Uses AutoCount JournalEntryCommand.InquireAllMaster.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/list

Full JSON Payload

{
  "commandId": "list-journal-entries-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-journal-entries",
  "payload": {
    "columns": "DocKey,DocNo,DocDate,JournalType,Description,TotalDR,TotalCR,Cancelled,LastModified"
  }
}

Payload Fields

status
optional AutoCount document status
columns
optional comma-separated master columns

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-journal-entries-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-journal-entries",
  "payload": {
    "columns": "DocKey,DocNo,DocDate,JournalType,Description,TotalDR,TotalCR,Cancelled,LastModified"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-journal-entries.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-journal-entryRead

Get one journal entry with detail lines.

Uses AutoCount JournalEntryCommand.View.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/get

Full JSON Payload

{
  "commandId": "get-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-journal-entry",
  "payload": {
    "docNo": "JV-000001"
  }
}

Payload Fields

docNo
required unless docKey is supplied
docKey
optional numeric document key

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-journal-entry",
  "payload": {
    "docNo": "JV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-journal-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-journal-entryValidate

Validate a GL journal entry without saving. Supports the same multi-line payload as create-journal-entry.

Validation only. Total debit must equal total credit. Multiple lines are supported. Debit and credit totals must balance before AutoCount will save.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/validate

Full JSON Payload

{
  "commandId": "validate-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-journal-entry",
  "payload": {
    "docDate": "2026-06-24",
    "description": "API journal entry",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Debit expense",
        "debit": 100,
        "credit": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accNo": "500-1000",
        "accountNo": "500-1000",
        "description": "Credit control",
        "debit": 0,
        "credit": 100,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022"
      }
    ],
    "journalType": "JV",
    "refNo": "API-JV-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required YYYY-MM-DD journal date
description
optional journal narration
lines
required array of debit/credit rows; total debit must equal total credit
docNo
optional journal voucher number; omit to let AutoCount numbering generate it
journalType
optional AutoCount journal type
refNo
optional reference number
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-journal-entry",
  "payload": {
    "docDate": "2026-06-24",
    "description": "API journal entry",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Debit expense",
        "debit": 100,
        "credit": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accNo": "500-1000",
        "accountNo": "500-1000",
        "description": "Credit control",
        "debit": 0,
        "credit": 100,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022"
      }
    ],
    "journalType": "JV",
    "refNo": "API-JV-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-journal-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-journal-entryCreate

Create GL journal entry. Supports one or many debit/credit lines.

Requires write access permission. Total debit must equal total credit. Old debitAccNo/creditAccNo/amount payload still works. Multiple lines are supported. Debit and credit totals must balance before AutoCount will save.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/create

Full JSON Payload

{
  "commandId": "create-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-journal-entry",
  "payload": {
    "docDate": "2026-06-24",
    "description": "API journal entry",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Debit expense",
        "debit": 100,
        "credit": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accNo": "500-1000",
        "accountNo": "500-1000",
        "description": "Credit control",
        "debit": 0,
        "credit": 100,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022"
      }
    ],
    "journalType": "JV",
    "refNo": "API-JV-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required YYYY-MM-DD journal date
description
optional journal narration
lines
required array of debit/credit rows; total debit must equal total credit
docNo
optional journal voucher number; omit to let AutoCount numbering generate it
journalType
optional AutoCount journal type
refNo
optional reference number
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-journal-entry",
  "payload": {
    "docDate": "2026-06-24",
    "description": "API journal entry",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Debit expense",
        "debit": 100,
        "credit": 0,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      },
      {
        "accNo": "500-1000",
        "accountNo": "500-1000",
        "description": "Credit control",
        "debit": 0,
        "credit": 100,
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "taxType": "S-0",
        "taxCode": "S-0",
        "classification": "022"
      }
    ],
    "journalType": "JV",
    "refNo": "API-JV-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-journal-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-journal-entryEdit

Update a journal entry editable SDK fields and supported detail rows with persisted verification.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Journal debit/credit and Cash Book posting/payment totals must balance. Reconciled rows and source-linked documents remain protected.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/edit

Full JSON Payload

{
  "commandId": "update-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-journal-entry",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
detailMode
explicit update | append | replace | delete for detail edits
lines
optional posting/detail updates selected by dtlKey
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-journal-entry",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-journal-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Journal debit/credit and Cash Book posting/payment totals must balance. Reconciled rows and source-linked documents remain protected.
void-journal-entryVoid

Cancel/void a journal entry.

Uses AutoCount JournalEntryCommand.CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/void

Full JSON Payload

{
  "commandId": "void-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-journal-entry",
  "payload": {
    "docNo": "JV-000001",
    "reason": "void/correct journal"
  }
}

Payload Fields

docNo
required unless docKey is provided
docKey
optional numeric document key
reason
optional audit reason

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-journal-entry",
  "payload": {
    "docNo": "JV-000001",
    "reason": "void/correct journal"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-journal-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-journal-entryDelete

Hard delete a journal entry.

Uses AutoCount JournalEntryCommand.Delete. Use void-journal-entry when audit-trail cancellation is required.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/delete

Full JSON Payload

{
  "commandId": "delete-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-journal-entry",
  "payload": {
    "docNo": "JV-000001",
    "reason": "delete incorrect journal"
  }
}

Payload Fields

docNo
required unless docKey is provided
docKey
optional numeric document key
reason
optional audit reason

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-journal-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-journal-entry",
  "payload": {
    "docNo": "JV-000001",
    "reason": "delete incorrect journal"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-journal-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-financial-reportPDF/Report

Read a native AutoCount financial report.

Uses the native AutoCount financial report factory and does not calculate report totals in the cloud. reportType is required and must be one of trial-balance, balance-sheet, profit-loss, cash-flow, or group-statement. trial-balance, profit-loss, and cash-flow are period reports and require both fromDate and toDate; asOfDate is rejected for them and fromDate must not be after toDate. balance-sheet is point-in-time and requires asOfDate; fromDate and toDate are rejected. group-statement requires accNo (accountNo is an accepted alias) and supports optional bs; with bs true use asOfDate, while bs false or omitted uses fromDate and toDate. It is a single-account report, not multi-company consolidation. project and department accept only a scalar or comma-separated individual dimension filter. includeZeroBalance and showAccountNumbers default to true. Unsupported fields or shapes are rejected rather than ignored.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/reports/list

Full JSON Payload

{
  "commandId": "read-financial-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-financial-report",
  "payload": {
    "reportType": "trial-balance",
    "fromDate": "2026-01-01",
    "toDate": "2026-06-30"
  }
}

Payload Fields

reportType
required exact value: trial-balance | balance-sheet | profit-loss | cash-flow | group-statement
fromDate
period start date in YYYY-MM-DD; use with trial-balance, profit-loss, or cash-flow, and with group-statement when bs is false or omitted
toDate
period end date in YYYY-MM-DD; use with trial-balance, profit-loss, or cash-flow, and with group-statement when bs is false or omitted
asOfDate
point-in-time date in YYYY-MM-DD; use with balance-sheet or group-statement when bs is true
project
optional scalar or comma-separated project dimension filter
department
optional scalar or comma-separated department dimension filter
includeZeroBalance
optional boolean; maps to native ShowZeroBalance and defaults to true
showAccountNumbers
optional boolean; maps to native ShowAccNo and defaults to true
accNo
required for group-statement: GL account number
accountNo
group-statement alias for accNo
bs
optional boolean for group-statement; maps to native GSReportOption.BS and defaults to false

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-financial-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-financial-report",
  "payload": {
    "reportType": "trial-balance",
    "fromDate": "2026-01-01",
    "toDate": "2026-06-30"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-financial-report.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
financial-report-autocount-pdfPDF/Report

Generate a native AutoCount financial report PDF.

Uses the native AutoCount financial report factory and does not calculate report totals in the cloud. reportType is required and must be one of trial-balance, balance-sheet, profit-loss, cash-flow, or group-statement. trial-balance, profit-loss, and cash-flow are period reports and require both fromDate and toDate; asOfDate is rejected for them and fromDate must not be after toDate. balance-sheet is point-in-time and requires asOfDate; fromDate and toDate are rejected. group-statement requires accNo (accountNo is an accepted alias) and supports optional bs; with bs true use asOfDate, while bs false or omitted uses fromDate and toDate. It is a single-account report, not multi-company consolidation. project and department accept only a scalar or comma-separated individual dimension filter. includeZeroBalance and showAccountNumbers default to true. Unsupported fields or shapes are rejected rather than ignored. The PDF result is returned through the authenticated command artifact endpoint. out is optional and must remain under the connector reports output root with a .pdf extension.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/reports/pdf

Full JSON Payload

{
  "commandId": "financial-report-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "financial-report-autocount-pdf",
  "payload": {
    "reportType": "trial-balance",
    "fromDate": "2026-01-01",
    "toDate": "2026-06-30"
  }
}

Payload Fields

reportType
required exact value: trial-balance | balance-sheet | profit-loss | cash-flow | group-statement
fromDate
period start date in YYYY-MM-DD; use with trial-balance, profit-loss, or cash-flow, and with group-statement when bs is false or omitted
toDate
period end date in YYYY-MM-DD; use with trial-balance, profit-loss, or cash-flow, and with group-statement when bs is false or omitted
asOfDate
point-in-time date in YYYY-MM-DD; use with balance-sheet or group-statement when bs is true
project
optional scalar or comma-separated project dimension filter
department
optional scalar or comma-separated department dimension filter
includeZeroBalance
optional boolean; maps to native ShowZeroBalance and defaults to true
showAccountNumbers
optional boolean; maps to native ShowAccNo and defaults to true
accNo
required for group-statement: GL account number
accountNo
group-statement alias for accNo
bs
optional boolean for group-statement; maps to native GSReportOption.BS and defaults to false
out
optional PDF output path under the connector reports output root; .pdf extension only

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "financial-report-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "financial-report-autocount-pdf",
  "payload": {
    "reportType": "trial-balance",
    "fromDate": "2026-01-01",
    "toDate": "2026-06-30"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to financial-report-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
read-gl-opening-balancesRead

Read GL Opening Balance Maintenance for one fiscal period and project/department scope.

Uses AutoCount OpeningBalanceCommand.Edit. Rows include AccNo, currency, debit/credit, home debit/credit, and CanEdit. Blank project/department selects the editable no-project/no-department scope, not the read-only all-scope aggregate.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/gl/list

Full JSON Payload

{
  "commandId": "read-gl-opening-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-opening-balances",
  "payload": {
    "periodDate": "2026-01-01",
    "projectNo": "",
    "departmentNo": "",
    "limit": 5000
  }
}

Payload Fields

periodDate
required YYYY-MM-DD date inside the fiscal period
projectNo
optional exact project; blank means no project
departmentNo
optional exact department; blank means no department
limit
optional row limit, maximum 10000

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-gl-opening-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-opening-balances",
  "payload": {
    "periodDate": "2026-01-01",
    "projectNo": "",
    "departmentNo": "",
    "limit": 5000
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-gl-opening-balances.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-gl-year-to-date-balancesRead

Read Year-to-Date Balance Maintenance rows.

Uses AutoCount YearToDate.LoadData in normal read mode and returns native PeriodNo, AccNo, DR, CR, HomeDR, and HomeCR rows. The SDK ZeroPBalance reset flag is intentionally never exposed.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/gl/list

Full JSON Payload

{
  "commandId": "read-gl-year-to-date-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-year-to-date-balances",
  "payload": {
    "months": 12,
    "projectNo": "",
    "departmentNo": "",
    "limit": 5000
  }
}

Payload Fields

months
optional number of periods, 1 to 24; default 12
projectNo
optional project code
departmentNo
optional department code
limit
optional row limit, maximum 10000

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-gl-year-to-date-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-year-to-date-balances",
  "payload": {
    "months": 12,
    "projectNo": "",
    "departmentNo": "",
    "limit": 5000
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-gl-year-to-date-balances.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gl-opening-balancesEdit

Validate or save selected GL opening-balance rows and verify them by SDK reload.

SDK only. It rejects non-editable accounts and foreign-currency rows without home amounts. A save returns success only after exact AutoCount reload verification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/gl/edit

Full JSON Payload

{
  "commandId": "update-gl-opening-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-opening-balances",
  "payload": {
    "periodDate": "2026-01-01",
    "balances": [
      {
        "accNo": "100-0000",
        "debit": 0,
        "credit": 1000
      }
    ],
    "validateOnly": true
  }
}

Payload Fields

periodDate
required YYYY-MM-DD date inside the fiscal period
projectNo
optional exact project; blank means no project
departmentNo
optional exact department; blank means no department
localCurrencyCode
optional only when AutoCount local currency cannot be detected
balances
required array of {accNo, debit, credit, homeDebit?, homeCredit?}; home values are required for foreign-currency accounts
validateOnly
optional true to validate without saving
confirmWrite
required true for an actual save

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gl-opening-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-opening-balances",
  "payload": {
    "periodDate": "2026-01-01",
    "balances": [
      {
        "accNo": "100-0000",
        "debit": 0,
        "credit": 1000
      }
    ],
    "validateOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gl-opening-balances.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gl-year-to-date-balancesEdit

Validate or save selected Year-to-Date Balance Maintenance rows and verify them by SDK reload.

SDK only. Unknown accounts and periods outside the requested month range are rejected. The dangerous SDK ZeroPBalance reset flag is not exposed. A save returns success only after exact AutoCount reload verification.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/gl/edit

Full JSON Payload

{
  "commandId": "update-gl-year-to-date-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-year-to-date-balances",
  "payload": {
    "months": 12,
    "balances": [
      {
        "accNo": "500-0000",
        "periodNo": 1,
        "debit": 1000,
        "credit": 0
      }
    ],
    "validateOnly": true
  }
}

Payload Fields

months
optional number of periods, 1 to 24; default 12
projectNo
optional project code
departmentNo
optional department code
balances
required array of {accNo, periodNo, debit, credit, homeDebit?, homeCredit?}
validateOnly
optional true to validate without saving
confirmWrite
required true for an actual save

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gl-year-to-date-balances-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-year-to-date-balances",
  "payload": {
    "months": 12,
    "balances": [
      {
        "accNo": "500-0000",
        "periodNo": 1,
        "debit": 1000,
        "credit": 0
      }
    ],
    "validateOnly": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gl-year-to-date-balances.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

GL Cash Book

Cash book document grid, payment voucher, official receipt, bank/cash accounts, and voucher PDF.

list-gl-bank-cash-accountsRead

List GL bank and cash accounts used by cash book.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/gl-cash-book/list

Full JSON Payload

{
  "commandId": "list-gl-bank-cash-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-bank-cash-accounts",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gl-bank-cash-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-bank-cash-accounts",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gl-bank-cash-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-gl-cash-book-documentsRead

List the G/L > Cash Book Entry document grid.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-book-entry/list

Full JSON Payload

{
  "commandId": "list-gl-cash-book-documents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-cash-book-documents",
  "payload": {
    "columns": "DocKey,DocNo,DocDate,Description,DealWith,Total,NetTotal,TotalPayment,Cancelled,LastModified"
  }
}

Payload Fields

status
optional AutoCount document status
columns
optional comma-separated master columns

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gl-cash-book-documents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-cash-book-documents",
  "payload": {
    "columns": "DocKey,DocNo,DocDate,Description,DealWith,Total,NetTotal,TotalPayment,Cancelled,LastModified"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gl-cash-book-documents.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-gl-cash-book-entriesRead

List cash book report/inquiry rows grouped by bank/cash account.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-book-report/list

Full JSON Payload

{
  "commandId": "list-gl-cash-book-entries-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-cash-book-entries",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "showTotal": true,
    "showDebtorDetails": false,
    "showCreditorDetails": false,
    "showInLocalCurrency": false
  }
}

Payload Fields

fromDate
YYYY-MM-DD optional
toDate
YYYY-MM-DD optional
accountNo
optional bank/cash account
accountNos
optional comma-separated bank/cash accounts
showTotal
boolean optional
showDebtorDetails
boolean optional
showCreditorDetails
boolean optional
showInLocalCurrency
boolean optional
sortBy
optional AutoCount account sort enum name

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gl-cash-book-entries-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-cash-book-entries",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "showTotal": true,
    "showDebtorDetails": false,
    "showCreditorDetails": false,
    "showInLocalCurrency": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gl-cash-book-entries.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-gl-cash-book-entryRead

Get one G/L Cash Book entry with detail and payment rows.

Uses AutoCount CashBookCommand.View.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-book-entry/get

Full JSON Payload

{
  "commandId": "get-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gl-cash-book-entry",
  "payload": {
    "docNo": "PV-000001"
  }
}

Payload Fields

docNo
required unless docKey is supplied
docKey
optional numeric document key

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gl-cash-book-entry",
  "payload": {
    "docNo": "PV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-gl-cash-book-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-gl-cash-book-paymentValidate

Validate a G/L Cash Book payment voucher without saving.

Validation only; uses CashBookCommand.AddNew + CashBook.Validate. Cash book supports one or many posting lines and one or many payment rows when AutoCount payment method setup allows it.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/payment-voucher/validate

Full JSON Payload

{
  "commandId": "validate-gl-cash-book-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-gl-cash-book-payment",
  "payload": {
    "docDate": "2026-06-24",
    "payTo": "API Supplier",
    "taxEntityID": 1,
    "description": "API payment voucher",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
payTo
optional payee name
taxEntityID
optional numeric Tax Entity Maintenance ID for the cash book header
lines
required array of GL posting rows
payments
required or optional array of payment method rows
docNo
optional voucher number; omit to let AutoCount numbering generate it
receiveFrom
optional receipt payer name
description
optional cash book narration
chequeNo
optional cheque/reference number
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-gl-cash-book-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-gl-cash-book-payment",
  "payload": {
    "docDate": "2026-06-24",
    "payTo": "API Supplier",
    "taxEntityID": 1,
    "description": "API payment voucher",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-gl-cash-book-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-gl-cash-book-receiptValidate

Validate a G/L Cash Book official receipt without saving.

Validation only; uses CashBookCommand.AddNew + CashBook.Validate. Cash book supports one or many posting lines and one or many payment rows when AutoCount payment method setup allows it.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/official-receipt/validate

Full JSON Payload

{
  "commandId": "validate-gl-cash-book-receipt-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-gl-cash-book-receipt",
  "payload": {
    "docDate": "2026-06-24",
    "receiveFrom": "API Customer",
    "taxEntityID": 1,
    "description": "API official receipt",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
receiveFrom
optional receipt payer name
taxEntityID
optional numeric Tax Entity Maintenance ID for the cash book header
lines
required array of GL posting rows
payments
required or optional array of payment method rows
docNo
optional voucher number; omit to let AutoCount numbering generate it
payTo
optional payee name
description
optional cash book narration
chequeNo
optional cheque/reference number
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-gl-cash-book-receipt-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-gl-cash-book-receipt",
  "payload": {
    "docDate": "2026-06-24",
    "receiveFrom": "API Customer",
    "taxEntityID": 1,
    "description": "API official receipt",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-gl-cash-book-receipt.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-gl-cash-book-paymentCreate

Create a G/L Cash Book payment voucher. Supports one or many account lines and payment rows.

Creates through AutoCount CashBookCommand.AddNew(CashPayment) + CashBook.Save. Cash book supports one or many posting lines and one or many payment rows when AutoCount payment method setup allows it.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/payment-voucher/create

Full JSON Payload

{
  "commandId": "create-gl-cash-book-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-cash-book-payment",
  "payload": {
    "docDate": "2026-06-24",
    "payTo": "API Supplier",
    "taxEntityID": 1,
    "description": "API payment voucher",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
payTo
optional payee name
taxEntityID
optional numeric Tax Entity Maintenance ID for the cash book header
lines
required array of GL posting rows
payments
required or optional array of payment method rows
docNo
optional voucher number; omit to let AutoCount numbering generate it
receiveFrom
optional receipt payer name
description
optional cash book narration
chequeNo
optional cheque/reference number
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-gl-cash-book-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-cash-book-payment",
  "payload": {
    "docDate": "2026-06-24",
    "payTo": "API Supplier",
    "taxEntityID": 1,
    "description": "API payment voucher",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-gl-cash-book-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-gl-cash-book-receiptCreate

Create a G/L Cash Book official receipt. Supports one or many account lines and payment rows.

Creates through AutoCount CashBookCommand.AddNew(CashReceipt) + CashBook.Save. Cash book supports one or many posting lines and one or many payment rows when AutoCount payment method setup allows it.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/official-receipt/create

Full JSON Payload

{
  "commandId": "create-gl-cash-book-receipt-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-cash-book-receipt",
  "payload": {
    "docDate": "2026-06-24",
    "receiveFrom": "API Customer",
    "taxEntityID": 1,
    "description": "API official receipt",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
}

Payload Fields

docDate
required or optional YYYY-MM-DD document date
receiveFrom
optional receipt payer name
taxEntityID
optional numeric Tax Entity Maintenance ID for the cash book header
lines
required array of GL posting rows
payments
required or optional array of payment method rows
docNo
optional voucher number; omit to let AutoCount numbering generate it
payTo
optional payee name
description
optional cash book narration
chequeNo
optional cheque/reference number
userDefinedFields
optional object of AutoCount user-defined fields

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-gl-cash-book-receipt-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-cash-book-receipt",
  "payload": {
    "docDate": "2026-06-24",
    "receiveFrom": "API Customer",
    "taxEntityID": 1,
    "description": "API official receipt",
    "lines": [
      {
        "accNo": "610-0000",
        "accountNo": "610-0000",
        "description": "Expense line",
        "amount": 100,
        "taxType": "S-0",
        "taxCode": "S-0",
        "project": "PRJAPI",
        "projNo": "PRJAPI",
        "department": "HQ",
        "deptNo": "HQ",
        "classification": "022",
        "userDefinedFields": {
          "APITEST": "API-LINE"
        }
      }
    ],
    "payments": [
      {
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "paymentAmount": 100,
        "chequeNo": "PV-API-1001",
        "bankCharge": 0,
        "bankAccount": "110-0010",
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": ""
      }
    ],
    "chequeNo": "PV-API-1001",
    "userDefinedFields": {
      "APITEST": "API"
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-gl-cash-book-receipt.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gl-cash-book-entryEdit

Update G/L Cash Book header/simple fields.

Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Journal debit/credit and Cash Book posting/payment totals must balance. Reconciled rows and source-linked documents remain protected.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-book-entry/edit

Full JSON Payload

{
  "commandId": "update-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-cash-book-entry",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
}

Payload Fields

docNo
required existing document number
docKey
optional existing document key
reason
required audit reason
docDate
optional YYYY-MM-DD document date
description
optional description; null or empty clears optional text
ref
optional reference where the AutoCount document exposes it
note
optional note where the AutoCount document exposes it
journalType
optional journal type where the AutoCount document exposes it
detailMode
explicit update | append | replace | delete for detail edits
taxEntityID
optional numeric Tax Entity Maintenance ID for the cash book header
lines
optional posting/detail updates selected by dtlKey
paymentLines
optional payment detail updates selected by dtlKey
Master
optional native header scalar fields
nativeFields
optional native header container with Master
validateOnly
optional native preflight without Save
userDefinedFields
optional existing header UDF values

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-cash-book-entry",
  "payload": {
    "docNo": "EXISTING-DOC-NO",
    "reason": "Correct description",
    "description": "Updated description"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gl-cash-book-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
  • Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Editable SDK business fields only, not blanket all-field certification. Omitted fields remain unchanged; explicit null/empty clears optional text/nullable fields only. Unknown, unavailable, protected, calculated and lifecycle fields are rejected before Save. Existing rows require stable dtlKey (or an explicitly supported selector) and explicit detailMode; no implicit replacement. validateOnly:true performs native preflight without Save and returns saved:false. Successful updates need a fresh SDK reload and writeVerification.matched=true. saved:true with ok:false is a saved mismatch/verification failure, not rollback; inspect the original document before retrying. Existing allocation, payment, posting and eInvoice protections remain. Header-only edits omit detail arrays. Existing UDFs need actual SDK columns and persisted verification. See docs/document-update-fields.md. Native save acceptance covers invoice/credit-note headers in four AR/AP families and bounded Journal/Cash Book header/detail edits only. The other nine AR/AP families, including deposits, do not have native save acceptance. Generic native UDF and AR/AP financial-detail mutations remain unproven; no blanket all-fields/native certification. Journal debit/credit and Cash Book posting/payment totals must balance. Reconciled rows and source-linked documents remain protected.
void-gl-cash-book-entryVoid

Cancel/void a G/L Cash Book entry.

Uses AutoCount CashBookCommand.CancelDocument.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-book-entry/void

Full JSON Payload

{
  "commandId": "void-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-gl-cash-book-entry",
  "payload": {
    "docNo": "PV-000001",
    "reason": "cancel incorrect voucher"
  }
}

Payload Fields

docNo
required unless docKey is provided
docKey
optional numeric document key
reason
optional audit reason

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-gl-cash-book-entry",
  "payload": {
    "docNo": "PV-000001",
    "reason": "cancel incorrect voucher"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-gl-cash-book-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-gl-cash-book-entryDelete

Hard delete a G/L Cash Book entry.

Uses AutoCount CashBookCommand.Delete. Use void-gl-cash-book-entry when audit-trail cancellation is required.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-book-entry/delete

Full JSON Payload

{
  "commandId": "delete-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-gl-cash-book-entry",
  "payload": {
    "docNo": "PV-000001",
    "reason": "delete incorrect voucher"
  }
}

Payload Fields

docNo
required unless docKey is provided
docKey
optional numeric document key
reason
optional audit reason

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-gl-cash-book-entry-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-gl-cash-book-entry",
  "payload": {
    "docNo": "PV-000001",
    "reason": "delete incorrect voucher"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-gl-cash-book-entry.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-gl-cash-flow-accountsRead

List GL accounts with cash-flow category metadata.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cash-flow-account/list

Full JSON Payload

{
  "commandId": "read-gl-cash-flow-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-cash-flow-accounts",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-gl-cash-flow-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gl-cash-flow-accounts",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-gl-cash-flow-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-gl-chequesRead

List issued or received cheque entries.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/cheque/list

Full JSON Payload

{
  "commandId": "list-gl-cheques-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-cheques",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "chequeOption": "issued",
    "cancelled": "uncancelled",
    "showCashAccount": true
  }
}

Payload Fields

fromDate
YYYY-MM-DD optional
toDate
YYYY-MM-DD optional
chequeOption
issued | received
cancelled
all | cancelled | uncancelled
showCashAccount
boolean optional

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gl-cheques-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-cheques",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "chequeOption": "issued",
    "cancelled": "uncancelled",
    "showCashAccount": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gl-cheques.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-payment-methodsRead

List payment methods used by AR/AP cashbook-style documents.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/payment-method/list

Full JSON Payload

{
  "commandId": "read-payment-methods-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-payment-methods",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-payment-methods-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-payment-methods",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-payment-methods.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Bank Reconciliation

Bank reconciliation list, detail, uncleared rows, create, edit, and delete.

list-gl-bank-reconciliation-unclearedRead

List uncleared transactions for a bank/cash account.

Uses AutoCount.GL.BankRecon.BankReconCommand.InquireUnclearedData.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/uncleared-transactions/list

Full JSON Payload

{
  "commandId": "list-gl-bank-reconciliation-uncleared-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-bank-reconciliation-uncleared",
  "payload": {
    "accNo": "110-0010",
    "startDate": "2026-01-01"
  }
}

Payload Fields

accNo
required bank/cash account number
startDate
optional YYYY-MM-DD

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gl-bank-reconciliation-uncleared-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-bank-reconciliation-uncleared",
  "payload": {
    "accNo": "110-0010",
    "startDate": "2026-01-01"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gl-bank-reconciliation-uncleared.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-gl-bank-reconciliationsRead

List bank reconciliation records.

Uses AutoCount.GL.BankRecon.BankReconCommand.InquireAllMaster.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/list

Full JSON Payload

{
  "commandId": "list-gl-bank-reconciliations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-bank-reconciliations",
  "payload": {}
}

Payload Fields

No payload fields required.

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gl-bank-reconciliations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gl-bank-reconciliations",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gl-bank-reconciliations.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-gl-bank-reconciliationRead

Get one bank reconciliation with master/detail/reconciliation rows.

Uses AutoCount.GL.BankRecon.BankReconCommand.View.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/get

Full JSON Payload

{
  "commandId": "get-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30"
  }
}

Payload Fields

accNo
required bank/cash account number
reconDate
required YYYY-MM-DD bank statement/reconciliation date

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-gl-bank-reconciliation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-gl-bank-reconciliationValidate

Create a bank reconciliation draft without saving. If selectedBankTransKeys or clearedRows are supplied, the returned draft shows which rows would be ticked.

Validation only; uses BankReconCommand.AddNew and does not call Save. List uncleared rows first, then pass selectedBankTransKeys or clearedRows. The connector fails before saving if a selected row cannot be found.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/validate

Full JSON Payload

{
  "commandId": "validate-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "actualBalance": 2900,
    "selectedBankTransKeys": [
      1,
      2
    ],
    "bankStatementNo": "BS-2026-06",
    "description": "June bank reconciliation by API",
    "clearedRows": [
      {
        "bankTransKey": 1,
        "sourceType": "PV",
        "sourceKey": "1001",
        "dtlKey": "1",
        "docNo": "PV-000001",
        "lineNo": 1
      },
      {
        "bankTransKey": 2,
        "sourceType": "OR",
        "sourceKey": "1002",
        "dtlKey": "1",
        "docNo": "OR-000001",
        "lineNo": 1
      }
    ],
    "unselectedBankTransKeys": [],
    "reason": "match bank statement"
  }
}

Payload Fields

accNo
required bank/cash GL account number
reconDate
required YYYY-MM-DD bank statement/reconciliation date
actualBalance
required bank statement actual balance for create/update; optional for validate
selectedBankTransKeys
optional array of BankTransKey values from list-gl-bank-reconciliation-uncleared
clearedRows
optional detailed rows with bankTransKey/sourceType/sourceKey/dtlKey/docNo/lineNo
bankStatementNo
optional bank statement/reference number
description
optional reconciliation narration
unselectedBankTransKeys
optional rows to leave unticked when replacing selection
confirmDelete
required true only for delete-gl-bank-reconciliation
reason
optional audit/business reason for update/delete requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "actualBalance": 2900,
    "selectedBankTransKeys": [
      1,
      2
    ],
    "bankStatementNo": "BS-2026-06",
    "description": "June bank reconciliation by API",
    "clearedRows": [
      {
        "bankTransKey": 1,
        "sourceType": "PV",
        "sourceKey": "1001",
        "dtlKey": "1",
        "docNo": "PV-000001",
        "lineNo": 1
      },
      {
        "bankTransKey": 2,
        "sourceType": "OR",
        "sourceKey": "1002",
        "dtlKey": "1",
        "docNo": "OR-000001",
        "lineNo": 1
      }
    ],
    "unselectedBankTransKeys": [],
    "reason": "match bank statement"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-gl-bank-reconciliation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-gl-bank-reconciliationCreate

Create and save a bank reconciliation.

Uses AutoCount BankReconCommand.AddNew + BankRecon.Save. The connector fails before saving if any selected row is not found. List uncleared rows first, then pass selectedBankTransKeys or clearedRows. The connector fails before saving if a selected row cannot be found.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/create

Full JSON Payload

{
  "commandId": "create-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "actualBalance": 2900,
    "selectedBankTransKeys": [
      1,
      2
    ],
    "bankStatementNo": "BS-2026-06",
    "description": "June bank reconciliation by API",
    "clearedRows": [
      {
        "bankTransKey": 1,
        "sourceType": "PV",
        "sourceKey": "1001",
        "dtlKey": "1",
        "docNo": "PV-000001",
        "lineNo": 1
      },
      {
        "bankTransKey": 2,
        "sourceType": "OR",
        "sourceKey": "1002",
        "dtlKey": "1",
        "docNo": "OR-000001",
        "lineNo": 1
      }
    ],
    "unselectedBankTransKeys": [],
    "reason": "match bank statement"
  }
}

Payload Fields

accNo
required bank/cash GL account number
reconDate
required YYYY-MM-DD bank statement/reconciliation date
actualBalance
required bank statement actual balance for create/update; optional for validate
selectedBankTransKeys
optional array of BankTransKey values from list-gl-bank-reconciliation-uncleared
clearedRows
optional detailed rows with bankTransKey/sourceType/sourceKey/dtlKey/docNo/lineNo
bankStatementNo
optional bank statement/reference number
description
optional reconciliation narration
unselectedBankTransKeys
optional rows to leave unticked when replacing selection
confirmDelete
required true only for delete-gl-bank-reconciliation
reason
optional audit/business reason for update/delete requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "actualBalance": 2900,
    "selectedBankTransKeys": [
      1,
      2
    ],
    "bankStatementNo": "BS-2026-06",
    "description": "June bank reconciliation by API",
    "clearedRows": [
      {
        "bankTransKey": 1,
        "sourceType": "PV",
        "sourceKey": "1001",
        "dtlKey": "1",
        "docNo": "PV-000001",
        "lineNo": 1
      },
      {
        "bankTransKey": 2,
        "sourceType": "OR",
        "sourceKey": "1002",
        "dtlKey": "1",
        "docNo": "OR-000001",
        "lineNo": 1
      }
    ],
    "unselectedBankTransKeys": [],
    "reason": "match bank statement"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-gl-bank-reconciliation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gl-bank-reconciliationEdit

Edit and re-save an existing bank reconciliation.

Uses AutoCount BankReconCommand.Edit + BankRecon.Save. The selected row list replaces the saved tick selection. List uncleared rows first, then pass selectedBankTransKeys or clearedRows. The connector fails before saving if a selected row cannot be found.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/edit

Full JSON Payload

{
  "commandId": "update-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "actualBalance": 2900,
    "selectedBankTransKeys": [
      1,
      2
    ],
    "bankStatementNo": "BS-2026-06",
    "description": "June bank reconciliation by API",
    "clearedRows": [
      {
        "bankTransKey": 1,
        "sourceType": "PV",
        "sourceKey": "1001",
        "dtlKey": "1",
        "docNo": "PV-000001",
        "lineNo": 1
      },
      {
        "bankTransKey": 2,
        "sourceType": "OR",
        "sourceKey": "1002",
        "dtlKey": "1",
        "docNo": "OR-000001",
        "lineNo": 1
      }
    ],
    "unselectedBankTransKeys": [],
    "reason": "match bank statement"
  }
}

Payload Fields

accNo
required bank/cash GL account number
reconDate
required YYYY-MM-DD bank statement/reconciliation date
actualBalance
required bank statement actual balance for create/update; optional for validate
selectedBankTransKeys
optional array of BankTransKey values from list-gl-bank-reconciliation-uncleared
clearedRows
optional detailed rows with bankTransKey/sourceType/sourceKey/dtlKey/docNo/lineNo
bankStatementNo
optional bank statement/reference number
description
optional reconciliation narration
unselectedBankTransKeys
optional rows to leave unticked when replacing selection
confirmDelete
required true only for delete-gl-bank-reconciliation
reason
optional audit/business reason for update/delete requests

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "actualBalance": 2900,
    "selectedBankTransKeys": [
      1,
      2
    ],
    "bankStatementNo": "BS-2026-06",
    "description": "June bank reconciliation by API",
    "clearedRows": [
      {
        "bankTransKey": 1,
        "sourceType": "PV",
        "sourceKey": "1001",
        "dtlKey": "1",
        "docNo": "PV-000001",
        "lineNo": 1
      },
      {
        "bankTransKey": 2,
        "sourceType": "OR",
        "sourceKey": "1002",
        "dtlKey": "1",
        "docNo": "OR-000001",
        "lineNo": 1
      }
    ],
    "unselectedBankTransKeys": [],
    "reason": "match bank statement"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gl-bank-reconciliation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-gl-bank-reconciliationVoid

Guarded bank reconciliation void request.

Returns voidBlocked; no safe Bank Recon void path has been proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/void

Full JSON Payload

{
  "commandId": "void-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "reason": "reverse reconciliation"
  }
}

Payload Fields

accNo
required
reconDate
required YYYY-MM-DD
reason
required

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "reason": "reverse reconciliation"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-gl-bank-reconciliation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-gl-bank-reconciliationDelete

Delete a bank reconciliation.

Uses AutoCount BankReconCommand.Delete. confirmDelete=true is required.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/bank-reconciliation/delete

Full JSON Payload

{
  "commandId": "delete-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "confirmDelete": true
  }
}

Payload Fields

accNo
required
reconDate
required YYYY-MM-DD
confirmDelete
required true

Full Transaction Field Reference

header

docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path
journalType
journal type
refNo
reference number
payTo
payment payee
receiveFrom
receipt payer
chequeNo
cheque/reference number
accNo
bank/cash account for bank reconciliation
reconDate
bank reconciliation date

lines

accountNo
GL posting account
accNo
GL posting account alias
glAccount
GL posting account alias
description
line narration
amount
line amount
debit
journal debit amount
credit
journal credit amount
taxType
tax type/code alias
taxCode
tax code alias
taxAmount
tax amount
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-gl-bank-reconciliation-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-gl-bank-reconciliation",
  "payload": {
    "accNo": "110-0010",
    "reconDate": "2026-06-30",
    "confirmDelete": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-gl-bank-reconciliation.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Reports

AutoCount report templates, statement data, statement HTML, sales/purchase/stock/AR/AP/GL PDFs.

list-autocount-report-templatesPDF/Report

List AutoCount report templates available in this account book.

Use this first when a human wants to choose the same report layout they see in AutoCount. Then send the selected ReportName as reportName to the PDF/report command. Lists report templates from AutoCount DefaultReport and Report tables. Pick a ReportName from the result and pass it as reportName to AutoCount PDF/report commands.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/reports/reports/list

Full JSON Payload

{
  "commandId": "list-autocount-report-templates-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-autocount-report-templates",
  "payload": {
    "document": "statement",
    "maxRows": 200
  }
}

Payload Fields

document
optional friendly document/module filter such as statement, sales-invoice, purchase-invoice, stock-adjustment, ar-payment, payment-voucher, journal-entry
reportType
optional exact AutoCount ReportType value when known
reportTypeLike
optional partial AutoCount ReportType search text, for example Statement
maxRows
optional maximum rows to return; default 500

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-autocount-report-templates-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-autocount-report-templates",
  "payload": {
    "document": "statement",
    "maxRows": 200
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-autocount-report-templates.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
diagnose-sales-document-pdfPDF/Report

Diagnose sales document PDF export without creating a PDF.

Read-only. Loads the same AutoCount report data source and returns dataSourceLoadMs, reportDataTables, sourceDocumentCounts, and timeoutPropertiesApplied. Use this when PDF export times out, especially invoices transferred from multiple Delivery Orders.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/reports/pdf

Full JSON Payload

{
  "commandId": "diagnose-sales-document-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "diagnose-sales-document-pdf",
  "payload": {
    "document": "invoice",
    "docNo": "IV-000001"
  }
}

Payload Fields

document
invoice | sales-order | delivery-order | cash-sale | quotation | advanced-quotation | sales-credit-note | sales-debit-note
docNo
required
reportTimeoutSeconds
optional requested timeout metadata

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "diagnose-sales-document-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "diagnose-sales-document-pdf",
  "payload": {
    "document": "invoice",
    "docNo": "IV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to diagnose-sales-document-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
sales-document-autocount-pdfPDF/Report

Generate an AutoCount-looking sales document PDF/report.

Connector 2026.09.11.01 updates native PrintCount after verified PDF generation; Sales/Purchase Edit permission is required. Returns printCountBefore, printCountAfter and printCountVerified. Invoice and purchase invoice tested; other templates require site verification. Retry with the SAME commandId; interrupted output requires manual reconciliation, not a fresh ID. GL/AR/AP/Stock/statement report counting is unchanged.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/reports/pdf

Full JSON Payload

{
  "commandId": "sales-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "sales-document-autocount-pdf",
  "payload": {
    "document": "invoice",
    "docNo": "IV-000001",
    "reportName": "Invoice"
  }
}

Payload Fields

document
invoice | sales-order | delivery-order | cash-sale | quotation | advanced-quotation | sales-credit-note | sales-debit-note
docNo
required
reportName
optional exact AutoCount report template; use list-autocount-report-templates to discover names
reportTimeoutSeconds
optional requested timeout metadata; AutoCount may still use an internal SQL timeout if the DLL exposes no timeout property
out
optional local output path

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "sales-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "sales-document-autocount-pdf",
  "payload": {
    "document": "invoice",
    "docNo": "IV-000001",
    "reportName": "Invoice"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to sales-document-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
sales-invoice-autocount-pdfPDF/Report

Legacy sales invoice PDF/export command. Prefer sales-document-autocount-pdf for new integrations.

Compatibility command kept for older integrations. Connector 2026.09.11.01 updates native PrintCount after verified PDF generation; Sales/Purchase Edit permission is required. Returns printCountBefore, printCountAfter and printCountVerified. Invoice and purchase invoice tested; other templates require site verification. Retry with the SAME commandId; interrupted output requires manual reconciliation, not a fresh ID. GL/AR/AP/Stock/statement report counting is unchanged.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/pdf

Full JSON Payload

{
  "commandId": "sales-invoice-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "sales-invoice-autocount-pdf",
  "payload": {
    "docNo": "IV-000001"
  }
}

Payload Fields

docNo
required sales invoice document number
out
optional local connector output path

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "sales-invoice-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "sales-invoice-autocount-pdf",
  "payload": {
    "docNo": "IV-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to sales-invoice-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
sales-report-htmlPDF/Report

Generate readable sales report HTML.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/reports/report

Full JSON Payload

{
  "commandId": "sales-report-html-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "sales-report-html",
  "payload": {
    "document": "invoice"
  }
}

Payload Fields

document
invoice | cash-sale | sales-order | quotation
out
optional local output path

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "sales-report-html-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "sales-report-html",
  "payload": {
    "document": "invoice"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to sales-report-html.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
purchase-document-autocount-pdfPDF/Report

Generate an AutoCount-looking purchase document PDF/report.

Uses AutoCount purchase report templates for PO, GRN, purchase invoice, purchase return, and cash purchase. Connector 2026.09.11.01 updates native PrintCount after verified PDF generation; Sales/Purchase Edit permission is required. Returns printCountBefore, printCountAfter and printCountVerified. Invoice and purchase invoice tested; other templates require site verification. Retry with the SAME commandId; interrupted output requires manual reconciliation, not a fresh ID. GL/AR/AP/Stock/statement report counting is unchanged.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/reports/pdf

Full JSON Payload

{
  "commandId": "purchase-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "purchase-document-autocount-pdf",
  "payload": {
    "document": "purchase-invoice",
    "docNo": "PI-000001",
    "reportName": "Purchase Invoice"
  }
}

Payload Fields

document
purchase-order | goods-received-note | purchase-invoice | purchase-return | cash-purchase
docNo
required
reportName
optional AutoCount report template
out
optional local connector output path

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "purchase-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "purchase-document-autocount-pdf",
  "payload": {
    "document": "purchase-invoice",
    "docNo": "PI-000001",
    "reportName": "Purchase Invoice"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to purchase-document-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
stock-document-autocount-pdfPDF/Report

Generate an AutoCount-looking stock document PDF/report.

Uses AutoCount stock and manufacturing stock report templates.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/reports/pdf

Full JSON Payload

{
  "commandId": "stock-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "stock-document-autocount-pdf",
  "payload": {
    "document": "stock-adjustment",
    "docNo": "SA-000001",
    "reportName": "Stock Adjustment"
  }
}

Payload Fields

document
stock-adjustment | stock-receive | stock-issue | stock-transfer | stock-uom-conversion | stock-take | stock-write-off | stock-update-cost | stock-assembly | stock-assembly-order | stock-disassembly
docNo
required
reportName
optional AutoCount report template
out
optional local connector output path

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "stock-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "stock-document-autocount-pdf",
  "payload": {
    "document": "stock-adjustment",
    "docNo": "SA-000001",
    "reportName": "Stock Adjustment"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to stock-document-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
arap-statement-autocount-pdfPDF/Report

Generate official AutoCount debtor or creditor statement PDF.

Supported for debtor and creditor statements. Uses AutoCount statement report templates and returns a downloadable PDF artifact. Requires local-mvp-2026.09.28.04 or later installed on the selected connector; publishing the download does not install it. Statement options align with the JSON inquiry. Generate an official AutoCount debtor or creditor statement PDF using an available compatible native template; schema availability does not prove account-book acceptance. Download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same tenant key. No email, physical printing or standalone aging export is implied.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/arap-module/reports/pdf

Full JSON Payload

{
  "commandId": "arap-statement-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "arap-statement-autocount-pdf",
  "payload": {
    "document": "debtor-statement",
    "debtorCode": "300-A001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "reportName": "Debtor Statement - 12 Months"
  }
}

Payload Fields

document
debtor-statement | creditor-statement
debtorCode
optional when document is debtor-statement
creditorCode
optional when document is creditor-statement
fromDate
optional YYYY-MM-DD start date
toDate
optional YYYY-MM-DD end date
reportName
optional exact AutoCount statement template, for example Debtor Statement - 12 Months or Creditor Statement - 6 Months
out
optional local connector output path ending with .pdf
statementType
optional DebtorDefault/CreditorDefault | OpenItemOnly | BalanceBF
zeroBalanceMethod
optional Exclude | Include | IncludeWithActiveTransactionOnly
showPaidTransaction
optional boolean; default true
showGroupCompany
optional boolean; default true
showSubCompany
optional boolean; default true
showInLocalCurrency
optional boolean; default false
includeZeroAmountTransaction
optional boolean; default true
normalStatement
optional boolean; default true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "arap-statement-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "arap-statement-autocount-pdf",
  "payload": {
    "document": "debtor-statement",
    "debtorCode": "300-A001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "reportName": "Debtor Statement - 12 Months"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to arap-statement-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
creditor-statement-reportPDF/Report

Read AutoCount creditor statement data.

Uses AutoCount CreditorStatement.Inquire and returns the real statement DataSet tables. This is data output, not a PDF. Requires local-mvp-2026.09.28.04 or later installed on the selected connector; publishing the download does not install it. native statement inquiry adds tables[].data with per-table columns, rows, returnedRows and truncated, preserving legacy top-level data. maxRows limits each table; an artifact cannot recover rows omitted by that limit. Large service results use result-json-gzip artifacts (.json.gz, application/octet-stream): download with the same tenant key and decompress locally before parsing. Direct JSON results may instead have bounded previews and a full JSON artifact. Native permissions/templates and account-book acceptance remain separate from schema availability.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/report

Full JSON Payload

{
  "commandId": "creditor-statement-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "creditor-statement-report",
  "payload": {
    "creditorCode": "400-S001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "statementType": "CreditorDefault",
    "zeroBalanceMethod": "IncludeWithActiveTransactionOnly",
    "showPaidTransaction": true
  }
}

Payload Fields

creditorCode
optional supplier account code; omit to include all creditors
fromDate
optional YYYY-MM-DD start date
toDate
optional YYYY-MM-DD end date; default today
statementType
optional CreditorDefault | OpenItemOnly | BalanceBF
zeroBalanceMethod
optional Exclude | Include | IncludeWithActiveTransactionOnly
showPaidTransaction
optional boolean; default true
showGroupCompany
optional boolean; default true
showSubCompany
optional boolean; default true
showInLocalCurrency
optional boolean; default false
includeZeroAmountTransaction
optional boolean; default true
normalStatement
optional boolean; default true
maxRows
optional integer rows per table; default -1 for all rows, 0 for metadata only

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "creditor-statement-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "creditor-statement-report",
  "payload": {
    "creditorCode": "400-S001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "statementType": "CreditorDefault",
    "zeroBalanceMethod": "IncludeWithActiveTransactionOnly",
    "showPaidTransaction": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to creditor-statement-report.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
debtor-statement-reportPDF/Report

Read AutoCount debtor statement data.

Uses AutoCount DebtorStatement.Inquire and returns the real statement DataSet tables. This is data output, not a PDF. Requires local-mvp-2026.09.28.04 or later installed on the selected connector; publishing the download does not install it. native statement inquiry adds tables[].data with per-table columns, rows, returnedRows and truncated, preserving legacy top-level data. maxRows limits each table; an artifact cannot recover rows omitted by that limit. Native aging headings and currencies must be retained, not inferred. Large service results use result-json-gzip artifacts (.json.gz, application/octet-stream): download with the same tenant key, decompress locally, then parse the full JSON. Direct JSON results may instead have bounded previews and a full JSON artifact. Cloud performs no gzip decompression. Use arap-statement-autocount-pdf for an official layout; schema availability is not account-book or deployment acceptance.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/report

Full JSON Payload

{
  "commandId": "debtor-statement-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "debtor-statement-report",
  "payload": {
    "debtorCode": "300-A001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "statementType": "DebtorDefault",
    "zeroBalanceMethod": "IncludeWithActiveTransactionOnly",
    "showPaidTransaction": true
  }
}

Payload Fields

debtorCode
optional debtor/customer account code; omit to include all debtors
fromDate
optional YYYY-MM-DD start date
toDate
optional YYYY-MM-DD end date; default today
statementType
optional DebtorDefault | OpenItemOnly | BalanceBF
zeroBalanceMethod
optional Exclude | Include | IncludeWithActiveTransactionOnly
showPaidTransaction
optional boolean; default true
showGroupCompany
optional boolean; default true
showSubCompany
optional boolean; default true
showInLocalCurrency
optional boolean; default false
includeZeroAmountTransaction
optional boolean; default true
normalStatement
optional boolean; default true
maxRows
optional integer rows per table; default -1 for all rows, 0 for metadata only

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "debtor-statement-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "debtor-statement-report",
  "payload": {
    "debtorCode": "300-A001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "statementType": "DebtorDefault",
    "zeroBalanceMethod": "IncludeWithActiveTransactionOnly",
    "showPaidTransaction": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to debtor-statement-report.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
statement-report-htmlPDF/Report

Export a human-readable debtor or creditor statement HTML report.

Statement HTML report uses real AutoCount SDK statement data. For official AutoCount PDF layout, use arap-statement-autocount-pdf. Requires local-mvp-2026.09.28.04 or later installed on the selected connector; publishing the download does not install it. HTML groups single/all-account statements by native account ownership and currency, with per-account totals and aging headings. Ambiguous ownership, mixed currencies and local-currency rendering are rejected; use native PDF or JSON for local-currency data. maxRows applies per account and displayed totals include all its rows. out is a connector-local path, not a public URL; this schema does not promise an HTML artifact. Use arap-statement-autocount-pdf for an official layout.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/reports/reports/report

Full JSON Payload

{
  "commandId": "statement-report-html-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "statement-report-html",
  "payload": {
    "document": "debtor-statement",
    "debtorCode": "300-A001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "maxRows": 2000
  }
}

Payload Fields

document
debtor-statement | creditor-statement
debtorCode
optional debtor/customer account code when document is debtor-statement; omit to include all
creditorCode
optional supplier account code when document is creditor-statement; omit to include all
fromDate
optional YYYY-MM-DD start date
toDate
optional YYYY-MM-DD end date; default today
maxRows
optional integer transaction rows rendered per account; default 2000, -1 or 0 for all rows (legacy HTML behavior)
out
optional local connector output path ending with .html
statementType
optional DebtorDefault/CreditorDefault | OpenItemOnly | BalanceBF
zeroBalanceMethod
optional Exclude | Include | IncludeWithActiveTransactionOnly
showPaidTransaction
optional boolean; default true
showGroupCompany
optional boolean; default true
showSubCompany
optional boolean; default true
showInLocalCurrency
optional boolean; must remain false for the current HTML renderer
includeZeroAmountTransaction
optional boolean; default true
normalStatement
optional boolean; default true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "statement-report-html-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "statement-report-html",
  "payload": {
    "document": "debtor-statement",
    "debtorCode": "300-A001",
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "maxRows": 2000
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to statement-report-html.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
arap-document-autocount-pdfPDF/Report

Generate AutoCount PDFs for AR/AP invoice, payment, deposit, refund, credit note, debit note, and contra.

Uses AutoCount report templates. Invoice/payment/deposit/refund use single-document listing data sources; credit/debit note and contra use document data sources.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/arap-module/reports/pdf

Full JSON Payload

{
  "commandId": "arap-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "arap-document-autocount-pdf",
  "payload": {
    "document": "ar-payment",
    "docNo": "OR-000001"
  }
}

Payload Fields

document
ar-invoice | ap-invoice | ar-payment | ap-payment | ar-deposit | ap-deposit | ar-refund | ap-refund | ar-credit-note | ap-credit-note | ar-debit-note | ap-debit-note | arap-contra
docNo
required unless docKey is supplied
docKey
optional numeric document key
reportName
optional AutoCount report template
out
optional local connector output path

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "arap-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "arap-document-autocount-pdf",
  "payload": {
    "document": "ar-payment",
    "docNo": "OR-000001"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to arap-document-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
debtor-aging-autocount-pdfPDF/Report

Generate a native debtor aging PDF at a cutoff date.

Requires local-mvp-2026.09.28.04 or later installed on the selected connector; publishing the download does not install it. native DebtorAging.Inquire with native report data. asOfDate is a cutoff, not a fromDate/toDate range; fromDate/startDate and conflicting aliases are rejected. No user-defined exchange rates. Bucket labels come from Report Option AgingWord0..23 and the account-book AgingFormat2, never assumed 30-day periods. Native implementation/template availability and account-book acceptance are separate from schema discovery. Exports an installed compatible Debtor Aging template; use result.artifactUrl with the same tenant key. A statement PDF is not a standalone aging report.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/pdf

Full JSON Payload

{
  "commandId": "debtor-aging-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "debtor-aging-autocount-pdf",
  "payload": {
    "asOfDate": "2026-09-30",
    "debtorCode": "300-A001",
    "currencyMode": "AccountCurrency",
    "withDetails": true
  }
}

Payload Fields

asOfDate
optional YYYY-MM-DD cutoff date; default connector today; aliases reportDate/toDate, not a date range
debtorCode
optional single debtor code; omit for all debtors; explicit blank is rejected
currencyMode
optional AccountCurrency | LocalCurrencyByDocument; default AccountCurrency
includeZeroBalance
optional boolean; default false
includeFutureDoc
optional boolean; default false
showGroupCompany
optional boolean; default false
showSubCompany
optional boolean; default false
withDetails
optional boolean; default true
withPDCheque
optional boolean; default false
withSalesAnalysis
optional boolean; default false
reportName
optional exact installed Debtor Aging report template; discover with list-autocount-report-templates
out
optional local connector PDF path; omit for cloud use

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "debtor-aging-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "debtor-aging-autocount-pdf",
  "payload": {
    "asOfDate": "2026-09-30",
    "debtorCode": "300-A001",
    "currencyMode": "AccountCurrency",
    "withDetails": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to debtor-aging-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
gl-document-autocount-pdfPDF/Report

Generate AutoCount-looking GL cash book voucher and journal voucher PDFs.

payment-voucher, official-receipt, and journal-entry are supported with AutoCount report templates.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/reports/pdf

Full JSON Payload

{
  "commandId": "gl-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "gl-document-autocount-pdf",
  "payload": {
    "document": "payment-voucher",
    "docNo": "PV-000001",
    "reportName": "PV - Half Page"
  }
}

Payload Fields

document
payment-voucher | official-receipt | cash-book | journal-entry
docNo
required unless docKey is supplied
docKey
optional numeric document key
reportName
optional AutoCount report template
out
optional local connector output path

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "gl-document-autocount-pdf-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "gl-document-autocount-pdf",
  "payload": {
    "document": "payment-voucher",
    "docNo": "PV-000001",
    "reportName": "PV - Half Page"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to gl-document-autocount-pdf.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For PDF commands, if result.artifactAvailable is true, download result.artifactUrl or GET /v1/commands/{commandId}/artifact with the same API key before sending the file as an attachment.
  • For write commands, validate first when a validate-* command exists for the same document.
debtor-aging-reportPDF/Report

Read native debtor aging tables at a cutoff date.

Requires local-mvp-2026.09.28.04 or later installed on the selected connector; publishing the download does not install it. native DebtorAging.Inquire with native report data. asOfDate is a cutoff, not a fromDate/toDate range; fromDate/startDate and conflicting aliases are rejected. No user-defined exchange rates. Bucket labels come from Report Option AgingWord0..23 and the account-book AgingFormat2, never assumed 30-day periods. Native implementation/template availability and account-book acceptance are separate from schema discovery. Master rows remain in top-level data; tables[].data carries all serialized tables with columns and row counts. maxRows limits each table; artifacts cannot restore excluded rows. Large service results use result-json-gzip (.json.gz, application/octet-stream); download the authenticated artifact and decompress locally. Direct JSON results may use bounded previews with a full JSON artifact.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/report

Full JSON Payload

{
  "commandId": "debtor-aging-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "debtor-aging-report",
  "payload": {
    "asOfDate": "2026-09-30",
    "debtorCode": "300-A001",
    "currencyMode": "AccountCurrency",
    "withDetails": true
  }
}

Payload Fields

asOfDate
optional YYYY-MM-DD cutoff date; default connector today; aliases reportDate/toDate, not a date range
debtorCode
optional single debtor code; omit for all debtors; explicit blank is rejected
currencyMode
optional AccountCurrency | LocalCurrencyByDocument; default AccountCurrency
includeZeroBalance
optional boolean; default false
includeFutureDoc
optional boolean; default false
showGroupCompany
optional boolean; default false
showSubCompany
optional boolean; default false
withDetails
optional boolean; default true
withPDCheque
optional boolean; default false
withSalesAnalysis
optional boolean; default false
maxRows
optional integer rows per table; default -1 for all rows, 0 for metadata only

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "debtor-aging-report-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "debtor-aging-report",
  "payload": {
    "asOfDate": "2026-09-30",
    "debtorCode": "300-A001",
    "currencyMode": "AccountCurrency",
    "withDetails": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to debtor-aging-report.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Master Data

Debtor, creditor, item, item package, item BOM, and safe General Maintenance setup tables.

create-debtorCreate

Create a debtor/customer.

Creates customer master data through AutoCount SDK. Normal fields map to debtor properties; top-level delivery fields are normalized into BranchTable and top-level contact fields are normalized into ContactTable when explicit arrays are not supplied. This is the full human payload reference for Debtor Maintenance. The connector writes normal fields through AutoCount DLL properties and writes branches/contacts through AutoCount DLL child DataTables, then reloads the debtor and returns writeVerification.notMapped, writeVerification.notPersisted, and writeVerification.childRows when AutoCount does not expose or persist a requested value. If top-level deliveryAddress fields are supplied without branches, the connector creates/updates an AutoCount BranchTable row using branchCode or HQ. If top-level contactPerson/contactName/contact fields are supplied without contacts, the connector creates/updates an AutoCount ContactTable row.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/create

Full JSON Payload

{
  "commandId": "create-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-debtor",
  "payload": {
    "accNo": "300-API",
    "companyName": "API Customer Sdn Bhd",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "postCode": "50000",
    "contactPerson": "Lim Accounts",
    "deliveryAddress1": "Warehouse 1",
    "deliveryAddress2": "Industrial Park",
    "deliveryPostCode": "40100",
    "deliveryContact": "Store Receiver",
    "phone1": "03-11111111",
    "phone2": "012-3456789",
    "emailAddress": "customer@example.com",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Customer Trading Name",
    "debtorType": "CUS",
    "area": "KL",
    "salesAgent": "SA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "priceCategory": "API",
    "creditLimit": 50000,
    "overdueLimit": 30,
    "statementType": "Open Item",
    "allowExceedCreditLimit": false,
    "attention": "Accounts Department",
    "fax1": "03-11111112",
    "website": "https://customer.example.com",
    "registrationNo": "202601000001",
    "taxRegisterNo": "SST-300-API",
    "businessNature": "Trading",
    "remark1": "Created by API",
    "remark2": "Credit control example",
    "deliveryAddress3": "Shah Alam",
    "deliveryAddress4": "Malaysia",
    "contacts": [
      {
        "name": "Lim Accounts",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "012-1111111",
        "directPhone": "03-11111113",
        "emailAddress": "accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "postCode": "50000",
        "contact": "Lim Accounts",
        "phone1": "03-11111111",
        "emailAddress": "hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
}

Payload Fields

accNo
required debtor/customer account code
companyName
required customer company/name
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
postCode
optional billing postcode; connector tries AutoCount postcode/postal code SDK aliases and verifies read-back
contactPerson
optional contact person; also creates/updates an AutoCount ContactTable row when contacts array is not supplied
deliveryAddress1
optional delivery address line 1
deliveryAddress2
optional delivery address line 2
deliveryAddress3
optional delivery address line 3
deliveryAddress4
optional delivery address line 4
deliveryPostCode
optional delivery postcode for the default delivery branch row
deliveryContact
optional delivery contact for the default delivery branch row
contacts
optional array of contact persons written through AutoCount DLL ContactTable; supports name/contactName, department, title/designation, mobilePhone/mobile/phone, directPhone, directFax, emailAddress/email, imAddress, note, openingBonusPoint, includeInContactInfo
branches
optional array of debtor branch records written through AutoCount DLL BranchTable; supports branchCode/code, branchName/name, address1-4, postCode, contact/attention, phone1/2, fax1/2, areaCode, salesAgent, purchaseAgent, emailAddress/email, mobile, taxEntityID, isActive
phone1
optional primary phone
phone2
optional secondary phone
emailAddress
optional email address
currencyCode
optional currency code such as MYR
taxCode
optional tax code/type
taxEntityID
optional Tax Entity Maintenance numeric ID to link this debtor to e-Invoice/tax entity details
controlAccount
optional book-specific debtor control account; connector local-mvp-2026.10.06.02+ preserves existing value on update, uses SDK default or unique SDC account on create, and rejects ambiguity; older builds must send the correct explicit controlAccount; never assume a universal account number
isActive
optional boolean active flag
desc2
optional second name/description
debtorType
optional Debtor Type Maintenance code
area
optional Area Maintenance code
salesAgent
optional Sales Agent Maintenance code
branchCode
optional branch code for multi-branch/customer branch usage
displayTerm
optional Credit Term Maintenance value such as C.O.D. or 30 DAYS
priceCategory
optional Price Category Maintenance code
creditLimit
optional credit limit amount
overdueLimit
optional overdue limit amount or days depending on AutoCount setup
statementType
optional statement type if the account book uses it
allowExceedCreditLimit
optional boolean if AutoCount/account-book policy exposes it
attention
optional contact attention person
fax1
optional fax
website
optional website
registrationNo
optional company registration number
taxRegisterNo
optional SST/tax registration number
businessNature
optional business nature
remark1
optional remark field 1
remark2
optional remark field 2

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-debtor",
  "payload": {
    "accNo": "300-API",
    "companyName": "API Customer Sdn Bhd",
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "postCode": "50000",
    "contactPerson": "Lim Accounts",
    "deliveryAddress1": "Warehouse 1",
    "deliveryAddress2": "Industrial Park",
    "deliveryPostCode": "40100",
    "deliveryContact": "Store Receiver",
    "phone1": "03-11111111",
    "phone2": "012-3456789",
    "emailAddress": "customer@example.com",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Customer Trading Name",
    "debtorType": "CUS",
    "area": "KL",
    "salesAgent": "SA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "priceCategory": "API",
    "creditLimit": 50000,
    "overdueLimit": 30,
    "statementType": "Open Item",
    "allowExceedCreditLimit": false,
    "attention": "Accounts Department",
    "fax1": "03-11111112",
    "website": "https://customer.example.com",
    "registrationNo": "202601000001",
    "taxRegisterNo": "SST-300-API",
    "businessNature": "Trading",
    "remark1": "Created by API",
    "remark2": "Credit control example",
    "deliveryAddress3": "Shah Alam",
    "deliveryAddress4": "Malaysia",
    "contacts": [
      {
        "name": "Lim Accounts",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "012-1111111",
        "directPhone": "03-11111113",
        "emailAddress": "accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "postCode": "50000",
        "contact": "Lim Accounts",
        "phone1": "03-11111111",
        "emailAddress": "hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-debtor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-debtorEdit

Update a debtor/customer.

Updates debtor/customer master data through AutoCount SDK using the same supported fields as create-debtor. This is the full human payload reference for Debtor Maintenance. The connector writes normal fields through AutoCount DLL properties and writes branches/contacts through AutoCount DLL child DataTables, then reloads the debtor and returns writeVerification.notMapped, writeVerification.notPersisted, and writeVerification.childRows when AutoCount does not expose or persist a requested value. If top-level deliveryAddress fields are supplied without branches, the connector creates/updates an AutoCount BranchTable row using branchCode or HQ. If top-level contactPerson/contactName/contact fields are supplied without contacts, the connector creates/updates an AutoCount ContactTable row.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/edit

Full JSON Payload

{
  "commandId": "update-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-debtor",
  "payload": {
    "accNo": "300-API",
    "companyName": "API Customer Sdn Bhd Updated",
    "contactPerson": "Lim Accounts",
    "deliveryAddress1": "Warehouse 1",
    "phone1": "03-11111111",
    "emailAddress": "customer@example.com",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Customer Trading Name",
    "debtorType": "CUS",
    "area": "KL",
    "salesAgent": "SA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "priceCategory": "API",
    "creditLimit": 50000,
    "overdueLimit": 30,
    "statementType": "Open Item",
    "allowExceedCreditLimit": false,
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "postCode": "50000",
    "attention": "Accounts Department",
    "phone2": "012-3456789",
    "fax1": "03-11111112",
    "website": "https://customer.example.com",
    "registrationNo": "202601000001",
    "taxRegisterNo": "SST-300-API",
    "businessNature": "Trading",
    "remark1": "Created by API",
    "remark2": "Credit control example",
    "deliveryAddress2": "Industrial Park",
    "deliveryAddress3": "Shah Alam",
    "deliveryAddress4": "Malaysia",
    "deliveryPostCode": "40100",
    "deliveryContact": "Store Receiver",
    "contacts": [
      {
        "name": "Lim Accounts",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "012-1111111",
        "directPhone": "03-11111113",
        "emailAddress": "accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "postCode": "50000",
        "contact": "Lim Accounts",
        "phone1": "03-11111111",
        "emailAddress": "hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
}

Payload Fields

accNo
required debtor/customer account code
companyName
required customer company/name
address1
optional billing address line 1
address2
optional billing address line 2
address3
optional billing address line 3
address4
optional billing address line 4
postCode
optional billing postcode; connector tries AutoCount postcode/postal code SDK aliases and verifies read-back
contactPerson
optional contact person; also creates/updates an AutoCount ContactTable row when contacts array is not supplied
deliveryAddress1
optional delivery address line 1
deliveryAddress2
optional delivery address line 2
deliveryAddress3
optional delivery address line 3
deliveryAddress4
optional delivery address line 4
deliveryPostCode
optional delivery postcode for the default delivery branch row
deliveryContact
optional delivery contact for the default delivery branch row
contacts
optional array of contact persons written through AutoCount DLL ContactTable; supports name/contactName, department, title/designation, mobilePhone/mobile/phone, directPhone, directFax, emailAddress/email, imAddress, note, openingBonusPoint, includeInContactInfo
branches
optional array of debtor branch records written through AutoCount DLL BranchTable; supports branchCode/code, branchName/name, address1-4, postCode, contact/attention, phone1/2, fax1/2, areaCode, salesAgent, purchaseAgent, emailAddress/email, mobile, taxEntityID, isActive
phone1
optional primary phone
phone2
optional secondary phone
emailAddress
optional email address
currencyCode
optional currency code such as MYR
taxCode
optional tax code/type
taxEntityID
optional Tax Entity Maintenance numeric ID to link this debtor to e-Invoice/tax entity details
controlAccount
optional book-specific debtor control account; connector local-mvp-2026.10.06.02+ preserves existing value on update, uses SDK default or unique SDC account on create, and rejects ambiguity; older builds must send the correct explicit controlAccount; never assume a universal account number
isActive
optional boolean active flag
desc2
optional second name/description
debtorType
optional Debtor Type Maintenance code
area
optional Area Maintenance code
salesAgent
optional Sales Agent Maintenance code
branchCode
optional branch code for multi-branch/customer branch usage
displayTerm
optional Credit Term Maintenance value such as C.O.D. or 30 DAYS
priceCategory
optional Price Category Maintenance code
creditLimit
optional credit limit amount
overdueLimit
optional overdue limit amount or days depending on AutoCount setup
statementType
optional statement type if the account book uses it
allowExceedCreditLimit
optional boolean if AutoCount/account-book policy exposes it
attention
optional contact attention person
fax1
optional fax
website
optional website
registrationNo
optional company registration number
taxRegisterNo
optional SST/tax registration number
businessNature
optional business nature
remark1
optional remark field 1
remark2
optional remark field 2

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-debtor",
  "payload": {
    "accNo": "300-API",
    "companyName": "API Customer Sdn Bhd Updated",
    "contactPerson": "Lim Accounts",
    "deliveryAddress1": "Warehouse 1",
    "phone1": "03-11111111",
    "emailAddress": "customer@example.com",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Customer Trading Name",
    "debtorType": "CUS",
    "area": "KL",
    "salesAgent": "SA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "priceCategory": "API",
    "creditLimit": 50000,
    "overdueLimit": 30,
    "statementType": "Open Item",
    "allowExceedCreditLimit": false,
    "address1": "No. 1 Jalan API",
    "address2": "Taman Integration",
    "address3": "Kuala Lumpur",
    "address4": "Malaysia",
    "postCode": "50000",
    "attention": "Accounts Department",
    "phone2": "012-3456789",
    "fax1": "03-11111112",
    "website": "https://customer.example.com",
    "registrationNo": "202601000001",
    "taxRegisterNo": "SST-300-API",
    "businessNature": "Trading",
    "remark1": "Created by API",
    "remark2": "Credit control example",
    "deliveryAddress2": "Industrial Park",
    "deliveryAddress3": "Shah Alam",
    "deliveryAddress4": "Malaysia",
    "deliveryPostCode": "40100",
    "deliveryContact": "Store Receiver",
    "contacts": [
      {
        "name": "Lim Accounts",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "012-1111111",
        "directPhone": "03-11111113",
        "emailAddress": "accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "postCode": "50000",
        "contact": "Lim Accounts",
        "phone1": "03-11111111",
        "emailAddress": "hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-debtor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-debtorVoid

Guarded void request for a debtor/customer.

Returns voidBlocked. Prefer inactive/discontinued flags because master records may already be linked to transactions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/void

Full JSON Payload

{
  "commandId": "void-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-debtor",
  "payload": {
    "accNo": "300-A001",
    "reason": "void inactive duplicate"
  }
}

Payload Fields

accNo
required
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-debtor",
  "payload": {
    "accNo": "300-A001",
    "reason": "void inactive duplicate"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-debtor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-debtorDelete

Guarded delete request for a debtor/customer.

Returns deleteBlocked until AutoCount SDK delete safety and linked-transaction checks are proven. Prefer inactive/discontinued flags.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/delete

Full JSON Payload

{
  "commandId": "delete-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-debtor",
  "payload": {
    "accNo": "300-A001",
    "reason": "remove inactive duplicate"
  }
}

Payload Fields

accNo
required
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-debtor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-debtor",
  "payload": {
    "accNo": "300-A001",
    "reason": "remove inactive duplicate"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-debtor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-creditorCreate

Create a creditor/supplier.

Creates supplier master data through AutoCount SDK. Normal fields map to creditor properties; top-level delivery fields are normalized into BranchTable and top-level contact fields are normalized into ContactTable when explicit arrays are not supplied. This is the full human payload reference for Creditor Maintenance. The connector writes normal fields through AutoCount DLL properties and writes branches/contacts through AutoCount DLL child DataTables, then reloads the creditor and returns writeVerification.notMapped, writeVerification.notPersisted, and writeVerification.childRows when AutoCount does not expose or persist a requested value. If top-level deliveryAddress fields are supplied without branches, the connector creates/updates an AutoCount BranchTable row using branchCode or HQ. If top-level contactPerson/contactName/contact fields are supplied without contacts, the connector creates/updates an AutoCount ContactTable row.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/create

Full JSON Payload

{
  "commandId": "create-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-creditor",
  "payload": {
    "accNo": "400-API",
    "companyName": "API Supplier Sdn Bhd",
    "address1": "No. 2 Jalan API",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "postCode": "46000",
    "contactPerson": "Tan Supplier",
    "deliveryAddress1": "Supplier Warehouse",
    "deliveryPostCode": "46000",
    "phone1": "03-33333333",
    "phone2": "019-8888888",
    "emailAddress": "supplier@example.com",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Supplier Trading Name",
    "creditorType": "SUP",
    "area": "PJ",
    "purchaseAgent": "PA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "creditLimit": 30000,
    "overdueLimit": 30,
    "attention": "Supplier Accounts",
    "fax1": "03-33333334",
    "website": "https://supplier.example.com",
    "registrationNo": "202602000002",
    "taxRegisterNo": "SST-400-API",
    "businessNature": "Supplier",
    "remark1": "Created by API",
    "remark2": "Supplier credit control example",
    "deliveryAddress2": "Logistics Park",
    "deliveryContact": "Supplier Store",
    "contacts": [
      {
        "name": "Tan Supplier",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "019-1111111",
        "directPhone": "03-33333335",
        "emailAddress": "supplier-accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 2 Jalan API",
        "address2": "Supplier Park",
        "postCode": "46000",
        "contact": "Tan Supplier",
        "phone1": "03-33333333",
        "emailAddress": "supplier-hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
}

Payload Fields

accNo
required creditor/supplier account code
companyName
required supplier company/name
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
postCode
optional billing/postal postcode; connector tries AutoCount postcode/postal code SDK aliases and verifies read-back
contactPerson
optional contact person; also creates/updates an AutoCount ContactTable row when contacts array is not supplied
deliveryAddress1
optional branch/delivery address line 1
deliveryAddress2
optional branch/delivery address line 2
deliveryPostCode
optional branch/delivery postcode for the default branch row
deliveryContact
optional branch/delivery contact for the default branch row
contacts
optional array of contact persons written through AutoCount DLL ContactTable; supports name/contactName, department, title/designation, mobilePhone/mobile/phone, directPhone, directFax, emailAddress/email, imAddress, note, openingBonusPoint, includeInContactInfo
branches
optional array of creditor branch records written through AutoCount DLL BranchTable; supports branchCode/code, branchName/name, address1-4, postCode, contact/attention, phone1/2, fax1/2, areaCode, salesAgent, purchaseAgent, emailAddress/email, mobile, taxEntityID, isActive
phone1
optional primary phone
phone2
optional secondary phone
emailAddress
optional email address
currencyCode
optional currency code such as MYR
taxCode
optional tax code/type
taxEntityID
optional Tax Entity Maintenance numeric ID to link this creditor to e-Invoice/tax entity details
controlAccount
optional book-specific creditor control account; connector local-mvp-2026.10.06.02+ preserves existing value on update, uses SDK default or unique SCC account on create, and rejects ambiguity; older builds must send the correct explicit controlAccount; never assume a universal account number
isActive
optional boolean active flag
desc2
optional second name/description
creditorType
optional Creditor Type Maintenance code
area
optional Area Maintenance code
purchaseAgent
optional Purchase Agent Maintenance code
branchCode
optional branch code for multi-branch/supplier branch usage
displayTerm
optional Credit Term Maintenance value such as C.O.D. or 30 DAYS
creditLimit
optional supplier credit limit amount if used
overdueLimit
optional overdue limit amount or days depending on AutoCount setup
attention
optional contact attention person
fax1
optional fax
website
optional website
registrationNo
optional company registration number
taxRegisterNo
optional SST/tax registration number
businessNature
optional business nature
remark1
optional remark field 1
remark2
optional remark field 2
deliveryAddress3
optional branch/delivery address line 3
deliveryAddress4
optional branch/delivery address line 4

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-creditor",
  "payload": {
    "accNo": "400-API",
    "companyName": "API Supplier Sdn Bhd",
    "address1": "No. 2 Jalan API",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "postCode": "46000",
    "contactPerson": "Tan Supplier",
    "deliveryAddress1": "Supplier Warehouse",
    "deliveryPostCode": "46000",
    "phone1": "03-33333333",
    "phone2": "019-8888888",
    "emailAddress": "supplier@example.com",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Supplier Trading Name",
    "creditorType": "SUP",
    "area": "PJ",
    "purchaseAgent": "PA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "creditLimit": 30000,
    "overdueLimit": 30,
    "attention": "Supplier Accounts",
    "fax1": "03-33333334",
    "website": "https://supplier.example.com",
    "registrationNo": "202602000002",
    "taxRegisterNo": "SST-400-API",
    "businessNature": "Supplier",
    "remark1": "Created by API",
    "remark2": "Supplier credit control example",
    "deliveryAddress2": "Logistics Park",
    "deliveryContact": "Supplier Store",
    "contacts": [
      {
        "name": "Tan Supplier",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "019-1111111",
        "directPhone": "03-33333335",
        "emailAddress": "supplier-accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 2 Jalan API",
        "address2": "Supplier Park",
        "postCode": "46000",
        "contact": "Tan Supplier",
        "phone1": "03-33333333",
        "emailAddress": "supplier-hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-creditor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-creditorEdit

Update a creditor/supplier.

Updates supplier/creditor master data through AutoCount SDK using the same supported fields as create-creditor. This is the full human payload reference for Creditor Maintenance. The connector writes normal fields through AutoCount DLL properties and writes branches/contacts through AutoCount DLL child DataTables, then reloads the creditor and returns writeVerification.notMapped, writeVerification.notPersisted, and writeVerification.childRows when AutoCount does not expose or persist a requested value. If top-level deliveryAddress fields are supplied without branches, the connector creates/updates an AutoCount BranchTable row using branchCode or HQ. If top-level contactPerson/contactName/contact fields are supplied without contacts, the connector creates/updates an AutoCount ContactTable row.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/edit

Full JSON Payload

{
  "commandId": "update-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-creditor",
  "payload": {
    "accNo": "400-API",
    "companyName": "API Supplier Sdn Bhd Updated",
    "contactPerson": "Tan Supplier",
    "deliveryAddress1": "Supplier Warehouse",
    "phone1": "03-33333333",
    "emailAddress": "supplier@example.com",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Supplier Trading Name",
    "creditorType": "SUP",
    "area": "PJ",
    "purchaseAgent": "PA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "creditLimit": 30000,
    "overdueLimit": 30,
    "address1": "No. 2 Jalan API",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "postCode": "46000",
    "attention": "Supplier Accounts",
    "phone2": "019-8888888",
    "fax1": "03-33333334",
    "website": "https://supplier.example.com",
    "registrationNo": "202602000002",
    "taxRegisterNo": "SST-400-API",
    "businessNature": "Supplier",
    "remark1": "Created by API",
    "remark2": "Supplier credit control example",
    "deliveryAddress2": "Logistics Park",
    "deliveryPostCode": "46000",
    "deliveryContact": "Supplier Store",
    "contacts": [
      {
        "name": "Tan Supplier",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "019-1111111",
        "directPhone": "03-33333335",
        "emailAddress": "supplier-accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 2 Jalan API",
        "address2": "Supplier Park",
        "postCode": "46000",
        "contact": "Tan Supplier",
        "phone1": "03-33333333",
        "emailAddress": "supplier-hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
}

Payload Fields

accNo
required creditor/supplier account code
companyName
required supplier company/name
address1
optional supplier address line 1
address2
optional supplier address line 2
address3
optional supplier address line 3
address4
optional supplier address line 4
postCode
optional billing/postal postcode; connector tries AutoCount postcode/postal code SDK aliases and verifies read-back
contactPerson
optional contact person; also creates/updates an AutoCount ContactTable row when contacts array is not supplied
deliveryAddress1
optional branch/delivery address line 1
contacts
optional array of contact persons written through AutoCount DLL ContactTable; supports name/contactName, department, title/designation, mobilePhone/mobile/phone, directPhone, directFax, emailAddress/email, imAddress, note, openingBonusPoint, includeInContactInfo
branches
optional array of creditor branch records written through AutoCount DLL BranchTable; supports branchCode/code, branchName/name, address1-4, postCode, contact/attention, phone1/2, fax1/2, areaCode, salesAgent, purchaseAgent, emailAddress/email, mobile, taxEntityID, isActive
phone1
optional primary phone
phone2
optional secondary phone
emailAddress
optional email address
currencyCode
optional currency code such as MYR
taxCode
optional tax code/type
taxEntityID
optional Tax Entity Maintenance numeric ID to link this creditor to e-Invoice/tax entity details
controlAccount
optional book-specific creditor control account; connector local-mvp-2026.10.06.02+ preserves existing value on update, uses SDK default or unique SCC account on create, and rejects ambiguity; older builds must send the correct explicit controlAccount; never assume a universal account number
isActive
optional boolean active flag
desc2
optional second name/description
creditorType
optional Creditor Type Maintenance code
area
optional Area Maintenance code
purchaseAgent
optional Purchase Agent Maintenance code
branchCode
optional branch code for multi-branch/supplier branch usage
displayTerm
optional Credit Term Maintenance value such as C.O.D. or 30 DAYS
creditLimit
optional supplier credit limit amount if used
overdueLimit
optional overdue limit amount or days depending on AutoCount setup
attention
optional contact attention person
fax1
optional fax
website
optional website
registrationNo
optional company registration number
taxRegisterNo
optional SST/tax registration number
businessNature
optional business nature
remark1
optional remark field 1
remark2
optional remark field 2
deliveryAddress2
optional branch/delivery address line 2
deliveryAddress3
optional branch/delivery address line 3
deliveryAddress4
optional branch/delivery address line 4
deliveryPostCode
optional branch/delivery postcode for the default branch row
deliveryContact
optional branch/delivery contact for the default branch row

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-creditor",
  "payload": {
    "accNo": "400-API",
    "companyName": "API Supplier Sdn Bhd Updated",
    "contactPerson": "Tan Supplier",
    "deliveryAddress1": "Supplier Warehouse",
    "phone1": "03-33333333",
    "emailAddress": "supplier@example.com",
    "taxEntityID": 1,
    "isActive": true,
    "desc2": "API Supplier Trading Name",
    "creditorType": "SUP",
    "area": "PJ",
    "purchaseAgent": "PA01",
    "branchCode": "HQ",
    "displayTerm": "30 DAYS",
    "currencyCode": "MYR",
    "taxCode": "SST",
    "creditLimit": 30000,
    "overdueLimit": 30,
    "address1": "No. 2 Jalan API",
    "address2": "Supplier Park",
    "address3": "Petaling Jaya",
    "address4": "Malaysia",
    "postCode": "46000",
    "attention": "Supplier Accounts",
    "phone2": "019-8888888",
    "fax1": "03-33333334",
    "website": "https://supplier.example.com",
    "registrationNo": "202602000002",
    "taxRegisterNo": "SST-400-API",
    "businessNature": "Supplier",
    "remark1": "Created by API",
    "remark2": "Supplier credit control example",
    "deliveryAddress2": "Logistics Park",
    "deliveryPostCode": "46000",
    "deliveryContact": "Supplier Store",
    "contacts": [
      {
        "name": "Tan Supplier",
        "department": "Finance",
        "designation": "Accounts",
        "mobilePhone": "019-1111111",
        "directPhone": "03-33333335",
        "emailAddress": "supplier-accounts@example.com",
        "includeInContactInfo": true
      }
    ],
    "branches": [
      {
        "branchCode": "HQ",
        "branchName": "Head Office",
        "address1": "No. 2 Jalan API",
        "address2": "Supplier Park",
        "postCode": "46000",
        "contact": "Tan Supplier",
        "phone1": "03-33333333",
        "emailAddress": "supplier-hq@example.com",
        "taxEntityID": 1,
        "isActive": true
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-creditor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-creditorVoid

Guarded void request for a creditor/supplier.

Returns voidBlocked. Prefer inactive/discontinued flags because master records may already be linked to transactions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/void

Full JSON Payload

{
  "commandId": "void-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-creditor",
  "payload": {
    "accNo": "400-S001",
    "reason": "void inactive duplicate"
  }
}

Payload Fields

accNo
required
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-creditor",
  "payload": {
    "accNo": "400-S001",
    "reason": "void inactive duplicate"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-creditor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-creditorDelete

Guarded delete request for a creditor/supplier.

Returns deleteBlocked until AutoCount SDK delete safety and linked-transaction checks are proven. Prefer inactive/discontinued flags.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/delete

Full JSON Payload

{
  "commandId": "delete-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-creditor",
  "payload": {
    "accNo": "400-S001",
    "reason": "remove inactive duplicate"
  }
}

Payload Fields

accNo
required
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-creditor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-creditor",
  "payload": {
    "accNo": "400-S001",
    "reason": "remove inactive duplicate"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-creditor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-item-price-booksRead

List Item Price Book rows safely.

Returns stable rowKey and the natural key itemCode + UOM + priceCategory + AccNo. modifiedSince is rejected because the SDK table has no modification timestamp. Read-only AutoCount DLL listing. Returns stable rowKey (ItemPriceKey), itemCode, uom, priceCategory, accNo, fixed and tier prices. modifiedSince is rejected because this AutoCount table has no modification timestamp.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/list

Full JSON Payload

{
  "commandId": "list-item-price-books-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-item-price-books",
  "payload": {
    "itemCodes": [
      "ITEM001",
      "ITEM002"
    ],
    "priceCategories": [
      "RETAIL"
    ],
    "limit": 1000
  }
}

Payload Fields

itemCodes
optional array of up to 500 item codes; omit to list item codes that have Item Price Book rows
priceCategories
optional price-category filter array
uoms
optional UOM filter array
includeDebtorRows
optional boolean; false excludes rows whose AccNo is populated
offset
optional zero-based result offset
limit
optional returned-row limit, maximum 5000

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-item-price-books-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-item-price-books",
  "payload": {
    "itemCodes": [
      "ITEM001",
      "ITEM002"
    ],
    "priceCategories": [
      "RETAIL"
    ],
    "limit": 1000
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-item-price-books.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-itemCreate

Create a stock item. Supports proven UOM, sub-code, price, opening balance, BOM, and replacement child rows.

Creates item master data through AutoCount SDK. Proven child table rows are written through AutoCount DLL DataTables and verified after save in writeVerification.childRows. Connector checks the child DataTable column exists, writes nativeFields, reloads the item and verifies every requested native field. This is the full human payload reference for Stock Item Maintenance. The connector writes proven UOM rows, item sub-codes, price book rows, customer prices, supplier prices, opening balances, BOM rows, and replacement rows through AutoCount DLL child DataTables, then reloads the item and returns writeVerification.childRows. Batch rows use AutoCount NewItemBatch where enabled.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/create

Full JSON Payload

{
  "commandId": "create-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item",
  "payload": {
    "itemCode": "API-ITEM",
    "description": "API Test Item",
    "desc2": "API Item Second Description",
    "furtherDescription": "Long item note visible in AutoCount item detail.",
    "templateItemCode": "00004",
    "baseUom": "UNIT",
    "salesUom": "UNIT",
    "purchaseUom": "UNIT",
    "reportUom": "UNIT",
    "itemGroup": "FG",
    "itemType": "Stock",
    "taxCode": "S-0",
    "purchaseTaxCode": "P-0",
    "isSalesItem": true,
    "isPurchaseItem": true,
    "stockControl": true,
    "hasBatchNo": false,
    "hasSerialNo": false,
    "isActive": true,
    "uoms": [
      {
        "uom": "UNIT",
        "rate": 1,
        "price": 100,
        "cost": 80,
        "barCode": "9550000000011",
        "minSalePrice": 90,
        "maxSalePrice": 9999,
        "minQty": 15,
        "maxQty": 200
      },
      {
        "uom": "BOX",
        "rate": 12,
        "price": 1200,
        "cost": 960,
        "barCode": "9550000000012"
      }
    ],
    "subCodes": [
      {
        "subCode": "ALT-API-ITEM",
        "uom": "UNIT"
      }
    ],
    "priceBooks": [
      {
        "ref": "PB-API-ITEM",
        "priceCategory": "RETAIL",
        "uom": "UNIT",
        "fixedPrice": 100,
        "qty1": 1,
        "price1": 100
      }
    ],
    "customerPrices": [
      {
        "ref": "CP-API-ITEM",
        "debtorCode": "300-A001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "customerItemCode": "CUST-API-ITEM",
        "fixedPrice": 95,
        "qty1": 1,
        "price1": 95
      }
    ],
    "supplierPrices": [
      {
        "ref": "SP-API-ITEM",
        "creditorCode": "400-S001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "supplierItemCode": "SUP-API-ITEM",
        "fixedPrice": 80,
        "qty1": 1,
        "price1": 80
      }
    ],
    "openingBalances": [
      {
        "location": "HQ",
        "qty": 10,
        "uom": "UNIT",
        "unitCost": 80,
        "batchNo": "BATCH-001",
        "docDate": "2026-07-26"
      }
    ],
    "bomRows": [
      {
        "subItemCode": "API-COMPONENT",
        "qty": 2,
        "overheadCost": 0,
        "seq": 1,
        "costFraction": 1
      }
    ],
    "replacements": [
      {
        "replacementItemCode": "API-REPLACEMENT",
        "replacementDegree": 1,
        "note": "Alternative item"
      }
    ],
    "itemBrand": "MACSOFT",
    "itemCategory": "API",
    "itemClass": "A",
    "tariffCode": "8471.30",
    "defaultLocation": "HQ",
    "costingMethod": "Weighted Average",
    "standardCost": 80,
    "minimumSellingPrice": 90,
    "sellingPrice": 100,
    "purchasePrice": 80,
    "reorderLevel": 10,
    "normalLevel": 50,
    "minimumLevel": 5,
    "maximumLevel": 200,
    "snFormatName": "",
    "batchNo": "BATCH-001",
    "batchDescription": "Opening API batch",
    "remark1": "Created by API",
    "remark2": "Stock item full payload example"
  }
}

Payload Fields

itemCode
required stock item code
description
required item description
desc2
optional second description
furtherDescription
optional long/further description
templateItemCode
optional template item to copy defaults from
baseUom
optional base UOM
salesUom
optional sales UOM
purchaseUom
optional purchase UOM
reportUom
optional report UOM
itemGroup
optional Item Group code
itemType
optional AutoCount item type such as Stock, Service, Non-Stock
taxCode
optional sales tax code
purchaseTaxCode
optional purchase tax code
isSalesItem
optional boolean
isPurchaseItem
optional boolean
stockControl
optional boolean
hasBatchNo
optional boolean
hasSerialNo
optional boolean
snFormatName
optional serial number format name
isActive
optional boolean
uoms
optional array of distinct UOM rows written through AutoCount DLL ItemUomTable; each row requires uom and may contain rate, shelf, price/sellingPrice, cost/purchasePrice, minSalePrice, maxSalePrice, minPurchasePrice, maxPurchasePrice, minQty (ItemUomTable.MinQty), maxQty (ItemUomTable.MaxQty), normalLevel (ItemUomTable.NormalLevel), reorderLevel (ItemUomTable.ReOLevel), reorderQty (ItemUomTable.ReOQty), barCode (string, per UOM), price2-price6, weight, weightUom, measurement, userDefinedFields, and nativeFields for Any writable ItemUomTable column except system-managed fields. Additional exposed writable columns may be supplied by their native name. Unknown/read-only/system fields, duplicate UOMs and conflicting aliases fail before save. Every supplied UOM field is compared after reload, including empty/null values and exact barcode text. Omitted fields remain unchanged. Top-level barCode is rejected; use uoms[].barCode.
subCodes
optional array of item sub-code rows written through AutoCount DLL ItemSubCodeTable; supports subCode/code and uom
priceBooks
optional array of item price book rows written through AutoCount DLL ItemPriceBook; supports ref, uom, priceCategory, fixedPrice/price, fixedDetailDiscount, qty1-price4/detailDiscount4, focLevel, focQty, bonusPointQty, bonusPoint
customerPrices
optional array of customer-specific price rows written through AutoCount DLL ItemCustomerPrice; supports ref, uom, debtorCode/accNo, currencyCode, suppCustItemCode/customerItemCode, fixedPrice/price, fixedDetailDiscount, qty1-price4/detailDiscount4, focLevel, focQty, bonusPointQty, bonusPoint
supplierPrices
optional array of supplier-specific price rows written through AutoCount DLL ItemSupplierPrice; supports ref, uom, creditorCode/accNo, currencyCode, suppCustItemCode/supplierItemCode, fixedPrice/price, fixedDetailDiscount, qty1-price4/detailDiscount4, focLevel, focQty, bonusPointQty, bonusPoint
openingBalances
optional array of opening balance rows written through AutoCount DLL ItemOpeningBalance; supports location, uom, batchNo, qty, cost/unitCost, project/projNo, department/deptNo, docDate
bomRows
optional array of BOM component rows written through AutoCount DLL ItemBOMTable; supports subItemCode/componentItemCode, qty, overheadCost, seq, costFraction, description
replacements
optional array of replacement item rows written through AutoCount DLL ItemReplacementTable; supports replacementItemCode, replacementDegree/degree, note
batchNo
optional first batch number to create
batchDescription
optional first batch description
itemBrand
optional brand
itemCategory
optional category
itemClass
optional class
tariffCode
optional tariff/customs code
defaultLocation
optional default stock location
costingMethod
optional costing method where AutoCount allows it
standardCost
optional standard cost
minimumSellingPrice
optional minimum selling price
sellingPrice
optional default selling price
purchasePrice
optional default purchase price
reorderLevel
optional reorder quantity/level
normalLevel
optional normal stock level
minimumLevel
optional minimum stock level
maximumLevel
optional maximum stock level
remark1
optional remark field 1
remark2
optional remark field 2

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-item",
  "payload": {
    "itemCode": "API-ITEM",
    "description": "API Test Item",
    "desc2": "API Item Second Description",
    "furtherDescription": "Long item note visible in AutoCount item detail.",
    "templateItemCode": "00004",
    "baseUom": "UNIT",
    "salesUom": "UNIT",
    "purchaseUom": "UNIT",
    "reportUom": "UNIT",
    "itemGroup": "FG",
    "itemType": "Stock",
    "taxCode": "S-0",
    "purchaseTaxCode": "P-0",
    "isSalesItem": true,
    "isPurchaseItem": true,
    "stockControl": true,
    "hasBatchNo": false,
    "hasSerialNo": false,
    "isActive": true,
    "uoms": [
      {
        "uom": "UNIT",
        "rate": 1,
        "price": 100,
        "cost": 80,
        "barCode": "9550000000011",
        "minSalePrice": 90,
        "maxSalePrice": 9999,
        "minQty": 15,
        "maxQty": 200
      },
      {
        "uom": "BOX",
        "rate": 12,
        "price": 1200,
        "cost": 960,
        "barCode": "9550000000012"
      }
    ],
    "subCodes": [
      {
        "subCode": "ALT-API-ITEM",
        "uom": "UNIT"
      }
    ],
    "priceBooks": [
      {
        "ref": "PB-API-ITEM",
        "priceCategory": "RETAIL",
        "uom": "UNIT",
        "fixedPrice": 100,
        "qty1": 1,
        "price1": 100
      }
    ],
    "customerPrices": [
      {
        "ref": "CP-API-ITEM",
        "debtorCode": "300-A001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "customerItemCode": "CUST-API-ITEM",
        "fixedPrice": 95,
        "qty1": 1,
        "price1": 95
      }
    ],
    "supplierPrices": [
      {
        "ref": "SP-API-ITEM",
        "creditorCode": "400-S001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "supplierItemCode": "SUP-API-ITEM",
        "fixedPrice": 80,
        "qty1": 1,
        "price1": 80
      }
    ],
    "openingBalances": [
      {
        "location": "HQ",
        "qty": 10,
        "uom": "UNIT",
        "unitCost": 80,
        "batchNo": "BATCH-001",
        "docDate": "2026-07-26"
      }
    ],
    "bomRows": [
      {
        "subItemCode": "API-COMPONENT",
        "qty": 2,
        "overheadCost": 0,
        "seq": 1,
        "costFraction": 1
      }
    ],
    "replacements": [
      {
        "replacementItemCode": "API-REPLACEMENT",
        "replacementDegree": 1,
        "note": "Alternative item"
      }
    ],
    "itemBrand": "MACSOFT",
    "itemCategory": "API",
    "itemClass": "A",
    "tariffCode": "8471.30",
    "defaultLocation": "HQ",
    "costingMethod": "Weighted Average",
    "standardCost": 80,
    "minimumSellingPrice": 90,
    "sellingPrice": 100,
    "purchasePrice": 80,
    "reorderLevel": 10,
    "normalLevel": 50,
    "minimumLevel": 5,
    "maximumLevel": 200,
    "snFormatName": "",
    "batchNo": "BATCH-001",
    "batchDescription": "Opening API batch",
    "remark1": "Created by API",
    "remark2": "Stock item full payload example"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-item.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-itemEdit

Update a stock item.

Updates item master data through AutoCount SDK. Proven child table rows are written through AutoCount DLL DataTables and verified after save in writeVerification.childRows; requested UOM minQty/maxQty and nativeFields must match the reloaded child table row or the command returns ok=false. Connector checks the child DataTable column exists, writes nativeFields, reloads the item and verifies every requested native field. This is the full human payload reference for Stock Item Maintenance. The connector writes proven UOM rows, item sub-codes, price book rows, customer prices, supplier prices, opening balances, BOM rows, and replacement rows through AutoCount DLL child DataTables, then reloads the item and returns writeVerification.childRows. Batch rows use AutoCount NewItemBatch where enabled.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/edit

Full JSON Payload

{
  "commandId": "update-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item",
  "payload": {
    "itemCode": "API-ITEM",
    "description": "Updated API Test Item",
    "desc2": "API Item Second Description",
    "isSalesItem": true,
    "isPurchaseItem": true,
    "stockControl": true,
    "isActive": true,
    "uoms": [
      {
        "uom": "UNIT",
        "rate": 1,
        "price": 100,
        "cost": 80,
        "barCode": "9550000000011",
        "minSalePrice": 90,
        "maxSalePrice": 9999,
        "minQty": 15,
        "maxQty": 200
      },
      {
        "uom": "BOX",
        "rate": 12,
        "price": 1200,
        "cost": 960,
        "barCode": "9550000000012"
      }
    ],
    "subCodes": [
      {
        "subCode": "ALT-API-ITEM",
        "uom": "UNIT"
      }
    ],
    "priceBooks": [
      {
        "ref": "PB-API-ITEM",
        "priceCategory": "RETAIL",
        "uom": "UNIT",
        "fixedPrice": 100,
        "qty1": 1,
        "price1": 100
      }
    ],
    "furtherDescription": "Long item note visible in AutoCount item detail.",
    "templateItemCode": "00004",
    "itemGroup": "FG",
    "itemType": "Stock",
    "itemBrand": "MACSOFT",
    "itemCategory": "API",
    "itemClass": "A",
    "tariffCode": "8471.30",
    "baseUom": "UNIT",
    "salesUom": "UNIT",
    "purchaseUom": "UNIT",
    "reportUom": "UNIT",
    "taxCode": "S-0",
    "purchaseTaxCode": "P-0",
    "defaultLocation": "HQ",
    "costingMethod": "Weighted Average",
    "standardCost": 80,
    "minimumSellingPrice": 90,
    "sellingPrice": 100,
    "purchasePrice": 80,
    "reorderLevel": 10,
    "normalLevel": 50,
    "minimumLevel": 5,
    "maximumLevel": 200,
    "hasBatchNo": false,
    "hasSerialNo": false,
    "snFormatName": "",
    "customerPrices": [
      {
        "ref": "CP-API-ITEM",
        "debtorCode": "300-A001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "customerItemCode": "CUST-API-ITEM",
        "fixedPrice": 95,
        "qty1": 1,
        "price1": 95
      }
    ],
    "supplierPrices": [
      {
        "ref": "SP-API-ITEM",
        "creditorCode": "400-S001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "supplierItemCode": "SUP-API-ITEM",
        "fixedPrice": 80,
        "qty1": 1,
        "price1": 80
      }
    ],
    "openingBalances": [
      {
        "location": "HQ",
        "qty": 10,
        "uom": "UNIT",
        "unitCost": 80,
        "batchNo": "BATCH-001",
        "docDate": "2026-07-26"
      }
    ],
    "bomRows": [
      {
        "subItemCode": "API-COMPONENT",
        "qty": 2,
        "overheadCost": 0,
        "seq": 1,
        "costFraction": 1
      }
    ],
    "replacements": [
      {
        "replacementItemCode": "API-REPLACEMENT",
        "replacementDegree": 1,
        "note": "Alternative item"
      }
    ],
    "batchNo": "BATCH-001",
    "batchDescription": "Opening API batch",
    "remark1": "Created by API",
    "remark2": "Stock item full payload example"
  }
}

Payload Fields

itemCode
required stock item code
description
required item description
desc2
optional second description
furtherDescription
optional long/further description
baseUom
optional base UOM
salesUom
optional sales UOM
purchaseUom
optional purchase UOM
reportUom
optional report UOM
itemGroup
optional Item Group code
itemType
optional AutoCount item type such as Stock, Service, Non-Stock
taxCode
optional sales tax code
purchaseTaxCode
optional purchase tax code
isSalesItem
optional boolean
isPurchaseItem
optional boolean
stockControl
optional boolean
hasBatchNo
optional boolean
hasSerialNo
optional boolean
snFormatName
optional serial number format name
isActive
optional boolean
uoms
optional array of distinct UOM rows written through AutoCount DLL ItemUomTable; each row requires uom and may contain rate, shelf, price/sellingPrice, cost/purchasePrice, minSalePrice, maxSalePrice, minPurchasePrice, maxPurchasePrice, minQty (ItemUomTable.MinQty), maxQty (ItemUomTable.MaxQty), normalLevel (ItemUomTable.NormalLevel), reorderLevel (ItemUomTable.ReOLevel), reorderQty (ItemUomTable.ReOQty), barCode (string, per UOM), price2-price6, weight, weightUom, measurement, userDefinedFields, and nativeFields for Any writable ItemUomTable column except system-managed fields. Additional exposed writable columns may be supplied by their native name. Unknown/read-only/system fields, duplicate UOMs and conflicting aliases fail before save. Every supplied UOM field is compared after reload, including empty/null values and exact barcode text. Omitted fields remain unchanged. Top-level barCode is rejected; use uoms[].barCode.
subCodes
optional array of item sub-code rows written through AutoCount DLL ItemSubCodeTable; supports subCode/code and uom
priceBooks
optional array of item price book rows written through AutoCount DLL ItemPriceBook; supports ref, uom, priceCategory, fixedPrice/price, fixedDetailDiscount, qty1-price4/detailDiscount4, focLevel, focQty, bonusPointQty, bonusPoint
customerPrices
optional array of customer-specific price rows written through AutoCount DLL ItemCustomerPrice; supports ref, uom, debtorCode/accNo, currencyCode, suppCustItemCode/customerItemCode, fixedPrice/price, fixedDetailDiscount, qty1-price4/detailDiscount4, focLevel, focQty, bonusPointQty, bonusPoint
supplierPrices
optional array of supplier-specific price rows written through AutoCount DLL ItemSupplierPrice; supports ref, uom, creditorCode/accNo, currencyCode, suppCustItemCode/supplierItemCode, fixedPrice/price, fixedDetailDiscount, qty1-price4/detailDiscount4, focLevel, focQty, bonusPointQty, bonusPoint
openingBalances
optional array of opening balance rows written through AutoCount DLL ItemOpeningBalance; supports location, uom, batchNo, qty, cost/unitCost, project/projNo, department/deptNo, docDate
bomRows
optional array of BOM component rows written through AutoCount DLL ItemBOMTable; supports subItemCode/componentItemCode, qty, overheadCost, seq, costFraction, description
replacements
optional array of replacement item rows written through AutoCount DLL ItemReplacementTable; supports replacementItemCode, replacementDegree/degree, note
batchNo
optional first batch number to create
batchDescription
optional first batch description
templateItemCode
optional template item to copy defaults from
itemBrand
optional brand
itemCategory
optional category
itemClass
optional class
tariffCode
optional tariff/customs code
defaultLocation
optional default stock location
costingMethod
optional costing method where AutoCount allows it
standardCost
optional standard cost
minimumSellingPrice
optional minimum selling price
sellingPrice
optional default selling price
purchasePrice
optional default purchase price
reorderLevel
optional reorder quantity/level
normalLevel
optional normal stock level
minimumLevel
optional minimum stock level
maximumLevel
optional maximum stock level
remark1
optional remark field 1
remark2
optional remark field 2

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-item",
  "payload": {
    "itemCode": "API-ITEM",
    "description": "Updated API Test Item",
    "desc2": "API Item Second Description",
    "isSalesItem": true,
    "isPurchaseItem": true,
    "stockControl": true,
    "isActive": true,
    "uoms": [
      {
        "uom": "UNIT",
        "rate": 1,
        "price": 100,
        "cost": 80,
        "barCode": "9550000000011",
        "minSalePrice": 90,
        "maxSalePrice": 9999,
        "minQty": 15,
        "maxQty": 200
      },
      {
        "uom": "BOX",
        "rate": 12,
        "price": 1200,
        "cost": 960,
        "barCode": "9550000000012"
      }
    ],
    "subCodes": [
      {
        "subCode": "ALT-API-ITEM",
        "uom": "UNIT"
      }
    ],
    "priceBooks": [
      {
        "ref": "PB-API-ITEM",
        "priceCategory": "RETAIL",
        "uom": "UNIT",
        "fixedPrice": 100,
        "qty1": 1,
        "price1": 100
      }
    ],
    "furtherDescription": "Long item note visible in AutoCount item detail.",
    "templateItemCode": "00004",
    "itemGroup": "FG",
    "itemType": "Stock",
    "itemBrand": "MACSOFT",
    "itemCategory": "API",
    "itemClass": "A",
    "tariffCode": "8471.30",
    "baseUom": "UNIT",
    "salesUom": "UNIT",
    "purchaseUom": "UNIT",
    "reportUom": "UNIT",
    "taxCode": "S-0",
    "purchaseTaxCode": "P-0",
    "defaultLocation": "HQ",
    "costingMethod": "Weighted Average",
    "standardCost": 80,
    "minimumSellingPrice": 90,
    "sellingPrice": 100,
    "purchasePrice": 80,
    "reorderLevel": 10,
    "normalLevel": 50,
    "minimumLevel": 5,
    "maximumLevel": 200,
    "hasBatchNo": false,
    "hasSerialNo": false,
    "snFormatName": "",
    "customerPrices": [
      {
        "ref": "CP-API-ITEM",
        "debtorCode": "300-A001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "customerItemCode": "CUST-API-ITEM",
        "fixedPrice": 95,
        "qty1": 1,
        "price1": 95
      }
    ],
    "supplierPrices": [
      {
        "ref": "SP-API-ITEM",
        "creditorCode": "400-S001",
        "currencyCode": "MYR",
        "uom": "UNIT",
        "supplierItemCode": "SUP-API-ITEM",
        "fixedPrice": 80,
        "qty1": 1,
        "price1": 80
      }
    ],
    "openingBalances": [
      {
        "location": "HQ",
        "qty": 10,
        "uom": "UNIT",
        "unitCost": 80,
        "batchNo": "BATCH-001",
        "docDate": "2026-07-26"
      }
    ],
    "bomRows": [
      {
        "subItemCode": "API-COMPONENT",
        "qty": 2,
        "overheadCost": 0,
        "seq": 1,
        "costFraction": 1
      }
    ],
    "replacements": [
      {
        "replacementItemCode": "API-REPLACEMENT",
        "replacementDegree": 1,
        "note": "Alternative item"
      }
    ],
    "batchNo": "BATCH-001",
    "batchDescription": "Opening API batch",
    "remark1": "Created by API",
    "remark2": "Stock item full payload example"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-item.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
void-itemVoid

Guarded void request for a stock item.

Returns voidBlocked. Prefer inactive/discontinued flags because master records may already be linked to transactions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/void

Full JSON Payload

{
  "commandId": "void-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-item",
  "payload": {
    "itemCode": "ITEM001",
    "reason": "void inactive duplicate"
  }
}

Payload Fields

itemCode
required
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "void-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "void-item",
  "payload": {
    "itemCode": "ITEM001",
    "reason": "void inactive duplicate"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to void-item.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-itemDelete

Guarded delete request for a stock item.

Returns deleteBlocked until AutoCount SDK delete safety and linked-transaction checks are proven. Prefer inactive/discontinued flags.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/delete

Full JSON Payload

{
  "commandId": "delete-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item",
  "payload": {
    "itemCode": "ITEM001",
    "reason": "remove inactive duplicate"
  }
}

Payload Fields

itemCode
required
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-item-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item",
  "payload": {
    "itemCode": "ITEM001",
    "reason": "remove inactive duplicate"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-item.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
delete-item-price-booksDelete

Delete Item Price Book rows safely.

Deletes through AutoCount ItemDataAccess and verifies removal after reload. Natural-key cleanup preserves one row. Deletes through AutoCount ItemDataAccess and reloads for verification. Natural-key deletion never removes the final row; keepOne:true removes only duplicates after the first row.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/delete

Full JSON Payload

{
  "commandId": "delete-item-price-books-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-price-books",
  "payload": {
    "rows": [
      {
        "rowKey": "12345"
      }
    ]
  }
}

Payload Fields

rows
required array, maximum 500. Prefer {rowKey}. For duplicate cleanup only, send itemCode + uom + priceCategory + accNo + keepOne:true.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "delete-item-price-books-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "delete-item-price-books",
  "payload": {
    "rows": [
      {
        "rowKey": "12345"
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to delete-item-price-books.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
upsert-item-price-bookswrite

Insert or update Item Price Book rows without duplicates.

Groups by item, saves once through AutoCount ItemDataAccess, preserves omitted fields, and reloads all rows for verification. Writes through AutoCount ItemDataAccess, loads and saves each item once, preserves omitted fields, rejects duplicate request keys, and reloads every row for verification. currencyCode is not supported by ItemPriceBook; use ItemCustomerPrice for debtor/currency pricing.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/upsert-item-price-books

Full JSON Payload

{
  "commandId": "upsert-item-price-books-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "upsert-item-price-books",
  "payload": {
    "rows": [
      {
        "itemCode": "ITEM001",
        "uom": "UNIT",
        "priceCategory": "RETAIL",
        "accNo": "",
        "useFixedPrice": true,
        "fixedPrice": 12.5
      }
    ]
  }
}

Payload Fields

rows
required array, maximum 500. Natural key: itemCode + uom + priceCategory + accNo. Supported values include ref, useFixedPrice, fixedPrice, fixedDetailDiscount, qty1-price4, detailDiscount1-detailDiscount4, focLevel, focQty, bonusPointQty and bonusPoint.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "upsert-item-price-books-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "upsert-item-price-books",
  "payload": {
    "rows": [
      {
        "itemCode": "ITEM001",
        "uom": "UNIT",
        "priceCategory": "RETAIL",
        "accNo": "",
        "useFixedPrice": true,
        "fixedPrice": 12.5
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to upsert-item-price-books.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-default-accountsRead

Read default posting accounts used by validate/create commands.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/master-data/default-accounts/list

Full JSON Payload

{
  "commandId": "read-default-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-default-accounts",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-default-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-default-accounts",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-default-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

e-Invoice

e-Invoice settings, status, consolidated/self-billed flow, supplier item mapping, import, and sync.

einvoice.setting.gete-Invoice

Read local AutoCount e-Invoice settings summary.

Full human payload reference for einvoice.setting.get. Unsupported filters are ignored safely by read-only connector handlers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/e-invoice-setting/list

Full JSON Payload

{
  "commandId": "einvoice-setting-get-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.setting.get",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false,
    "maxRows": 0
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for inquiry/listing
toDate
optional YYYY-MM-DD end date for inquiry/listing
status
optional e-Invoice status filter such as all, pending, submitted, valid, invalid, failed, cancelled
document
optional document family such as invoice, cash-sale, credit-note, debit-note, refund-note, consolidated, self-billed
docType
optional AutoCount document type filter
docNo
optional AutoCount document number filter
creditorCode
optional supplier code filter
debtorCode
optional customer code filter
supplierItemCode
optional supplier item code filter
itemCode
optional AutoCount item code filter
handlerName
optional AutoCount e-Invoice handler name
includeRaw
optional boolean to include raw/source fields where the connector returns them
maxRows
optional row limit; maxRows: 0 means return all rows

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-setting-get-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.setting.get",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false,
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.setting.get.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.status.liste-Invoice

List local AutoCount e-Invoice submission status.

Full human payload reference for einvoice.status.list. Unsupported filters are ignored safely by read-only connector handlers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/submission-status/list

Full JSON Payload

{
  "commandId": "einvoice-status-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.status.list",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false,
    "maxRows": 0
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for inquiry/listing
toDate
optional YYYY-MM-DD end date for inquiry/listing
status
optional e-Invoice status filter such as all, pending, submitted, valid, invalid, failed, cancelled
document
optional document family such as invoice, cash-sale, credit-note, debit-note, refund-note, consolidated, self-billed
docType
optional AutoCount document type filter
docNo
optional AutoCount document number filter
creditorCode
optional supplier code filter
debtorCode
optional customer code filter
supplierItemCode
optional supplier item code filter
itemCode
optional AutoCount item code filter
handlerName
optional AutoCount e-Invoice handler name
includeRaw
optional boolean to include raw/source fields where the connector returns them
maxRows
optional row limit; maxRows: 0 means return all rows

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-status-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.status.list",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false,
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.status.list.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.status.refreshe-Invoice

Guarded MyInvois/AIP status refresh request.

Returns eInvoiceActionBlocked until compliance workflow proof is completed. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/submission-status/refresh

Full JSON Payload

{
  "commandId": "einvoice-status-refresh-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.status.refresh",
  "payload": {
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.status.refresh by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-status-refresh-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.status.refresh",
  "payload": {
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.status.refresh by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.status.refresh.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.consolidated.create-draftCreate

Guarded consolidated e-Invoice draft generation.

Draft generation is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/consolidated-e-invoice/create

Full JSON Payload

{
  "commandId": "einvoice-consolidated-create-draft-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.consolidated.create-draft",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.consolidated.create-draft by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-consolidated-create-draft-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.consolidated.create-draft",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.consolidated.create-draft by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.consolidated.create-draft.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.consolidated.liste-Invoice

List consolidated e-Invoice inquiry rows from AutoCount handlers.

Full human payload reference for einvoice.consolidated.list. Unsupported filters are ignored safely by read-only connector handlers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/consolidated-e-invoice/list

Full JSON Payload

{
  "commandId": "einvoice-consolidated-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.consolidated.list",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false,
    "maxRows": 0
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for inquiry/listing
toDate
optional YYYY-MM-DD end date for inquiry/listing
docType
optional AutoCount document type filter
handlerName
optional AutoCount e-Invoice handler name
status
optional e-Invoice status filter such as all, pending, submitted, valid, invalid, failed, cancelled
document
optional document family such as invoice, cash-sale, credit-note, debit-note, refund-note, consolidated, self-billed
docNo
optional AutoCount document number filter
creditorCode
optional supplier code filter
debtorCode
optional customer code filter
supplierItemCode
optional supplier item code filter
itemCode
optional AutoCount item code filter
includeRaw
optional boolean to include raw/source fields where the connector returns them
maxRows
optional row limit; maxRows: 0 means return all rows

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-consolidated-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.consolidated.list",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false,
    "maxRows": 0
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.consolidated.list.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.self-billed.create-draftCreate

Guarded self-billed e-Invoice draft generation.

Draft generation is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/self-billed/create

Full JSON Payload

{
  "commandId": "einvoice-self-billed-create-draft-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.self-billed.create-draft",
  "payload": {
    "sourceDocType": "PI",
    "sourceDocNo": "PI-000001",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.self-billed.create-draft by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

sourceDocType
required later
sourceDocNo
required later
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-self-billed-create-draft-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.self-billed.create-draft",
  "payload": {
    "sourceDocType": "PI",
    "sourceDocNo": "PI-000001",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.self-billed.create-draft by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.self-billed.create-draft.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.self-billed.liste-Invoice

List local self-billed e-Invoice records when the account book has the table.

Full human payload reference for einvoice.self-billed.list. Unsupported filters are ignored safely by read-only connector handlers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/self-billed/list

Full JSON Payload

{
  "commandId": "einvoice-self-billed-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.self-billed.list",
  "payload": {
    "maxRows": 0,
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for inquiry/listing
toDate
optional YYYY-MM-DD end date for inquiry/listing
maxRows
optional row limit; maxRows: 0 means return all rows
status
optional e-Invoice status filter such as all, pending, submitted, valid, invalid, failed, cancelled
document
optional document family such as invoice, cash-sale, credit-note, debit-note, refund-note, consolidated, self-billed
docType
optional AutoCount document type filter
docNo
optional AutoCount document number filter
creditorCode
optional supplier code filter
debtorCode
optional customer code filter
supplierItemCode
optional supplier item code filter
itemCode
optional AutoCount item code filter
handlerName
optional AutoCount e-Invoice handler name
includeRaw
optional boolean to include raw/source fields where the connector returns them

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-self-billed-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.self-billed.list",
  "payload": {
    "maxRows": 0,
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.self-billed.list.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.supplier-item-mapping.createCreate

Guarded supplier item mapping create request.

Write is blocked until the exact AutoCount mapping SDK/table write path is proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/supplier-item-mapping/create

Full JSON Payload

{
  "commandId": "einvoice-supplier-item-mapping-create-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-item-mapping.create",
  "payload": {
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "mappingKey": "1",
    "reason": "einvoice.supplier-item-mapping.create by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-supplier-item-mapping-create-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-item-mapping.create",
  "payload": {
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "mappingKey": "1",
    "reason": "einvoice.supplier-item-mapping.create by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.supplier-item-mapping.create.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.supplier-item-mapping.liste-Invoice

List local supplier item mapping records when the account book has the table.

Full human payload reference for einvoice.supplier-item-mapping.list. Unsupported filters are ignored safely by read-only connector handlers.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/supplier-item-mapping/list

Full JSON Payload

{
  "commandId": "einvoice-supplier-item-mapping-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-item-mapping.list",
  "payload": {
    "maxRows": 0,
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false
  }
}

Payload Fields

maxRows
optional row limit; maxRows: 0 means return all rows
fromDate
optional YYYY-MM-DD start date for inquiry/listing
toDate
optional YYYY-MM-DD end date for inquiry/listing
status
optional e-Invoice status filter such as all, pending, submitted, valid, invalid, failed, cancelled
document
optional document family such as invoice, cash-sale, credit-note, debit-note, refund-note, consolidated, self-billed
docType
optional AutoCount document type filter
docNo
optional AutoCount document number filter
creditorCode
optional supplier code filter
debtorCode
optional customer code filter
supplierItemCode
optional supplier item code filter
itemCode
optional AutoCount item code filter
handlerName
optional AutoCount e-Invoice handler name
includeRaw
optional boolean to include raw/source fields where the connector returns them

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-supplier-item-mapping-list-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-item-mapping.list",
  "payload": {
    "maxRows": 0,
    "fromDate": "2026-01-01",
    "toDate": "2026-12-31",
    "status": "all",
    "document": "all",
    "docType": "IV",
    "docNo": "IV-000001",
    "creditorCode": "400-S001",
    "debtorCode": "300-A001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "handlerName": "AutoCount",
    "includeRaw": false
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.supplier-item-mapping.list.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.supplier-item-mapping.updatee-Invoice

Guarded supplier item mapping update request.

Write is blocked until the exact AutoCount mapping SDK/table write path is proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/supplier-item-mapping/edit

Full JSON Payload

{
  "commandId": "einvoice-supplier-item-mapping-update-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-item-mapping.update",
  "payload": {
    "mappingKey": "1",
    "itemCode": "ITEM001",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "reason": "einvoice.supplier-item-mapping.update by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

mappingKey
optional mapping row key
itemCode
optional AutoCount item code
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-supplier-item-mapping-update-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-item-mapping.update",
  "payload": {
    "mappingKey": "1",
    "itemCode": "ITEM001",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "reason": "einvoice.supplier-item-mapping.update by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.supplier-item-mapping.update.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.cancelVoid

Guarded e-Invoice cancel request.

Cancellation affects tax/MyInvois compliance and is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/e-invoice/cancel

Full JSON Payload

{
  "commandId": "einvoice-cancel-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.cancel",
  "payload": {
    "docType": "IV",
    "docNo": "IV-000001",
    "reason": "einvoice.cancel by API",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
reason
optional required reason for cancel/reject actions
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-cancel-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.cancel",
  "payload": {
    "docType": "IV",
    "docNo": "IV-000001",
    "reason": "einvoice.cancel by API",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.cancel.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.reject-request.synce-Invoice

Guarded sync for MyInvois reject requests.

External sync is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/e-invoice/einvoice-reject-request-sync

Full JSON Payload

{
  "commandId": "einvoice-reject-request-sync-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.reject-request.sync",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.reject-request.sync by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-reject-request-sync-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.reject-request.sync",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.reject-request.sync by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.reject-request.sync.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.submite-Invoice

Guarded e-Invoice submit request.

Submission affects tax/MyInvois compliance and is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/e-invoice/submit

Full JSON Payload

{
  "commandId": "einvoice-submit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.submit",
  "payload": {
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.submit by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-submit-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.submit",
  "payload": {
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.submit by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.submit.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.supplier-import.applye-Invoice

Guarded supplier e-Invoice import into AutoCount.

Import can create accounting records and is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/supplier-import/apply

Full JSON Payload

{
  "commandId": "einvoice-supplier-import-apply-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-import.apply",
  "payload": {
    "documentId": "AIP-document-id",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.supplier-import.apply by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

documentId
optional MyInvois/AIP document id for import/apply actions
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
uuid
optional MyInvois UUID
fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-supplier-import-apply-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-import.apply",
  "payload": {
    "documentId": "AIP-document-id",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "uuid": "myinvois-uuid",
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.supplier-import.apply by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.supplier-import.apply.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
einvoice.supplier-import.previewe-Invoice

Guarded supplier e-Invoice import preview.

Supplier portal import is blocked until separately proven. e-Invoice write/compliance actions are deliberately guarded until the exact MyInvois workflow is proven. The payload shows the full human field reference for future/guarded actions.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/e-invoice-module/supplier-import/preview

Full JSON Payload

{
  "commandId": "einvoice-supplier-import-preview-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-import.preview",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.supplier-import.preview by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
}

Payload Fields

fromDate
optional YYYY-MM-DD start date for list/preview/batch actions
toDate
optional YYYY-MM-DD end date for list/preview/batch actions
docType
required AutoCount document type, for example IV, CS, CN, DN, RF, PI
docNo
required AutoCount document number where action targets one document
docKey
optional numeric AutoCount document key
documentId
optional MyInvois/AIP document id for import/apply actions
uuid
optional MyInvois UUID
creditorCode
optional supplier code for supplier item mapping
supplierItemCode
optional supplier item code
itemCode
optional AutoCount item code
mappingKey
optional mapping row key
reason
optional required reason for cancel/reject actions
payload
optional raw integration payload where a future compliance command requires it

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "einvoice-supplier-import-preview-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "einvoice.supplier-import.preview",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-01-31",
    "docType": "IV",
    "docNo": "IV-000001",
    "docKey": "424501",
    "documentId": "AIP-document-id",
    "uuid": "myinvois-uuid",
    "creditorCode": "400-S001",
    "supplierItemCode": "SUP-ITEM",
    "itemCode": "ITEM001",
    "mappingKey": "1",
    "reason": "einvoice.supplier-import.preview by API",
    "payload": {
      "source": "api",
      "dryRun": true
    }
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to einvoice.supplier-import.preview.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
submit-sales-invoice-for-approvalwrite

Move an existing Sales Invoice into AutoCount approval workflow only.

Use after create-sales-invoice when the user must review/approve in AutoCount first. Alias: einvoice.sales-invoice.submit-for-approval. It calls AutoCount SaveAsAwaitingApproval, verifies DocStatus, and does not call MyInvois/LHDN submit.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/submit-sales-invoice-for-approval

Full JSON Payload

{
  "commandId": "submit-sales-invoice-for-approval-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "submit-sales-invoice-for-approval",
  "payload": {
    "docNo": "I-2608-001",
    "confirmNoLhdnSubmit": true
  }
}

Payload Fields

docNo
required existing Sales Invoice DocNo
confirmNoLhdnSubmit
required true; confirms this does not call MyInvois/LHDN submit

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "submit-sales-invoice-for-approval-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "submit-sales-invoice-for-approval",
  "payload": {
    "docNo": "I-2608-001",
    "confirmNoLhdnSubmit": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to submit-sales-invoice-for-approval.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Bulk / Tools

Bulk creation and tooling recipes for larger imports or automation batches.

bulk-createBulk

Generic bulk create wrapper. Use when one request needs to create many documents or master records.

The local connector processes records on the customer PC in one leased command. Each row gets its own idempotency/audit result.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/bulk-module/bulk/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create",
  "payload": {
    "operation": "create-journal-entry",
    "records": [
      {
        "externalId": "row-001",
        "docDate": "2026-06-20",
        "description": "Payroll JE 1",
        "lines": [
          {
            "accNo": "610-0000",
            "debit": 100
          },
          {
            "accNo": "500-1000",
            "credit": 100
          }
        ]
      }
    ]
  }
}

Payload Fields

operation
required create-* command type
records
required array of command payload objects
stopOnError
optional boolean, default false

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create",
  "payload": {
    "operation": "create-journal-entry",
    "records": [
      {
        "externalId": "row-001",
        "docDate": "2026-06-20",
        "description": "Payroll JE 1",
        "lines": [
          {
            "accNo": "610-0000",
            "debit": 100
          },
          {
            "accNo": "500-1000",
            "credit": 100
          }
        ]
      }
    ]
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-advanced-quotationsBulk

Bulk wrapper for create-advanced-quotation.

Runs create-advanced-quotation for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-advanced-quotation. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/bulk-module/advanced-quotation/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-advanced-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-advanced-quotations",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-advanced-quotation-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-advanced-quotation
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-advanced-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-advanced-quotations",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-advanced-quotation-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-advanced-quotations.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ap-credit-notesBulk

Bulk wrapper for create-ap-credit-note.

Runs create-ap-credit-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ap-credit-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-credit-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ap-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-credit-notes",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AP document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "610-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "620-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-credit-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ap-credit-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ap-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-credit-notes",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AP document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "610-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "620-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-credit-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ap-credit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ap-debit-notesBulk

Bulk wrapper for create-ap-debit-note.

Runs create-ap-debit-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ap-debit-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-debit-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ap-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-debit-notes",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AP document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "610-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "620-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-debit-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ap-debit-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ap-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-debit-notes",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AP document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "610-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "620-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-debit-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ap-debit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ap-invoicesBulk

Bulk wrapper for create-ap-invoice.

Runs create-ap-invoice for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ap-invoice. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-invoice/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ap-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-invoices",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AP document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "610-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "620-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-invoice-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ap-invoice
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ap-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-invoices",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AP document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "610-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "620-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-invoice-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ap-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ap-paymentsBulk

Bulk wrapper for create-ap-payment.

Runs create-ap-payment for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ap-payment. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-payment/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ap-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-payments",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AP payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-payment-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ap-payment
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ap-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-payments",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AP payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-payment-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ap-payments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ap-refundsBulk

Bulk wrapper for create-ap-refund.

Runs create-ap-refund for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ap-refund. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/ap-refund/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ap-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-refunds",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AP payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-refund-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ap-refund
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ap-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ap-refunds",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AP payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ap-refund-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ap-refunds.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ar-credit-notesBulk

Bulk wrapper for create-ar-credit-note.

Runs create-ar-credit-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ar-credit-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-credit-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ar-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-credit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AR document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "500-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "501-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-credit-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ar-credit-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ar-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-credit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AR document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "500-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "501-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-credit-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ar-credit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ar-debit-notesBulk

Bulk wrapper for create-ar-debit-note.

Runs create-ar-debit-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ar-debit-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-debit-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ar-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-debit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AR document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "500-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "501-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-debit-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ar-debit-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ar-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-debit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AR document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "500-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "501-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-debit-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ar-debit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ar-invoicesBulk

Bulk wrapper for create-ar-invoice.

Runs create-ar-invoice for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ar-invoice. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-invoice/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ar-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-invoices",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AR document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "500-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "501-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-invoice-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ar-invoice
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ar-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-invoices",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "dueDate": "2026-07-24",
        "description": "AR document created through API",
        "ref": "API-REF-1001",
        "branchCode": "MAIN",
        "attention": "Accounts Department",
        "contact": "Accounts Department",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "lines": [
          {
            "accountNo": "500-0000",
            "description": "Service line 1",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "taxAmount": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accountNo": "501-0000",
            "description": "Different posting account line",
            "amount": 50,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022"
          }
        ],
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-invoice-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ar-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ar-paymentsBulk

Bulk wrapper for create-ar-payment.

Runs create-ar-payment for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ar-payment. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-payment/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ar-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-payments",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AR payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-payment-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ar-payment
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ar-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-payments",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AR payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-payment-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ar-payments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-ar-refundsBulk

Bulk wrapper for create-ar-refund.

Runs create-ar-refund for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-ar-refund. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/ar-refund/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-ar-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-refunds",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AR payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-refund-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-ar-refund
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-ar-refunds-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-ar-refunds",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "paymentMethod": "CASH",
        "paymentBy": "Cash",
        "chequeNo": "API-PAY-1001",
        "bankCharge": 0,
        "paymentAccountNo": "110-0010",
        "bankChargeAccountNo": "810-0000",
        "creditCardApprovalCode": "",
        "description": "AR payment/refund created through API",
        "amount": 100,
        "knockOffs": [
          {
            "docType": "RI",
            "docKey": "424508",
            "docNo": "IV-000001",
            "amount": 100,
            "discountAmount": 0,
            "taxAdjustment": 0,
            "gainLossAmount": 0,
            "withholdingTaxAmount": 0
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-ar-refund-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-ar-refunds.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-arap-contrasBulk

Bulk wrapper for create-arap-contra.

Runs create-arap-contra for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-arap-contra. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/arap-module/arap-contra/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-arap-contras-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-arap-contras",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "description": "API AR/AP contra",
        "ref": "API-CONTRA-1001",
        "amount": 100,
        "arKnockOffs": [
          {
            "docType": "RI",
            "docKey": "424501",
            "docNo": "IV-000001",
            "amount": 100
          }
        ],
        "apKnockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100
          }
        ],
        "knockOffs": [
          {
            "side": "AR",
            "docType": "RI",
            "docKey": "424501",
            "docNo": "IV-000001",
            "amount": 100
          },
          {
            "side": "AP",
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-arap-contra-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-arap-contra
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-arap-contras-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-arap-contras",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "description": "API AR/AP contra",
        "ref": "API-CONTRA-1001",
        "amount": 100,
        "arKnockOffs": [
          {
            "docType": "RI",
            "docKey": "424501",
            "docNo": "IV-000001",
            "amount": 100
          }
        ],
        "apKnockOffs": [
          {
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100
          }
        ],
        "knockOffs": [
          {
            "side": "AR",
            "docType": "RI",
            "docKey": "424501",
            "docNo": "IV-000001",
            "amount": 100
          },
          {
            "side": "AP",
            "docType": "PB",
            "docKey": "424508",
            "docNo": "PI-000001",
            "amount": 100
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-arap-contra-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-arap-contras.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-cash-purchasesBulk

Bulk wrapper for create-cash-purchase.

Runs create-cash-purchase for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-cash-purchase. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/bulk-module/cash-purchase/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-cash-purchases-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-cash-purchases",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-cash-purchase-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-cash-purchase
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-cash-purchases-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-cash-purchases",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-cash-purchase-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-cash-purchases.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-cash-salesBulk

Bulk wrapper for create-cash-sale.

Runs create-cash-sale for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-cash-sale. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/bulk-module/cash-sale/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-cash-sales-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-cash-sales",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-cash-sale-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-cash-sale
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-cash-sales-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-cash-sales",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-cash-sale-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-cash-sales.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-creditorsBulk

Bulk wrapper for create-creditor.

Runs create-creditor for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-creditor. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ap-module/creditor-supplier/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-creditors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-creditors",
  "payload": {
    "records": [
      {
        "accNo": "400-API",
        "companyName": "API Supplier Sdn Bhd",
        "desc2": "API Supplier Trading Name",
        "creditorType": "SUP",
        "area": "PJ",
        "purchaseAgent": "PA01",
        "branchCode": "HQ",
        "displayTerm": "30 DAYS",
        "currencyCode": "MYR",
        "taxCode": "SST",
        "taxEntityID": 1,
        "creditLimit": 30000,
        "overdueLimit": 30,
        "isActive": true,
        "address1": "No. 2 Jalan API",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "postCode": "46000",
        "attention": "Supplier Accounts",
        "contactPerson": "Tan Supplier",
        "phone1": "03-33333333",
        "phone2": "019-8888888",
        "fax1": "03-33333334",
        "emailAddress": "supplier@example.com",
        "website": "https://supplier.example.com",
        "registrationNo": "202602000002",
        "taxRegisterNo": "SST-400-API",
        "businessNature": "Supplier",
        "remark1": "Created by API",
        "remark2": "Supplier credit control example",
        "deliveryAddress1": "Supplier Warehouse",
        "deliveryAddress2": "Logistics Park",
        "deliveryPostCode": "46000",
        "deliveryContact": "Supplier Store",
        "contacts": [
          {
            "name": "Tan Supplier",
            "department": "Finance",
            "designation": "Accounts",
            "mobilePhone": "019-1111111",
            "directPhone": "03-33333335",
            "emailAddress": "supplier-accounts@example.com",
            "includeInContactInfo": true
          }
        ],
        "branches": [
          {
            "branchCode": "HQ",
            "branchName": "Head Office",
            "address1": "No. 2 Jalan API",
            "address2": "Supplier Park",
            "postCode": "46000",
            "contact": "Tan Supplier",
            "phone1": "03-33333333",
            "emailAddress": "supplier-hq@example.com",
            "taxEntityID": 1,
            "isActive": true
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-creditor-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-creditor
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-creditors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-creditors",
  "payload": {
    "records": [
      {
        "accNo": "400-API",
        "companyName": "API Supplier Sdn Bhd",
        "desc2": "API Supplier Trading Name",
        "creditorType": "SUP",
        "area": "PJ",
        "purchaseAgent": "PA01",
        "branchCode": "HQ",
        "displayTerm": "30 DAYS",
        "currencyCode": "MYR",
        "taxCode": "SST",
        "taxEntityID": 1,
        "creditLimit": 30000,
        "overdueLimit": 30,
        "isActive": true,
        "address1": "No. 2 Jalan API",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "postCode": "46000",
        "attention": "Supplier Accounts",
        "contactPerson": "Tan Supplier",
        "phone1": "03-33333333",
        "phone2": "019-8888888",
        "fax1": "03-33333334",
        "emailAddress": "supplier@example.com",
        "website": "https://supplier.example.com",
        "registrationNo": "202602000002",
        "taxRegisterNo": "SST-400-API",
        "businessNature": "Supplier",
        "remark1": "Created by API",
        "remark2": "Supplier credit control example",
        "deliveryAddress1": "Supplier Warehouse",
        "deliveryAddress2": "Logistics Park",
        "deliveryPostCode": "46000",
        "deliveryContact": "Supplier Store",
        "contacts": [
          {
            "name": "Tan Supplier",
            "department": "Finance",
            "designation": "Accounts",
            "mobilePhone": "019-1111111",
            "directPhone": "03-33333335",
            "emailAddress": "supplier-accounts@example.com",
            "includeInContactInfo": true
          }
        ],
        "branches": [
          {
            "branchCode": "HQ",
            "branchName": "Head Office",
            "address1": "No. 2 Jalan API",
            "address2": "Supplier Park",
            "postCode": "46000",
            "contact": "Tan Supplier",
            "phone1": "03-33333333",
            "emailAddress": "supplier-hq@example.com",
            "taxEntityID": 1,
            "isActive": true
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-creditor-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-creditors.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-debtorsBulk

Bulk wrapper for create-debtor.

Runs create-debtor for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-debtor. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/ar-module/debtor-customer/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-debtors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-debtors",
  "payload": {
    "records": [
      {
        "accNo": "300-API",
        "companyName": "API Customer Sdn Bhd",
        "desc2": "API Customer Trading Name",
        "debtorType": "CUS",
        "area": "KL",
        "salesAgent": "SA01",
        "branchCode": "HQ",
        "displayTerm": "30 DAYS",
        "currencyCode": "MYR",
        "taxCode": "SST",
        "taxEntityID": 1,
        "priceCategory": "API",
        "creditLimit": 50000,
        "overdueLimit": 30,
        "statementType": "Open Item",
        "isActive": true,
        "allowExceedCreditLimit": false,
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "postCode": "50000",
        "attention": "Accounts Department",
        "contactPerson": "Lim Accounts",
        "phone1": "03-11111111",
        "phone2": "012-3456789",
        "fax1": "03-11111112",
        "emailAddress": "customer@example.com",
        "website": "https://customer.example.com",
        "registrationNo": "202601000001",
        "taxRegisterNo": "SST-300-API",
        "businessNature": "Trading",
        "remark1": "Created by API",
        "remark2": "Credit control example",
        "deliveryAddress1": "Warehouse 1",
        "deliveryAddress2": "Industrial Park",
        "deliveryAddress3": "Shah Alam",
        "deliveryAddress4": "Malaysia",
        "deliveryPostCode": "40100",
        "deliveryContact": "Store Receiver",
        "contacts": [
          {
            "name": "Lim Accounts",
            "department": "Finance",
            "designation": "Accounts",
            "mobilePhone": "012-1111111",
            "directPhone": "03-11111113",
            "emailAddress": "accounts@example.com",
            "includeInContactInfo": true
          }
        ],
        "branches": [
          {
            "branchCode": "HQ",
            "branchName": "Head Office",
            "address1": "No. 1 Jalan API",
            "address2": "Taman Integration",
            "postCode": "50000",
            "contact": "Lim Accounts",
            "phone1": "03-11111111",
            "emailAddress": "hq@example.com",
            "taxEntityID": 1,
            "isActive": true
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-debtor-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-debtor
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-debtors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-debtors",
  "payload": {
    "records": [
      {
        "accNo": "300-API",
        "companyName": "API Customer Sdn Bhd",
        "desc2": "API Customer Trading Name",
        "debtorType": "CUS",
        "area": "KL",
        "salesAgent": "SA01",
        "branchCode": "HQ",
        "displayTerm": "30 DAYS",
        "currencyCode": "MYR",
        "taxCode": "SST",
        "taxEntityID": 1,
        "priceCategory": "API",
        "creditLimit": 50000,
        "overdueLimit": 30,
        "statementType": "Open Item",
        "isActive": true,
        "allowExceedCreditLimit": false,
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "postCode": "50000",
        "attention": "Accounts Department",
        "contactPerson": "Lim Accounts",
        "phone1": "03-11111111",
        "phone2": "012-3456789",
        "fax1": "03-11111112",
        "emailAddress": "customer@example.com",
        "website": "https://customer.example.com",
        "registrationNo": "202601000001",
        "taxRegisterNo": "SST-300-API",
        "businessNature": "Trading",
        "remark1": "Created by API",
        "remark2": "Credit control example",
        "deliveryAddress1": "Warehouse 1",
        "deliveryAddress2": "Industrial Park",
        "deliveryAddress3": "Shah Alam",
        "deliveryAddress4": "Malaysia",
        "deliveryPostCode": "40100",
        "deliveryContact": "Store Receiver",
        "contacts": [
          {
            "name": "Lim Accounts",
            "department": "Finance",
            "designation": "Accounts",
            "mobilePhone": "012-1111111",
            "directPhone": "03-11111113",
            "emailAddress": "accounts@example.com",
            "includeInContactInfo": true
          }
        ],
        "branches": [
          {
            "branchCode": "HQ",
            "branchName": "Head Office",
            "address1": "No. 1 Jalan API",
            "address2": "Taman Integration",
            "postCode": "50000",
            "contact": "Lim Accounts",
            "phone1": "03-11111111",
            "emailAddress": "hq@example.com",
            "taxEntityID": 1,
            "isActive": true
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-debtor-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-debtors.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-delivery-ordersBulk

Bulk wrapper for create-delivery-order.

Runs create-delivery-order for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-delivery-order. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/bulk-module/delivery-order/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-delivery-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-delivery-orders",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-delivery-order-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-delivery-order
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-delivery-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-delivery-orders",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-delivery-order-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-delivery-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-fixed-asset-gl-accountsBulk

Bulk wrapper for create-fixed-asset-gl-accounts.

Runs create-fixed-asset-gl-accounts for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-fixed-asset-gl-accounts. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-fixed-asset-gl-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-fixed-asset-gl-accounts",
  "payload": {
    "records": [
      {
        "fixedAsset": {
          "accNo": "150-1000",
          "description": "Motor Vehicle",
          "accType": "use an Asset code from list-general-account-types",
          "parentAccNo": "<<FIXED ASSETS>>",
          "currencyCode": "MYR",
          "cashFlowCategory": "InvestingActivities",
          "specialAccType": "SFA"
        },
        "accumulatedDepreciation": {
          "accNo": "159-1000",
          "description": "Accumulated Depreciation - Motor Vehicle",
          "accType": "use an Asset code from list-general-account-types",
          "parentAccNo": "<<FIXED ASSETS>>",
          "currencyCode": "MYR",
          "cashFlowCategory": "OperatingActivities",
          "specialAccType": "SAD"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-fixed-asset-gl-accounts-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-fixed-asset-gl-accounts
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-fixed-asset-gl-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-fixed-asset-gl-accounts",
  "payload": {
    "records": [
      {
        "fixedAsset": {
          "accNo": "150-1000",
          "description": "Motor Vehicle",
          "accType": "use an Asset code from list-general-account-types",
          "parentAccNo": "<<FIXED ASSETS>>",
          "currencyCode": "MYR",
          "cashFlowCategory": "InvestingActivities",
          "specialAccType": "SFA"
        },
        "accumulatedDepreciation": {
          "accNo": "159-1000",
          "description": "Accumulated Depreciation - Motor Vehicle",
          "accType": "use an Asset code from list-general-account-types",
          "parentAccNo": "<<FIXED ASSETS>>",
          "currencyCode": "MYR",
          "cashFlowCategory": "OperatingActivities",
          "specialAccType": "SAD"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-fixed-asset-gl-accounts-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-fixed-asset-gl-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-addressesBulk

Bulk wrapper for create-general-address.

Runs create-general-address for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-address. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/address/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-addresses-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-addresses",
  "payload": {
    "records": [
      {
        "code": "HQ",
        "addressName": "Head Office",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "postCode": "50000",
        "city": "Kuala Lumpur",
        "state": "Wilayah Persekutuan",
        "country": "Malaysia",
        "contact": "Admin",
        "phone": "03-00000000",
        "fax": "03-00000001",
        "emailAddress": "admin@example.com",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Address setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-address-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-address
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-addresses-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-addresses",
  "payload": {
    "records": [
      {
        "code": "HQ",
        "addressName": "Head Office",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "postCode": "50000",
        "city": "Kuala Lumpur",
        "state": "Wilayah Persekutuan",
        "country": "Malaysia",
        "contact": "Admin",
        "phone": "03-00000000",
        "fax": "03-00000001",
        "emailAddress": "admin@example.com",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Address setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-address-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-addresses.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-areasBulk

Bulk wrapper for create-general-area.

Runs create-general-area for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-area. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/area/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-areas-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-areas",
  "payload": {
    "records": [
      {
        "code": "KL",
        "areaCode": "KL",
        "description": "Kuala Lumpur",
        "desc2": "Central region"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-area-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-area
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-areas-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-areas",
  "payload": {
    "records": [
      {
        "code": "KL",
        "areaCode": "KL",
        "description": "Kuala Lumpur",
        "desc2": "Central region"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-area-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-areas.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-cn-typesBulk

Bulk wrapper for create-general-cn-type.

Runs create-general-cn-type for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-cn-type. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/cn-type/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-cn-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-cn-types",
  "payload": {
    "records": [
      {
        "code": "CNAPI",
        "cnType": "CNAPI",
        "description": "API C/N Type",
        "desc2": "C/N Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "C/N Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-cn-type-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-cn-type
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-cn-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-cn-types",
  "payload": {
    "records": [
      {
        "code": "CNAPI",
        "cnType": "CNAPI",
        "description": "API C/N Type",
        "desc2": "C/N Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "C/N Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-cn-type-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-cn-types.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-creditor-typesBulk

Bulk wrapper for create-general-creditor-type.

Runs create-general-creditor-type for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-creditor-type. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/creditor-type/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-creditor-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-creditor-types",
  "payload": {
    "records": [
      {
        "code": "SUP",
        "creditorType": "SUP",
        "description": "API Creditor Type",
        "desc2": "Creditor Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Creditor Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-creditor-type-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-creditor-type
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-creditor-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-creditor-types",
  "payload": {
    "records": [
      {
        "code": "SUP",
        "creditorType": "SUP",
        "description": "API Creditor Type",
        "desc2": "Creditor Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Creditor Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-creditor-type-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-creditor-types.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-currenciesBulk

Bulk wrapper for create-general-currency.

Runs create-general-currency for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-currency. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/currency/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-currencies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-currencies",
  "payload": {
    "records": [
      {
        "code": "USD",
        "currencyCode": "USD",
        "currencySymbol": "$",
        "currencyWord": "US Dollar",
        "currencyWord2": "US Dollars",
        "bankBuyRate": 4.7,
        "bankSellRate": 4.75,
        "fcGainAccount": "720-0000",
        "fcLossAccount": "820-0000",
        "gainLossJournalType": "GL"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-currency-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-currency
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-currencies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-currencies",
  "payload": {
    "records": [
      {
        "code": "USD",
        "currencyCode": "USD",
        "currencySymbol": "$",
        "currencyWord": "US Dollar",
        "currencyWord2": "US Dollars",
        "bankBuyRate": 4.7,
        "bankSellRate": 4.75,
        "fcGainAccount": "720-0000",
        "fcLossAccount": "820-0000",
        "gainLossJournalType": "GL"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-currency-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-currencies.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-debtor-typesBulk

Bulk wrapper for create-general-debtor-type.

Runs create-general-debtor-type for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-debtor-type. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/debtor-type/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-debtor-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-debtor-types",
  "payload": {
    "records": [
      {
        "code": "CUS",
        "debtorType": "CUS",
        "description": "API Debtor Type",
        "desc2": "Debtor Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Debtor Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-debtor-type-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-debtor-type
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-debtor-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-debtor-types",
  "payload": {
    "records": [
      {
        "code": "CUS",
        "debtorType": "CUS",
        "description": "API Debtor Type",
        "desc2": "Debtor Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Debtor Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-debtor-type-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-debtor-types.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-dn-typesBulk

Bulk wrapper for create-general-dn-type.

Runs create-general-dn-type for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-dn-type. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/dn-type/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-dn-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-dn-types",
  "payload": {
    "records": [
      {
        "code": "DNAPI",
        "dnType": "DNAPI",
        "description": "API D/N Type",
        "desc2": "D/N Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "D/N Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-dn-type-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-dn-type
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-dn-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-dn-types",
  "payload": {
    "records": [
      {
        "code": "DNAPI",
        "dnType": "DNAPI",
        "description": "API D/N Type",
        "desc2": "D/N Type second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "D/N Type setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-dn-type-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-dn-types.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-payment-methodsBulk

Bulk wrapper for create-general-payment-method.

Runs create-general-payment-method for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-payment-method. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/payment-method/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-payment-methods-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-payment-methods",
  "payload": {
    "records": [
      {
        "code": "BANKAPI",
        "paymentMethod": "BANKAPI",
        "paymentType": "Bank",
        "paymentBy": "Bank Transfer",
        "journalType": "BANK",
        "bankAccount": "110-0010",
        "bankChargeAccount": "810-0000",
        "bankChargePercent": 2.5,
        "minBankCharge": 0,
        "odLimit": 0,
        "nextChequeNo": "CHQ-000101",
        "acceptChequeNo": true,
        "mergeBankChargeTrans": false,
        "isActive": true
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-payment-method-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-payment-method
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-payment-methods-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-payment-methods",
  "payload": {
    "records": [
      {
        "code": "BANKAPI",
        "paymentMethod": "BANKAPI",
        "paymentType": "Bank",
        "paymentBy": "Bank Transfer",
        "journalType": "BANK",
        "bankAccount": "110-0010",
        "bankChargeAccount": "810-0000",
        "bankChargePercent": 2.5,
        "minBankCharge": 0,
        "odLimit": 0,
        "nextChequeNo": "CHQ-000101",
        "acceptChequeNo": true,
        "mergeBankChargeTrans": false,
        "isActive": true
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-payment-method-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-payment-methods.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-price-categoriesBulk

Bulk wrapper for create-general-price-category.

Runs create-general-price-category for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-price-category. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/price-category/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-price-categories-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-price-categories",
  "payload": {
    "records": [
      {
        "code": "API",
        "priceCategory": "API",
        "description": "API Price Category",
        "discountPercent": 5,
        "detailDiscount": "5%",
        "markupRatio": 1.2,
        "roundingMethod": "Normal",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Price category setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-price-category-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-price-category
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-price-categories-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-price-categories",
  "payload": {
    "records": [
      {
        "code": "API",
        "priceCategory": "API",
        "description": "API Price Category",
        "discountPercent": 5,
        "detailDiscount": "5%",
        "markupRatio": 1.2,
        "roundingMethod": "Normal",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Price category setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-price-category-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-price-categories.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-projectsBulk

Bulk wrapper for create-general-project.

Runs create-general-project for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-project. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/project/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-projects-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-projects",
  "payload": {
    "records": [
      {
        "code": "PRJAPI",
        "projectNo": "PRJAPI",
        "projNo": "PRJAPI",
        "parentProjNo": "",
        "description": "API Project",
        "desc2": "Project second description",
        "isActive": true
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-project-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-project
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-projects-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-projects",
  "payload": {
    "records": [
      {
        "code": "PRJAPI",
        "projectNo": "PRJAPI",
        "projNo": "PRJAPI",
        "parentProjNo": "",
        "description": "API Project",
        "desc2": "Project second description",
        "isActive": true
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-project-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-projects.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-purchase-agentsBulk

Bulk wrapper for create-general-purchase-agent.

Runs create-general-purchase-agent for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-purchase-agent. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/purchase-agent/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-purchase-agents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-purchase-agents",
  "payload": {
    "records": [
      {
        "code": "PAAPI",
        "purchaseAgent": "PAAPI",
        "description": "API Purchase Agent",
        "desc2": "Purchase Agent second description",
        "isActive": true,
        "signature": "Approved by Purchasing"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-purchase-agent-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-purchase-agent
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-purchase-agents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-purchase-agents",
  "payload": {
    "records": [
      {
        "code": "PAAPI",
        "purchaseAgent": "PAAPI",
        "description": "API Purchase Agent",
        "desc2": "Purchase Agent second description",
        "isActive": true,
        "signature": "Approved by Purchasing"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-purchase-agent-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-purchase-agents.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-sales-agentsBulk

Bulk wrapper for create-general-sales-agent.

Runs create-general-sales-agent for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-sales-agent. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/sales-agent/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-sales-agents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-sales-agents",
  "payload": {
    "records": [
      {
        "code": "SAAPI",
        "salesAgent": "SAAPI",
        "description": "API Sales Agent",
        "desc2": "Sales Agent second description",
        "emailAddress": "sales@example.com",
        "approverEmailAddress": "approver@example.com"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-sales-agent-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-sales-agent
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-sales-agents-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-sales-agents",
  "payload": {
    "records": [
      {
        "code": "SAAPI",
        "salesAgent": "SAAPI",
        "description": "API Sales Agent",
        "desc2": "Sales Agent second description",
        "emailAddress": "sales@example.com",
        "approverEmailAddress": "approver@example.com"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-sales-agent-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-sales-agents.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-general-shipping-methodsBulk

Bulk wrapper for create-general-shipping-method.

Runs create-general-shipping-method for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-general-shipping-method. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/general-maintenance/shipping-method/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-general-shipping-methods-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-shipping-methods",
  "payload": {
    "records": [
      {
        "code": "LALAMOVE",
        "shippingMethod": "LALAMOVE",
        "description": "API Shipping Method",
        "desc2": "Shipping Method second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Shipping Method setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-shipping-method-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-general-shipping-method
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-general-shipping-methods-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-general-shipping-methods",
  "payload": {
    "records": [
      {
        "code": "LALAMOVE",
        "shippingMethod": "LALAMOVE",
        "description": "API Shipping Method",
        "desc2": "Shipping Method second description",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "Shipping Method setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-general-shipping-method-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-general-shipping-methods.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-gl-accountsBulk

Bulk wrapper for create-gl-account.

Runs create-gl-account for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-gl-account. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/chart-of-accounts/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-gl-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-gl-accounts",
  "payload": {
    "records": [
      {
        "accNo": "690-9000",
        "description": "API Expense Account",
        "desc2": "API expense second description",
        "accType": "EP",
        "parentAccNo": "610-0000",
        "currencyCode": "MYR",
        "cashFlowCategory": "OperatingActivities",
        "specialAccType": "Normal",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "GL account setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-gl-account-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-gl-account
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-gl-accounts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-gl-accounts",
  "payload": {
    "records": [
      {
        "accNo": "690-9000",
        "description": "API Expense Account",
        "desc2": "API expense second description",
        "accType": "EP",
        "parentAccNo": "610-0000",
        "currencyCode": "MYR",
        "cashFlowCategory": "OperatingActivities",
        "specialAccType": "Normal",
        "isActive": true,
        "remark1": "Created by API",
        "remark2": "GL account setup example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-gl-account-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-gl-accounts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-gl-cash-book-paymentsBulk

Bulk wrapper for create-gl-cash-book-payment.

Runs create-gl-cash-book-payment for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-gl-cash-book-payment. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/payment-voucher/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-gl-cash-book-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-gl-cash-book-payments",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "payTo": "API Supplier",
        "taxEntityID": 1,
        "description": "API payment voucher",
        "chequeNo": "PV-API-1001",
        "lines": [
          {
            "accNo": "610-0000",
            "accountNo": "610-0000",
            "description": "Expense line",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "PV-API-1001",
            "bankCharge": 0,
            "bankAccount": "110-0010",
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-gl-cash-book-payment-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-gl-cash-book-payment
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-gl-cash-book-payments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-gl-cash-book-payments",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "payTo": "API Supplier",
        "taxEntityID": 1,
        "description": "API payment voucher",
        "chequeNo": "PV-API-1001",
        "lines": [
          {
            "accNo": "610-0000",
            "accountNo": "610-0000",
            "description": "Expense line",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "PV-API-1001",
            "bankCharge": 0,
            "bankAccount": "110-0010",
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-gl-cash-book-payment-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-gl-cash-book-payments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-gl-cash-book-receiptsBulk

Bulk wrapper for create-gl-cash-book-receipt.

Runs create-gl-cash-book-receipt for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-gl-cash-book-receipt. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/official-receipt/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-gl-cash-book-receipts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-gl-cash-book-receipts",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "taxEntityID": 1,
        "description": "API official receipt",
        "chequeNo": "PV-API-1001",
        "lines": [
          {
            "accNo": "610-0000",
            "accountNo": "610-0000",
            "description": "Expense line",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "PV-API-1001",
            "bankCharge": 0,
            "bankAccount": "110-0010",
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        },
        "receiveFrom": "API Customer"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-gl-cash-book-receipt-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-gl-cash-book-receipt
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-gl-cash-book-receipts-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-gl-cash-book-receipts",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "taxEntityID": 1,
        "description": "API official receipt",
        "chequeNo": "PV-API-1001",
        "lines": [
          {
            "accNo": "610-0000",
            "accountNo": "610-0000",
            "description": "Expense line",
            "amount": 100,
            "taxType": "S-0",
            "taxCode": "S-0",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "PV-API-1001",
            "bankCharge": 0,
            "bankAccount": "110-0010",
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        },
        "receiveFrom": "API Customer"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-gl-cash-book-receipt-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-gl-cash-book-receipts.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-goods-received-notesBulk

Bulk wrapper for create-goods-received-note.

Runs create-goods-received-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-goods-received-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/goods-received-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-goods-received-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-goods-received-notes",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-goods-received-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-goods-received-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-goods-received-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-goods-received-notes",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-goods-received-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-goods-received-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-item-bomsBulk

Bulk wrapper for create-item-bom.

Runs create-item-bom for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-item-bom. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bom/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-item-boms-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-item-boms",
  "payload": {
    "records": [
      {
        "itemCode": "FINISHED-API",
        "updateBOMCost": true,
        "lines": [
          {
            "subItemCode": "RAW-API-1",
            "qty": 2
          },
          {
            "subItemCode": "RAW-API-2",
            "qty": 3
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-item-bom-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-item-bom
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-item-boms-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-item-boms",
  "payload": {
    "records": [
      {
        "itemCode": "FINISHED-API",
        "updateBOMCost": true,
        "lines": [
          {
            "subItemCode": "RAW-API-1",
            "qty": 2
          },
          {
            "subItemCode": "RAW-API-2",
            "qty": 3
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-item-bom-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-item-boms.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-item-packagesBulk

Bulk wrapper for create-item-package.

Runs create-item-package for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-item-package. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/item-package/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-item-packages-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-item-packages",
  "payload": {
    "records": [
      {
        "packageCode": "PKG-API",
        "description": "API Package",
        "unitPrice": 120,
        "isActive": true,
        "limitedQty": 10,
        "lines": [
          {
            "itemCode": "ITEM001",
            "qty": 1,
            "uom": "UNIT",
            "unitPrice": 100
          },
          {
            "itemCode": "ITEM002",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 10
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-item-package-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-item-package
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-item-packages-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-item-packages",
  "payload": {
    "records": [
      {
        "packageCode": "PKG-API",
        "description": "API Package",
        "unitPrice": 120,
        "isActive": true,
        "limitedQty": 10,
        "lines": [
          {
            "itemCode": "ITEM001",
            "qty": 1,
            "uom": "UNIT",
            "unitPrice": 100
          },
          {
            "itemCode": "ITEM002",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 10
          }
        ]
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-item-package-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-item-packages.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-itemsBulk

Bulk wrapper for create-item.

Runs create-item for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-item. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-item/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-items",
  "payload": {
    "records": [
      {
        "itemCode": "API-ITEM",
        "description": "API Test Item",
        "desc2": "API Item Second Description",
        "furtherDescription": "Long item note visible in AutoCount item detail.",
        "templateItemCode": "00004",
        "itemGroup": "FG",
        "itemType": "Stock",
        "itemBrand": "MACSOFT",
        "itemCategory": "API",
        "itemClass": "A",
        "tariffCode": "8471.30",
        "baseUom": "UNIT",
        "salesUom": "UNIT",
        "purchaseUom": "UNIT",
        "reportUom": "UNIT",
        "taxCode": "S-0",
        "purchaseTaxCode": "P-0",
        "defaultLocation": "HQ",
        "costingMethod": "Weighted Average",
        "standardCost": 80,
        "minimumSellingPrice": 90,
        "sellingPrice": 100,
        "purchasePrice": 80,
        "reorderLevel": 10,
        "normalLevel": 50,
        "minimumLevel": 5,
        "maximumLevel": 200,
        "isSalesItem": true,
        "isPurchaseItem": true,
        "stockControl": true,
        "hasBatchNo": false,
        "hasSerialNo": false,
        "snFormatName": "",
        "isActive": true,
        "uoms": [
          {
            "uom": "UNIT",
            "rate": 1,
            "price": 100,
            "cost": 80,
            "barCode": "9550000000011",
            "minSalePrice": 90,
            "maxSalePrice": 9999,
            "minQty": 15,
            "maxQty": 200
          },
          {
            "uom": "BOX",
            "rate": 12,
            "price": 1200,
            "cost": 960,
            "barCode": "9550000000012"
          }
        ],
        "subCodes": [
          {
            "subCode": "ALT-API-ITEM",
            "uom": "UNIT"
          }
        ],
        "priceBooks": [
          {
            "ref": "PB-API-ITEM",
            "priceCategory": "RETAIL",
            "uom": "UNIT",
            "fixedPrice": 100,
            "qty1": 1,
            "price1": 100
          }
        ],
        "customerPrices": [
          {
            "ref": "CP-API-ITEM",
            "debtorCode": "300-A001",
            "currencyCode": "MYR",
            "uom": "UNIT",
            "customerItemCode": "CUST-API-ITEM",
            "fixedPrice": 95,
            "qty1": 1,
            "price1": 95
          }
        ],
        "supplierPrices": [
          {
            "ref": "SP-API-ITEM",
            "creditorCode": "400-S001",
            "currencyCode": "MYR",
            "uom": "UNIT",
            "supplierItemCode": "SUP-API-ITEM",
            "fixedPrice": 80,
            "qty1": 1,
            "price1": 80
          }
        ],
        "openingBalances": [
          {
            "location": "HQ",
            "qty": 10,
            "uom": "UNIT",
            "unitCost": 80,
            "batchNo": "BATCH-001",
            "docDate": "2026-07-26"
          }
        ],
        "bomRows": [
          {
            "subItemCode": "API-COMPONENT",
            "qty": 2,
            "overheadCost": 0,
            "seq": 1,
            "costFraction": 1
          }
        ],
        "replacements": [
          {
            "replacementItemCode": "API-REPLACEMENT",
            "replacementDegree": 1,
            "note": "Alternative item"
          }
        ],
        "batchNo": "BATCH-001",
        "batchDescription": "Opening API batch",
        "remark1": "Created by API",
        "remark2": "Stock item full payload example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-item-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-item
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-items-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-items",
  "payload": {
    "records": [
      {
        "itemCode": "API-ITEM",
        "description": "API Test Item",
        "desc2": "API Item Second Description",
        "furtherDescription": "Long item note visible in AutoCount item detail.",
        "templateItemCode": "00004",
        "itemGroup": "FG",
        "itemType": "Stock",
        "itemBrand": "MACSOFT",
        "itemCategory": "API",
        "itemClass": "A",
        "tariffCode": "8471.30",
        "baseUom": "UNIT",
        "salesUom": "UNIT",
        "purchaseUom": "UNIT",
        "reportUom": "UNIT",
        "taxCode": "S-0",
        "purchaseTaxCode": "P-0",
        "defaultLocation": "HQ",
        "costingMethod": "Weighted Average",
        "standardCost": 80,
        "minimumSellingPrice": 90,
        "sellingPrice": 100,
        "purchasePrice": 80,
        "reorderLevel": 10,
        "normalLevel": 50,
        "minimumLevel": 5,
        "maximumLevel": 200,
        "isSalesItem": true,
        "isPurchaseItem": true,
        "stockControl": true,
        "hasBatchNo": false,
        "hasSerialNo": false,
        "snFormatName": "",
        "isActive": true,
        "uoms": [
          {
            "uom": "UNIT",
            "rate": 1,
            "price": 100,
            "cost": 80,
            "barCode": "9550000000011",
            "minSalePrice": 90,
            "maxSalePrice": 9999,
            "minQty": 15,
            "maxQty": 200
          },
          {
            "uom": "BOX",
            "rate": 12,
            "price": 1200,
            "cost": 960,
            "barCode": "9550000000012"
          }
        ],
        "subCodes": [
          {
            "subCode": "ALT-API-ITEM",
            "uom": "UNIT"
          }
        ],
        "priceBooks": [
          {
            "ref": "PB-API-ITEM",
            "priceCategory": "RETAIL",
            "uom": "UNIT",
            "fixedPrice": 100,
            "qty1": 1,
            "price1": 100
          }
        ],
        "customerPrices": [
          {
            "ref": "CP-API-ITEM",
            "debtorCode": "300-A001",
            "currencyCode": "MYR",
            "uom": "UNIT",
            "customerItemCode": "CUST-API-ITEM",
            "fixedPrice": 95,
            "qty1": 1,
            "price1": 95
          }
        ],
        "supplierPrices": [
          {
            "ref": "SP-API-ITEM",
            "creditorCode": "400-S001",
            "currencyCode": "MYR",
            "uom": "UNIT",
            "supplierItemCode": "SUP-API-ITEM",
            "fixedPrice": 80,
            "qty1": 1,
            "price1": 80
          }
        ],
        "openingBalances": [
          {
            "location": "HQ",
            "qty": 10,
            "uom": "UNIT",
            "unitCost": 80,
            "batchNo": "BATCH-001",
            "docDate": "2026-07-26"
          }
        ],
        "bomRows": [
          {
            "subItemCode": "API-COMPONENT",
            "qty": 2,
            "overheadCost": 0,
            "seq": 1,
            "costFraction": 1
          }
        ],
        "replacements": [
          {
            "replacementItemCode": "API-REPLACEMENT",
            "replacementDegree": 1,
            "note": "Alternative item"
          }
        ],
        "batchNo": "BATCH-001",
        "batchDescription": "Opening API batch",
        "remark1": "Created by API",
        "remark2": "Stock item full payload example"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-item-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-items.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-journal-entriesBulk

Bulk wrapper for create-journal-entry.

Runs create-journal-entry for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-journal-entry. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/gl-module/journal-entry/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-journal-entries-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-journal-entries",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "journalType": "JV",
        "description": "API journal entry",
        "refNo": "API-JV-1001",
        "lines": [
          {
            "accNo": "610-0000",
            "accountNo": "610-0000",
            "description": "Debit expense",
            "debit": 100,
            "credit": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "taxType": "S-0",
            "taxCode": "S-0",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accNo": "500-1000",
            "accountNo": "500-1000",
            "description": "Credit control",
            "debit": 0,
            "credit": 100,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "taxType": "S-0",
            "taxCode": "S-0",
            "classification": "022"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-journal-entry-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-journal-entry
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-journal-entries-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-journal-entries",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "journalType": "JV",
        "description": "API journal entry",
        "refNo": "API-JV-1001",
        "lines": [
          {
            "accNo": "610-0000",
            "accountNo": "610-0000",
            "description": "Debit expense",
            "debit": 100,
            "credit": 0,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "taxType": "S-0",
            "taxCode": "S-0",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          },
          {
            "accNo": "500-1000",
            "accountNo": "500-1000",
            "description": "Credit control",
            "debit": 0,
            "credit": 100,
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "taxType": "S-0",
            "taxCode": "S-0",
            "classification": "022"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-journal-entry-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-journal-entries.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-purchase-invoicesBulk

Bulk wrapper for create-purchase-invoice.

Runs create-purchase-invoice for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-purchase-invoice. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-invoice/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-purchase-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-purchase-invoices",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-purchase-invoice-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-purchase-invoice
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-purchase-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-purchase-invoices",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-purchase-invoice-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-purchase-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-purchase-ordersBulk

Bulk wrapper for create-purchase-order.

Runs create-purchase-order for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-purchase-order. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-order/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-purchase-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-purchase-orders",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-purchase-order-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-purchase-order
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-purchase-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-purchase-orders",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-purchase-order-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-purchase-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-purchase-returnsBulk

Bulk wrapper for create-purchase-return.

Runs create-purchase-return for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-purchase-return. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/purchase-module/purchase-return/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-purchase-returns-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-purchase-returns",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-purchase-return-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-purchase-return
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

creditorCode
supplier/creditor code
creditorName
supplier display name
purchaseAgent
purchase agent code
purchaseLocation
purchase/stock location
supplierInvoiceNo
supplier invoice number
supplierDONo
supplier delivery order number
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-purchase-returns-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-purchase-returns",
  "payload": {
    "records": [
      {
        "creditorCode": "400-S001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "purchaseLocation": "HQ",
        "purchaseAgent": "PA01",
        "attention": "Supplier Sales Department",
        "contact": "Supplier Sales Department",
        "phone": "03-33333333",
        "address1": "No. 2 Jalan Supplier",
        "address2": "Supplier Park",
        "address3": "Petaling Jaya",
        "address4": "Malaysia",
        "description": "Purchase document created through API",
        "supplierInvoiceNo": "SUP-INV-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API purchase item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 80,
            "discount": "0",
            "taxType": "P-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 160,
            "accountNo": "610-0000",
            "postingAccountNo": "610-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "610-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 80,
            "taxType": "P-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 100,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "BANK",
            "paymentBy": "Bank Transfer",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-purchase-return-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-purchase-returns.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-quotationsBulk

Bulk wrapper for create-quotation.

Runs create-quotation for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-quotation. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/bulk-module/quotation/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-quotations",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-quotation-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-quotation
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-quotations-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-quotations",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-quotation-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-quotations.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-sales-credit-notesBulk

Bulk wrapper for create-sales-credit-note.

Runs create-sales-credit-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-sales-credit-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-credit-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-sales-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-credit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-credit-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-sales-credit-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-sales-credit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-credit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-credit-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-sales-credit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-sales-debit-notesBulk

Bulk wrapper for create-sales-debit-note.

Runs create-sales-debit-note for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-sales-debit-note. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-debit-note/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-sales-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-debit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-debit-note-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-sales-debit-note
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-sales-debit-notes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-debit-notes",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-debit-note-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-sales-debit-notes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-sales-invoicesBulk

Bulk wrapper for create-sales-invoice.

Runs create-sales-invoice for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-sales-invoice. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-invoice/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-sales-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-invoices",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-invoice-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-sales-invoice
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-sales-invoices-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-invoices",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-invoice-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-sales-invoices.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-sales-ordersBulk

Bulk wrapper for create-sales-order.

Runs create-sales-order for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-sales-order. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/sales-module/sales-order/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-sales-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-orders",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-order-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-sales-order
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

Full Transaction Field Reference

header

debtorCode
customer/debtor code
debtorName
customer display name
salesAgent
sales agent code
salesLocation
sales location
multiPricing
price category/multi-pricing value
displayTerm
credit term
docNo
optional document number; omit to let AutoCount numbering generate it where supported
docDate
YYYY-MM-DD document date
dueDate
YYYY-MM-DD due date where supported
description
document narration/description
ref
reference
ourRef
our reference
yourRef
customer/supplier reference
currencyCode
currency code, for example MYR
currencyRate
currency exchange rate
inclusiveTax
true when prices include tax
taxDate
YYYY-MM-DD tax date
branchCode
debtor/creditor branch code/name where account book uses branches
userDefinedFields
object of AutoCount user-defined fields
verifyAfterSave
optional boolean; false keeps save fast, true reloads the saved record and returns readBack checks/differences where the connector has a safe get path

contactAndAddress

attention
attention/contact person
contact
alias for attention/contact person
phone1
primary phone
phone
alias for phone1
phone2
secondary phone/mobile
fax1
fax
fax
alias for fax1
address1
address line 1
address2
address line 2
address3
address line 3
address4
address line 4
deliverAddress1
delivery address line 1
deliverAddress2
delivery address line 2
deliverAddress3
delivery address line 3
deliverAddress4
delivery address line 4
deliverContact
delivery contact
deliverPhone1
delivery phone

lines

itemCode
AutoCount item code
barCode
barcode shown/used by item line
description
line description
description2
line second description
furtherDescription
long/further line description
qty
quantity
uom
UOM
unitPrice
unit price
unitCost
unit cost where supported
discount
discount string/amount
taxType
tax type/code alias
taxCode
tax code alias
taxRate
tax rate
taxAmount
tax amount
amount
line amount
location
stock location
fromLocation
source location
toLocation
destination location
batchNo
batch number
serialNo
serial number
project
project code
projNo
project code alias
department
department code
deptNo
department code alias
classification
classification code
deliveryDate
YYYY-MM-DD delivery date
userDefinedFields
object of line user-defined fields

payments

paymentMethod
AutoCount Payment Method code
paymentBy
payment type such as Cash, Cheque, Bank Transfer, Credit Card
paymentAmount
payment amount
amount
payment amount alias where supported
chequeNo
cheque/reference number
bankCharge
bank charge amount
bankAccount
bank/cash GL account
paymentAccountNo
bank/cash GL account alias
bankChargeAccountNo
bank charge GL account
creditCardApprovalCode
card approval/reference code
userDefinedFields
object of payment user-defined fields

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-sales-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-sales-orders",
  "payload": {
    "records": [
      {
        "debtorCode": "300-A001",
        "docDate": "2026-06-24",
        "displayTerm": "30 DAYS",
        "branchCode": "MAIN",
        "salesLocation": "HQ",
        "multiPricing": "Price 1",
        "salesAgent": "SA01",
        "attention": "Purchasing Department",
        "contact": "Purchasing Department",
        "deliverContact": "Store Receiver",
        "deliverPhone1": "012-3456789",
        "phone": "03-11111111",
        "address1": "No. 1 Jalan API",
        "address2": "Taman Integration",
        "address3": "Kuala Lumpur",
        "address4": "Malaysia",
        "description": "Sales document created through API",
        "ref": "WEB-ORDER-1001",
        "currencyCode": "MYR",
        "inclusiveTax": false,
        "taxEntityID": 1,
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "API item line 1",
            "description2": "Line second description",
            "furtherDescription": "Optional longer line note",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitPrice": 100,
            "discount": "5%",
            "taxType": "S-0",
            "taxRate": 0,
            "taxAmount": 0,
            "amount": 190,
            "accountNo": "500-0000",
            "location": "HQ",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "deliveryDate": "2026-06-30",
            "userDefinedFields": {
              "APITEST": "Blue"
            }
          },
          {
            "accountNo": "500-0000",
            "description": "Service/account line without itemCode",
            "qty": 1,
            "unitPrice": 50,
            "taxType": "S-0",
            "location": "HQ",
            "project": "PRJAPI",
            "department": "HQ"
          }
        ],
        "payments": [
          {
            "paymentMethod": "CASH",
            "paymentBy": "Cash",
            "paymentAmount": 130,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": ""
          },
          {
            "paymentMethod": "CARD",
            "paymentBy": "Credit Card",
            "paymentAmount": 60,
            "chequeNo": "",
            "bankCharge": 0,
            "paymentAccountNo": "110-0010",
            "bankChargeAccountNo": "810-0000",
            "creditCardApprovalCode": "APPROVED-001"
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-sales-order-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-sales-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-adjustmentsBulk

Bulk wrapper for create-stock-adjustment.

Runs create-stock-adjustment for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-adjustment. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-adjustment/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-adjustments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-adjustments",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-adjustment-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-adjustment
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-adjustments-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-adjustments",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-adjustment-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-adjustments.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-assembliesBulk

Bulk wrapper for create-stock-assembly.

Runs create-stock-assembly for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-assembly. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/bulk/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-assemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-assemblies",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "itemCode": "FINISHED-API",
        "description": "Stock assembly created through API",
        "location": "HQ",
        "qty": 1,
        "uom": "UNIT",
        "unitCost": 100,
        "detailMode": "replace",
        "lines": [
          {
            "lineNo": 1,
            "itemCode": "RAW-API-1",
            "description": "Raw material 1",
            "qty": 2,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 10,
            "batchNo": "BATCH-001",
            "serialNo": ""
          },
          {
            "lineNo": 2,
            "itemCode": "RAW-API-2",
            "description": "Raw material 2",
            "qty": 3,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 5,
            "batchNo": "",
            "serialNo": ""
          }
        ],
        "reason": "correct assembly detail"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-assembly-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-assembly
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-assemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-assemblies",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "itemCode": "FINISHED-API",
        "description": "Stock assembly created through API",
        "location": "HQ",
        "qty": 1,
        "uom": "UNIT",
        "unitCost": 100,
        "detailMode": "replace",
        "lines": [
          {
            "lineNo": 1,
            "itemCode": "RAW-API-1",
            "description": "Raw material 1",
            "qty": 2,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 10,
            "batchNo": "BATCH-001",
            "serialNo": ""
          },
          {
            "lineNo": 2,
            "itemCode": "RAW-API-2",
            "description": "Raw material 2",
            "qty": 3,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 5,
            "batchNo": "",
            "serialNo": ""
          }
        ],
        "reason": "correct assembly detail"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-assembly-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-assemblies.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-assembly-ordersBulk

Bulk wrapper for create-stock-assembly-order.

Runs create-stock-assembly-order for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-assembly-order. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/assembly-order/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-assembly-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-assembly-orders",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "itemCode": "FINISHED-API",
        "description": "Stock assembly order created through API",
        "location": "HQ",
        "qty": 1,
        "uom": "UNIT",
        "unitCost": 100,
        "detailMode": "replace",
        "lines": [
          {
            "lineNo": 1,
            "itemCode": "RAW-API-1",
            "description": "Raw material 1",
            "qty": 2,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 10,
            "batchNo": "BATCH-001",
            "serialNo": ""
          },
          {
            "lineNo": 2,
            "itemCode": "RAW-API-2",
            "description": "Raw material 2",
            "qty": 3,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 5,
            "batchNo": "",
            "serialNo": ""
          }
        ],
        "reason": "correct assembly detail"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-assembly-order-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-assembly-order
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-assembly-orders-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-assembly-orders",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "itemCode": "FINISHED-API",
        "description": "Stock assembly order created through API",
        "location": "HQ",
        "qty": 1,
        "uom": "UNIT",
        "unitCost": 100,
        "detailMode": "replace",
        "lines": [
          {
            "lineNo": 1,
            "itemCode": "RAW-API-1",
            "description": "Raw material 1",
            "qty": 2,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 10,
            "batchNo": "BATCH-001",
            "serialNo": ""
          },
          {
            "lineNo": 2,
            "itemCode": "RAW-API-2",
            "description": "Raw material 2",
            "qty": 3,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 5,
            "batchNo": "",
            "serialNo": ""
          }
        ],
        "reason": "correct assembly detail"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-assembly-order-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-assembly-orders.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-disassembliesBulk

Bulk wrapper for create-stock-disassembly.

Runs create-stock-disassembly for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-disassembly. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/disassembly/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-disassemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-disassemblies",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "itemCode": "FINISHED-API",
        "description": "Stock disassembly created through API",
        "location": "HQ",
        "qty": 1,
        "uom": "UNIT",
        "unitCost": 100,
        "detailMode": "replace",
        "lines": [
          {
            "lineNo": 1,
            "itemCode": "RAW-API-1",
            "description": "Raw material 1",
            "qty": 2,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 10,
            "batchNo": "BATCH-001",
            "serialNo": ""
          },
          {
            "lineNo": 2,
            "itemCode": "RAW-API-2",
            "description": "Raw material 2",
            "qty": 3,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 5,
            "batchNo": "",
            "serialNo": ""
          }
        ],
        "reason": "correct assembly detail"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-disassembly-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-disassembly
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-disassemblies-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-disassemblies",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "itemCode": "FINISHED-API",
        "description": "Stock disassembly created through API",
        "location": "HQ",
        "qty": 1,
        "uom": "UNIT",
        "unitCost": 100,
        "detailMode": "replace",
        "lines": [
          {
            "lineNo": 1,
            "itemCode": "RAW-API-1",
            "description": "Raw material 1",
            "qty": 2,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 10,
            "batchNo": "BATCH-001",
            "serialNo": ""
          },
          {
            "lineNo": 2,
            "itemCode": "RAW-API-2",
            "description": "Raw material 2",
            "qty": 3,
            "uom": "UNIT",
            "location": "HQ",
            "unitCost": 5,
            "batchNo": "",
            "serialNo": ""
          }
        ],
        "reason": "correct assembly detail"
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-disassembly-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-disassemblies.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-issuesBulk

Bulk wrapper for create-stock-issue.

Runs create-stock-issue for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-issue. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-issue/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-issues-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-issues",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-issue-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-issue
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-issues-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-issues",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-issue-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-issues.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-receivesBulk

Bulk wrapper for create-stock-receive.

Runs create-stock-receive for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-receive. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-receive/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-receives-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-receives",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-receive-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-receive
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-receives-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-receives",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-receive-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-receives.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-takesBulk

Bulk wrapper for create-stock-take.

Runs create-stock-take for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-take. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-take/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-takes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-takes",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-take-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-take
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-takes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-takes",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-take-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-takes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-transfersBulk

Bulk wrapper for create-stock-transfer.

Runs create-stock-transfer for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-transfer. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-transfer/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-transfers-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-transfers",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-transfer-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-transfer
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-transfers-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-transfers",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-transfer-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-transfers.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-uom-conversionsBulk

Bulk wrapper for create-stock-uom-conversion.

Runs create-stock-uom-conversion for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-uom-conversion. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/uom-conversion/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-uom-conversions-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-uom-conversions",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-uom-conversion-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-uom-conversion
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-uom-conversions-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-uom-conversions",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-uom-conversion-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-uom-conversions.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-update-costsBulk

Bulk wrapper for create-stock-update-cost.

Runs create-stock-update-cost for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-update-cost. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-update-cost/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-update-costs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-update-costs",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-update-cost-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-update-cost
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-update-costs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-update-costs",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-update-cost-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-update-costs.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
bulk-create-stock-write-offsBulk

Bulk wrapper for create-stock-write-off.

Runs create-stock-write-off for each record on the local connector without waiting one cloud heartbeat per row. Bulk records use the same fields as create-stock-write-off. Split very large imports into batches so AutoCount and the connector can report row-level results clearly.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/stock-module/stock-write-off/bulk-create

Full JSON Payload

{
  "commandId": "bulk-create-stock-write-offs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-write-offs",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-write-off-batch-20260624"
  }
}

Payload Fields

records
required array; each row uses the same payload as create-stock-write-off
stopOnError
optional boolean; stop the batch when a row fails
dryRun
optional boolean; validate without saving where supported
idempotencyKey
optional caller batch key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "bulk-create-stock-write-offs-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "bulk-create-stock-write-offs",
  "payload": {
    "records": [
      {
        "docDate": "2026-06-24",
        "description": "Stock document created through API",
        "reason": "API stock operation",
        "location": "HQ",
        "fromLocation": "HQ",
        "toLocation": "STORE",
        "project": "PRJAPI",
        "department": "HQ",
        "lines": [
          {
            "itemCode": "ITEM001",
            "description": "Stock line 1",
            "description2": "Stock line second description",
            "barCode": "9550000000011",
            "qty": 2,
            "uom": "UNIT",
            "unitCost": 80,
            "unitPrice": 100,
            "location": "HQ",
            "fromLocation": "HQ",
            "toLocation": "STORE",
            "batchNo": "BATCH-001",
            "serialNo": "SN-0001",
            "project": "PRJAPI",
            "projNo": "PRJAPI",
            "department": "HQ",
            "deptNo": "HQ",
            "classification": "022",
            "userDefinedFields": {
              "APITEST": "API-LINE"
            }
          }
        ],
        "userDefinedFields": {
          "APITEST": "API"
        }
      }
    ],
    "stopOnError": true,
    "dryRun": false,
    "idempotencyKey": "create-stock-write-off-batch-20260624"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to bulk-create-stock-write-offs.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.

Tax

Tax code, tax entity, tariff, withholding tax, GST/SST reads, and taxEntityID usage for e-Invoice fields.

list-gst-processorsRead

List GST processors.

Uses AutoCount.Tax.MalaysiaGST.GSTProcessor.GSTProcessorCommand.LoadGSTProcessorTable.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-gst-processors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gst-processors",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-gst-processors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-gst-processors",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-gst-processors.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-sst-processorsRead

List SST processors.

Uses AutoCount.Tax.MalaysiaGST.SSTProcessor.SSTProcessorCommand.LoadSSTProcessorTable.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-sst-processors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sst-processors",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-sst-processors-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-sst-processors",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-sst-processors.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-tariff-codesRead

List tariff codes.

Uses AutoCount.GeneralMaint.Tariff.TariffCommand.LoadBrowseTable.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-tariff-codes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tariff-codes",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-tariff-codes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tariff-codes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-tariff-codes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-tax-codesRead

Alias for list-tax-types; lists all AutoCount tax codes.

Cloud and local connector normalize this to list-tax-types before execution.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-tax-codes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tax-codes",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-tax-codes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tax-codes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-tax-codes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-tax-entitiesRead

List tax entities from the account book.

Uses AutoCount.Tax.TaxEntityMaintenance.TaxEntityCommand.LoadDataTable.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-tax-entities-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tax-entities",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-tax-entities-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tax-entities",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-tax-entities.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-tax-typesRead

List all tax codes from the account book.

Uses AutoCount.Tax.TaxCodeMaintenance.TaxCodeCommand.LoadBrowseTable. Alias accepted: list-tax-codes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-tax-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tax-types",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-tax-types-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-tax-types",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-tax-types.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
list-withholding-tax-codesRead

List withholding tax codes.

Uses AutoCount.Tax.WithholdingTax.WithholdingTaxCommand.LoadBrowseTable.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "list-withholding-tax-codes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-withholding-tax-codes",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "list-withholding-tax-codes-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "list-withholding-tax-codes",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to list-withholding-tax-codes.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-gst-settingsRead

Read GST settings.

Reads settings from available account-book GST tables.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "read-gst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gst-settings",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-gst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-gst-settings",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-gst-settings.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
read-sst-settingsRead

Read SST settings.

Reads settings from available account-book SST tables.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/list

Full JSON Payload

{
  "commandId": "read-sst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sst-settings",
  "payload": {}
}

Payload Fields

No payload fields required.

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "read-sst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "read-sst-settings",
  "payload": {}
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to read-sst-settings.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-gst-processorRead

Get one GST processor by key.

Uses AutoCount.Tax.MalaysiaGST.GSTProcessor.GSTProcessorCommand.ViewGSTProcessor.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-gst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gst-processor",
  "payload": {
    "key": 1
  }
}

Payload Fields

key
required processor key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-gst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-gst-processor",
  "payload": {
    "key": 1
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-gst-processor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-sst-processorRead

Get one SST processor by key.

Uses AutoCount.Tax.MalaysiaGST.SSTProcessor.SSTProcessorCommand.ViewSSTProcessor.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-sst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sst-processor",
  "payload": {
    "key": 1
  }
}

Payload Fields

key
required processor key

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-sst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-sst-processor",
  "payload": {
    "key": 1
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-sst-processor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-tariff-codeRead

Get one tariff code.

Uses AutoCount.GeneralMaint.Tariff.TariffCommand.GetTariff.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tariff-code",
  "payload": {
    "code": "API-TAR"
  }
}

Payload Fields

code
required tariff code

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tariff-code",
  "payload": {
    "code": "API-TAR"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-tariff-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-tax-codeRead

Alias for get-tax-type; gets one AutoCount tax code.

Cloud and local connector normalize this to get-tax-type before execution.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tax-code",
  "payload": {
    "taxCode": "S-0"
  }
}

Payload Fields

code
required tax code
taxCode
optional alias for code

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tax-code",
  "payload": {
    "taxCode": "S-0"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-tax-entityRead

Get one tax entity by id, code, or name.

Reads account-book tax entity data without direct SQL writes.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tax-entity",
  "payload": {
    "code": "MY"
  }
}

Payload Fields

code
required tax entity id/code/name

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tax-entity",
  "payload": {
    "code": "MY"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-tax-entity.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-tax-typeRead

Get one tax code by code.

Reads one account-book tax setup row without direct SQL writes. Alias accepted: get-tax-code.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tax-type",
  "payload": {
    "code": "S-0"
  }
}

Payload Fields

code
required tax type or tax code
taxCode
optional alias for code

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-tax-type",
  "payload": {
    "code": "S-0"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-tax-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
get-withholding-tax-codeRead

Get one withholding tax code.

Uses AutoCount.Tax.WithholdingTax.WithholdingTaxCommand.GetWithholdingTax.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/get

Full JSON Payload

{
  "commandId": "get-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-withholding-tax-code",
  "payload": {
    "code": "WHT-API"
  }
}

Payload Fields

code
required withholding tax code

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "get-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "get-withholding-tax-code",
  "payload": {
    "code": "WHT-API"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to get-withholding-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
validate-taxpayer-tinValidate

Validate a taxpayer TIN through AutoCount AIP/MyInvois using the account book's e-Invoice settings.

No raw AutoCount AIP key is accepted or returned. Returns valid=true or false when AutoCount completes the validation.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/validate

Full JSON Payload

{
  "commandId": "validate-taxpayer-tin-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-taxpayer-tin",
  "payload": {
    "tin": "C1234567890",
    "idType": "BRN",
    "idValue": "202101012345"
  }
}

Payload Fields

tin
required tax identification number
idType
required identity type such as BRN, NRIC, PASSPORT, or ARMY
idValue
required identity or registration number

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "validate-taxpayer-tin-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "validate-taxpayer-tin",
  "payload": {
    "tin": "C1234567890",
    "idType": "BRN",
    "idValue": "202101012345"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to validate-taxpayer-tin.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-gst-paymentCreate

Guarded GST payment request.

Returns createBlocked until fresh-account-book proof confirms the AutoCount GSTPaymentCommand workflow.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-gst-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gst-payment",
  "payload": {
    "processorKey": 1,
    "paymentDate": "2026-04-30",
    "reason": "record GST payment"
  }
}

Payload Fields

processorKey
required GST processor key
paymentDate
YYYY-MM-DD optional
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-gst-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gst-payment",
  "payload": {
    "processorKey": 1,
    "paymentDate": "2026-04-30",
    "reason": "record GST payment"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-gst-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-gst-processorCreate

Guarded GST processor create request.

Returns createBlocked until fresh-account-book proof confirms generated journals, audit trail, and recovery behavior.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-gst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gst-processor",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-03-31",
    "reason": "prepare GST return"
  }
}

Payload Fields

fromDate
YYYY-MM-DD optional
toDate
YYYY-MM-DD optional
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-gst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-gst-processor",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-03-31",
    "reason": "prepare GST return"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-gst-processor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-sst-paymentCreate

Guarded SST payment request.

Returns createBlocked until fresh-account-book proof confirms the AutoCount SSTPaymentCommand workflow.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-sst-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sst-payment",
  "payload": {
    "processorKey": 1,
    "paymentDate": "2026-03-31",
    "reason": "record SST payment"
  }
}

Payload Fields

processorKey
required SST processor key
paymentDate
YYYY-MM-DD optional
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-sst-payment-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sst-payment",
  "payload": {
    "processorKey": 1,
    "paymentDate": "2026-03-31",
    "reason": "record SST payment"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-sst-payment.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-sst-processorCreate

Guarded SST processor create request.

Returns createBlocked until fresh-account-book proof confirms generated journals, audit trail, and recovery behavior.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-sst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sst-processor",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-02-28",
    "reason": "prepare SST return"
  }
}

Payload Fields

fromDate
YYYY-MM-DD optional
toDate
YYYY-MM-DD optional
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-sst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-sst-processor",
  "payload": {
    "fromDate": "2026-01-01",
    "toDate": "2026-02-28",
    "reason": "prepare SST return"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-sst-processor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-tariff-codeCreate

Create a tariff code.

Uses AutoCount.GeneralMaint.Tariff.TariffCommand.NewTariff and SaveTariff.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tariff-code",
  "payload": {
    "code": "API-TAR",
    "description": "API tariff",
    "taxType": "S-0"
  }
}

Payload Fields

code
required tariff code
description
optional
taxType
optional
bankChargeTaxType
optional
withholdingTaxCode
optional
withholdingTaxRate
optional

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tariff-code",
  "payload": {
    "code": "API-TAR",
    "description": "API tariff",
    "taxType": "S-0"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-tariff-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-tax-codeCreate

Alias for create-tax-type; creates an AutoCount tax code.

Cloud and local connector normalize this to create-tax-type before execution.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tax-code",
  "payload": {
    "code": "S-API",
    "description": "API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S"
  }
}

Payload Fields

code
required tax code
description
optional
taxRate
optional rate/percentage
supplyPurchase
optional S or P style AutoCount value

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tax-code",
  "payload": {
    "code": "S-API",
    "description": "API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-tax-entityCreate

Create a tax entity.

Uses AutoCount.Tax.TaxEntityMaintenance.TaxEntityCommand.New and TaxEntity.Save.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tax-entity",
  "payload": {
    "name": "API Tax Entity Sdn Bhd",
    "tin": "C1234567890",
    "identityNo": "202601010001",
    "identityType": "BRN",
    "countryCode": "MYS"
  }
}

Payload Fields

name
required company/person name
tin
optional TIN
identityNo
optional identity or registration number
identityType
optional AutoCount/e-Invoice identity type
address
optional address
postCode
optional post code
city
optional city
stateCode
optional state code
countryCode
optional country code
phone
optional phone
emailAddress
optional email
msicCode
optional MSIC code
businessActivityDesc
optional business activity
taxCategory
optional AutoCount tax category
taxClassification
optional AutoCount tax classification
salesTaxRegisterNo
optional
serviceTaxRegisterNo
optional
gstRegisterNo
optional
tourismTaxRegisterNo
optional

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tax-entity",
  "payload": {
    "name": "API Tax Entity Sdn Bhd",
    "tin": "C1234567890",
    "identityNo": "202601010001",
    "identityType": "BRN",
    "countryCode": "MYS"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-tax-entity.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-tax-typeCreate

Create a tax code.

Uses AutoCount.Tax.TaxCodeMaintenance.TaxCodeCommand.NewTaxCode and SaveTaxCode.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tax-type",
  "payload": {
    "code": "S-API",
    "description": "API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S",
    "isActive": true
  }
}

Payload Fields

code
required tax code
description
optional
taxRate
optional rate/percentage
supplyPurchase
optional S or P style AutoCount value
taxAccNo
optional GL tax account
govtTaxCode
optional government tax code
isActive
optional boolean/AutoCount flag
isDefault
optional boolean/AutoCount flag
isZeroRate
optional boolean/AutoCount flag
useTrxTaxAccNo
optional boolean/AutoCount flag
accountingBasis
optional AutoCount accounting basis
addToCost
optional boolean/AutoCount flag

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-tax-type",
  "payload": {
    "code": "S-API",
    "description": "API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S",
    "isActive": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-tax-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
create-withholding-tax-codeCreate

Create a withholding tax code.

Uses AutoCount.Tax.WithholdingTax.WithholdingTaxCommand.NewWithholdingTax and SaveWithholdingTax.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/create

Full JSON Payload

{
  "commandId": "create-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-withholding-tax-code",
  "payload": {
    "code": "WHT-API",
    "withholdingTaxRate": 2,
    "description": "API withholding tax"
  }
}

Payload Fields

code
required withholding tax code
withholdingTaxRate
optional rate
withholdingTaxAccNo
optional GL account
description
optional

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "create-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "create-withholding-tax-code",
  "payload": {
    "code": "WHT-API",
    "withholdingTaxRate": 2,
    "description": "API withholding tax"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to create-withholding-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gst-processorEdit

Guarded GST processor edit request.

Returns editBlocked until fresh-account-book proof confirms generated journals, audit trail, and recovery behavior.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-gst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gst-processor",
  "payload": {
    "key": 1,
    "reason": "correct period"
  }
}

Payload Fields

key
required processor key
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gst-processor",
  "payload": {
    "key": 1,
    "reason": "correct period"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gst-processor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-gst-settingsEdit

Guarded GST settings update request.

Returns editBlocked until the exact AutoCount SDK save workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-gst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gst-settings",
  "payload": {
    "reason": "configure tax period",
    "settings": {}
  }
}

Payload Fields

reason
required business reason
settings
object with intended setting changes

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-gst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-gst-settings",
  "payload": {
    "reason": "configure tax period",
    "settings": {}
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-gst-settings.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-sst-processorEdit

Guarded SST processor edit request.

Returns editBlocked until fresh-account-book proof confirms generated journals, audit trail, and recovery behavior.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-sst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sst-processor",
  "payload": {
    "key": 1,
    "reason": "correct period"
  }
}

Payload Fields

key
required processor key
reason
required business reason

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-sst-processor-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sst-processor",
  "payload": {
    "key": 1,
    "reason": "correct period"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-sst-processor.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-sst-settingsEdit

Guarded SST settings update request.

Returns editBlocked until the exact AutoCount SDK save workflow is proven.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-sst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sst-settings",
  "payload": {
    "reason": "configure SST period",
    "settings": {}
  }
}

Payload Fields

reason
required business reason
settings
object with intended setting changes

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-sst-settings-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-sst-settings",
  "payload": {
    "reason": "configure SST period",
    "settings": {}
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-sst-settings.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-tariff-codeEdit

Update a tariff code.

Uses AutoCount.GeneralMaint.Tariff.TariffCommand.GetTariff and SaveTariff.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tariff-code",
  "payload": {
    "code": "API-TAR",
    "description": "Updated API tariff"
  }
}

Payload Fields

code
required tariff code
description
optional
taxType
optional
bankChargeTaxType
optional
withholdingTaxCode
optional
withholdingTaxRate
optional

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tariff-code",
  "payload": {
    "code": "API-TAR",
    "description": "Updated API tariff"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-tariff-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-tax-codeEdit

Alias for update-tax-type; updates an AutoCount tax code.

Cloud and local connector normalize this to update-tax-type before execution.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tax-code",
  "payload": {
    "code": "S-API",
    "description": "Updated API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S"
  }
}

Payload Fields

code
required tax code
description
optional
taxRate
optional rate/percentage
supplyPurchase
optional S or P style AutoCount value

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tax-code",
  "payload": {
    "code": "S-API",
    "description": "Updated API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-tax-entityEdit

Update a tax entity.

Uses AutoCount.Tax.TaxEntityMaintenance.TaxEntityCommand.Edit and TaxEntity.Save.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tax-entity",
  "payload": {
    "taxEntityID": 1,
    "name": "Updated API Tax Entity Sdn Bhd",
    "countryCode": "MYS"
  }
}

Payload Fields

taxEntityID
required numeric TaxEntityID
name
optional company/person name
tin
optional TIN
identityNo
optional identity or registration number
identityType
optional AutoCount/e-Invoice identity type
address
optional address
postCode
optional post code
city
optional city
stateCode
optional state code
countryCode
optional country code
phone
optional phone
emailAddress
optional email
msicCode
optional MSIC code
businessActivityDesc
optional business activity
taxCategory
optional AutoCount tax category
taxClassification
optional AutoCount tax classification
salesTaxRegisterNo
optional
serviceTaxRegisterNo
optional
gstRegisterNo
optional
tourismTaxRegisterNo
optional

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tax-entity",
  "payload": {
    "taxEntityID": 1,
    "name": "Updated API Tax Entity Sdn Bhd",
    "countryCode": "MYS"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-tax-entity.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-tax-typeEdit

Update a tax code.

Uses AutoCount.Tax.TaxCodeMaintenance.TaxCodeCommand.GetTaxCode and SaveTaxCode.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tax-type",
  "payload": {
    "code": "S-API",
    "description": "Updated API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S",
    "isActive": true
  }
}

Payload Fields

code
required tax code
description
optional
taxRate
optional rate/percentage
supplyPurchase
optional S or P style AutoCount value
taxAccNo
optional GL tax account
govtTaxCode
optional government tax code
isActive
optional boolean/AutoCount flag
isDefault
optional boolean/AutoCount flag
isZeroRate
optional boolean/AutoCount flag
useTrxTaxAccNo
optional boolean/AutoCount flag
accountingBasis
optional AutoCount accounting basis
addToCost
optional boolean/AutoCount flag

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-tax-type",
  "payload": {
    "code": "S-API",
    "description": "Updated API sales tax",
    "taxRate": 8,
    "supplyPurchase": "S",
    "isActive": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-tax-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
update-withholding-tax-codeEdit

Update a withholding tax code.

Uses AutoCount.Tax.WithholdingTax.WithholdingTaxCommand.GetWithholdingTax and SaveWithholdingTax.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/edit

Full JSON Payload

{
  "commandId": "update-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-withholding-tax-code",
  "payload": {
    "code": "WHT-API",
    "withholdingTaxRate": 3
  }
}

Payload Fields

code
required withholding tax code
withholdingTaxRate
optional rate
withholdingTaxAccNo
optional GL account
description
optional

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "update-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "update-withholding-tax-code",
  "payload": {
    "code": "WHT-API",
    "withholdingTaxRate": 3
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to update-withholding-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-tariff-codewrite

Change a tariff code.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/change-tariff-code

Full JSON Payload

{
  "commandId": "change-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tariff-code",
  "payload": {
    "oldTariffCode": "OLD-TAR",
    "newTariffCode": "NEW-TAR",
    "confirm": true
  }
}

Payload Fields

oldTariffCode
required old value for oldTariffCode
newTariffCode
required new value for newTariffCode
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-tariff-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tariff-code",
  "payload": {
    "oldTariffCode": "OLD-TAR",
    "newTariffCode": "NEW-TAR",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-tariff-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-tax-branch-idwrite

Change a tax branch ID for a taxpayer.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/change-tax-branch-id

Full JSON Payload

{
  "commandId": "change-tax-branch-id-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tax-branch-id",
  "payload": {
    "tin": "C1234567890",
    "oldTaxBranchID": "001",
    "newTaxBranchID": "002",
    "confirm": true
  }
}

Payload Fields

tin
required taxpayer TIN
oldTaxBranchID
required old value for oldTaxBranchID
newTaxBranchID
required new value for newTaxBranchID
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-tax-branch-id-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tax-branch-id",
  "payload": {
    "tin": "C1234567890",
    "oldTaxBranchID": "001",
    "newTaxBranchID": "002",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-tax-branch-id.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-tax-codewrite

Change a tax code.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/change-tax-code

Full JSON Payload

{
  "commandId": "change-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tax-code",
  "payload": {
    "oldTaxCode": "OLD-TAX",
    "newTaxCode": "NEW-TAX",
    "confirm": true
  }
}

Payload Fields

oldTaxCode
required old value for oldTaxCode
newTaxCode
required new value for newTaxCode
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tax-code",
  "payload": {
    "oldTaxCode": "OLD-TAX",
    "newTaxCode": "NEW-TAX",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-tax-typewrite

Change a tax type (currently write-disabled).

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities. Current connector mutation is BLOCKED: complete native reference verification is not proven; TSM also lacks the native procedure. Loving procedure availability is not inferred. Schema/preflight availability does not enable writes; no guard bypass or procedure creation is supported.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/change-tax-type

Full JSON Payload

{
  "commandId": "change-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tax-type",
  "payload": {
    "oldTaxType": "OLD-TYPE",
    "newTaxType": "NEW-TYPE",
    "confirm": true
  }
}

Payload Fields

oldTaxType
required old value for oldTaxType
newTaxType
required new value for newTaxType
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-tax-type-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tax-type",
  "payload": {
    "oldTaxType": "OLD-TYPE",
    "newTaxType": "NEW-TYPE",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-tax-type.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-tinwrite

Change a taxpayer TIN.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/change-tin

Full JSON Payload

{
  "commandId": "change-tin-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tin",
  "payload": {
    "oldTIN": "C1234567890",
    "newTIN": "C1098765432",
    "confirm": true
  }
}

Payload Fields

oldTIN
required old value for oldTIN
newTIN
required new value for newTIN
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-tin-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-tin",
  "payload": {
    "oldTIN": "C1234567890",
    "newTIN": "C1098765432",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-tin.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
change-withholding-tax-codewrite

Change a withholding tax code.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/change-withholding-tax-code

Full JSON Payload

{
  "commandId": "change-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-withholding-tax-code",
  "payload": {
    "oldWithholdingTaxCode": "OLD-WHT",
    "newWithholdingTaxCode": "NEW-WHT",
    "confirm": true
  }
}

Payload Fields

oldWithholdingTaxCode
required old value for oldWithholdingTaxCode
newWithholdingTaxCode
required new value for newWithholdingTaxCode
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Edit permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "change-withholding-tax-code-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "change-withholding-tax-code",
  "payload": {
    "oldWithholdingTaxCode": "OLD-WHT",
    "newWithholdingTaxCode": "NEW-WHT",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to change-withholding-tax-code.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
merge-tax-entitywrite

Merge one tax entity into another.

Cloud validates and queues this typed command; it does not perform accounting work. Set validateOnly:true for preflight, then use a distinct commandId for the actual save. Reuse an ID only for an identical request. Runtime availability is connector-specific and reported by read-change-code-capabilities. Merge is classified as Delete and is full-actor-only because no tax access-right module exists in the cloud key model. The info strings are audit labels, not entity objects; the connector must resolve both existing entities from their IDs and verify their identity/TIN before calling native MergeTaxEntity.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/merge-tax-entity

Full JSON Payload

{
  "commandId": "merge-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "merge-tax-entity",
  "payload": {
    "oldTaxEntityID": 1,
    "taxEntityInfo": "source audit label",
    "newTaxEntityID": 2,
    "newTaxEntityInfo": "target audit label",
    "confirm": true
  }
}

Payload Fields

oldTaxEntityID
required positive int32 source tax entity ID
taxEntityInfo
required source audit label; not entity data
newTaxEntityID
required positive int32 target tax entity ID, different from oldTaxEntityID
newTaxEntityInfo
required target audit label; not entity data
validateOnly
optional boolean; true runs this command as a no-change preflight and still requires Delete permission
confirm
required true for an actual save; not required when validateOnly is true

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "merge-tax-entity-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "merge-tax-entity",
  "payload": {
    "oldTaxEntityID": 1,
    "taxEntityInfo": "source audit label",
    "newTaxEntityID": 2,
    "newTaxEntityInfo": "target audit label",
    "confirm": true
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to merge-tax-entity.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.
search-taxpayer-tinread

Search a taxpayer TIN through AutoCount AIP/MyInvois using the account book's e-Invoice settings.

No raw AutoCount AIP key is accepted or returned. AutoCount must have an active AIP ID in e-Invoice Setting.

Endpoint

POST /v1/commands
GET /v1/commands/{commandId}
POST /v1/tax/tax/search-taxpayer-tin

Full JSON Payload

{
  "commandId": "search-taxpayer-tin-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "search-taxpayer-tin",
  "payload": {
    "idType": "BRN",
    "idValue": "202101012345",
    "taxpayerName": "EXAMPLE SDN BHD"
  }
}

Payload Fields

idType
required identity type such as BRN, NRIC, PASSPORT, or ARMY
idValue
required identity or registration number
taxpayerName
required registered taxpayer name

JavaScript Example

const apiBase = "https://api.autocount.cloud";
const apiKey = "YOUR_API_KEY";

async function queueCommand(command) {
  const response = await fetch(apiBase + "/v1/commands", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + apiKey,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(command)
  });
  if (!response.ok) throw new Error(await response.text());
  return response.json();
}

async function waitCommand(commandId) {
  for (let i = 0; i < 60; i++) {
    const response = await fetch(apiBase + "/v1/commands/" + encodeURIComponent(commandId), {
      headers: { "Authorization": "Bearer " + apiKey }
    });
    if (!response.ok) throw new Error(await response.text());
    const data = await response.json();
    if (data.command && (data.command.status === "done" || data.command.status === "failed")) return data;
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  throw new Error("Command timed out");
}

const command = {
  "commandId": "search-taxpayer-tin-001",
  "connectorId": "customer-main",
  "companyId": "macsofttest",
  "type": "search-taxpayer-tin",
  "payload": {
    "idType": "BRN",
    "idValue": "202101012345",
    "taxpayerName": "EXAMPLE SDN BHD"
  }
};

await queueCommand(command);
console.log(await waitCommand(command.commandId));

AI Rules

  • Use cloud API only: https://api.autocount.cloud.
  • Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
  • Use Authorization: Bearer YOUR_API_KEY.
  • Use a unique commandId for every real operation.
  • commandId must be URL-safe: letters, numbers, dot, underscore, and hyphen only; max 160 characters.
  • Set type to search-taxpayer-tin.
  • Poll GET /v1/commands/{commandId} until status is done or failed.
  • For write commands, validate first when a validate-* command exists for the same document.