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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "AD-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-advanced-quotation-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-advanced-quotation",
"payload": {
"docNo": "AD-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "QU-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-quotation-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-quotation",
"payload": {
"docNo": "QU-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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
}
],
"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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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
}
],
"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,
"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"
}
}
],
"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.
- 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.
update-sales-orderEdit
Update sales order header/contact fields and supported detail rows.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-sales-order-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-sales-order",
"payload": {
"docNo": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "DE-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-delivery-order-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-delivery-order",
"payload": {
"docNo": "DE-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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. For latest rows, send limit/top/take; connector returns newest DocDate then DocNo first.
Uses a bounded read-only header query for known AutoCount sales invoice tables so large account books do not hang while loading all invoices.
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": {
"limit": 10,
"top": 10,
"take": 10,
"orderBy": "docDate desc"
}
}
Payload Fields
- limit
- optional maximum rows, default 100, max 500
- top
- optional alias for limit
- take
- optional alias for limit
- 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": {
"limit": 10,
"top": 10,
"take": 10,
"orderBy": "docDate desc"
}
};
await queueCommand(command);
console.log(await waitCommand(command.commandId));
AI Rules
- Use cloud API only: https://api.autocount.cloud.
- Never call the Local Connector API directly from Mac Soft AI, AI tools, customer apps, or external integrations.
- Use Authorization: Bearer YOUR_API_KEY.
- Use a unique commandId for every real operation.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Requires write access permission. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-sales-invoice-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-sales-invoice",
"payload": {
"docNo": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 item 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 sales location such as HQ
- 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "CA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-cash-sale-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-cash-sale",
"payload": {
"docNo": "CA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Creates sales credit note through AutoCount Sales CreditNote SDK when available. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-sales-credit-note-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-sales-credit-note",
"payload": {
"docNo": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Creates sales debit note through AutoCount Sales DebitNote SDK when available. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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,
"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"
}
}
],
"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 sales location such as HQ
- 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 item 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
- 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,
"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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for sales detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them.
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": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- debtorCode
- required AutoCount debtor/customer code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact person
- deliverPhone1
- optional delivery phone number
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional Sales Agent Maintenance code
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- debtorName
- optional customer display name; AutoCount debtor name is used when omitted
- branchCode
- optional debtor branch code/name where the customer uses branches
- salesLocation
- optional sales location such as HQ
- multiPricing
- optional price category/multi-pricing value such as Price 1
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-sales-debit-note-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-sales-debit-note",
"payload": {
"docNo": "SA-000001",
"reason": "correct document detail",
"debtorCode": "300-A001",
"contact": "Purchasing Department",
"attention": "Purchasing Department",
"phone": "03-11111111",
"ref": "WEB-ORDER-1001",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Store Receiver",
"deliverPhone1": "012-3456789",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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,
"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"
}
}
],
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"salesLocation": "HQ",
"multiPricing": "Price 1",
"salesAgent": "SA01",
"address1": "No. 1 Jalan API",
"address2": "Taman Integration",
"address3": "Kuala Lumpur",
"address4": "Malaysia",
"description": "Sales document created through API",
"currencyCode": "MYR",
"inclusiveTax": false,
"taxEntityID": 1,
"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.
- 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.
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.
- 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.
- 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.
- 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-delivery-order-to-sales-invoiceTransfer
Transfer delivery order to sales invoice.
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-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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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.
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.
- 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.
- 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.
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.
- 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.
- 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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for purchase detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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/edit
Full JSON Payload
{
"commandId": "update-purchase-order-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-purchase-order",
"payload": {
"docNo": "PU-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- creditorCode
- required AutoCount creditor/supplier code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact
- deliverPhone1
- optional delivery phone
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional sales agent where AutoCount exposes it
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- supplierInvoiceNo
- optional supplier invoice number
- supplierDONo
- optional supplier delivery order number
- creditorName
- optional supplier display name; AutoCount creditor name is used when omitted
- branchCode
- optional creditor branch code/name where the customer uses branches
- purchaseLocation
- optional purchase/stock location such as HQ
- purchaseAgent
- optional Purchase Agent Maintenance code
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-purchase-order-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-purchase-order",
"payload": {
"docNo": "PU-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for purchase detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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/edit
Full JSON Payload
{
"commandId": "update-goods-received-note-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-goods-received-note",
"payload": {
"docNo": "GO-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- creditorCode
- required AutoCount creditor/supplier code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact
- deliverPhone1
- optional delivery phone
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional sales agent where AutoCount exposes it
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- supplierInvoiceNo
- optional supplier invoice number
- supplierDONo
- optional supplier delivery order number
- creditorName
- optional supplier display name; AutoCount creditor name is used when omitted
- branchCode
- optional creditor branch code/name where the customer uses branches
- purchaseLocation
- optional purchase/stock location such as HQ
- purchaseAgent
- optional Purchase Agent Maintenance code
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-goods-received-note-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-goods-received-note",
"payload": {
"docNo": "GO-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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.
Creates purchase invoice through 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. Full payload example is for human/Postman reference. 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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
- 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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for purchase detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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/edit
Full JSON Payload
{
"commandId": "update-purchase-invoice-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-purchase-invoice",
"payload": {
"docNo": "PU-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- creditorCode
- required AutoCount creditor/supplier code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact
- deliverPhone1
- optional delivery phone
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional sales agent where AutoCount exposes it
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- supplierInvoiceNo
- optional supplier invoice number
- supplierDONo
- optional supplier delivery order number
- creditorName
- optional supplier display name; AutoCount creditor name is used when omitted
- branchCode
- optional creditor branch code/name where the customer uses branches
- purchaseLocation
- optional purchase/stock location such as HQ
- purchaseAgent
- optional Purchase Agent Maintenance code
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-purchase-invoice-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-purchase-invoice",
"payload": {
"docNo": "PU-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for purchase detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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/edit
Full JSON Payload
{
"commandId": "update-cash-purchase-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-cash-purchase",
"payload": {
"docNo": "CA-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- creditorCode
- required AutoCount creditor/supplier code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact
- deliverPhone1
- optional delivery phone
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional sales agent where AutoCount exposes it
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- supplierInvoiceNo
- optional supplier invoice number
- supplierDONo
- optional supplier delivery order number
- creditorName
- optional supplier display name; AutoCount creditor name is used when omitted
- branchCode
- optional creditor branch code/name where the customer uses branches
- purchaseLocation
- optional purchase/stock location such as HQ
- purchaseAgent
- optional Purchase Agent Maintenance code
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-cash-purchase-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-cash-purchase",
"payload": {
"docNo": "CA-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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"
}
}
],
"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 purchase/stock location such as HQ
- 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 item 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"
}
}
],
"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.
- 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.
Uses AutoCount SDK Edit(string) + Save(). Supports header/contact changes plus detailMode replace | append | update | delete for purchase detail rows. AutoCount may reject edits for posted, transferred, linked, or permission-blocked documents. Full payload example is for human/Postman reference. 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. The connector sends supported fields into AutoCount SDK and ignores unsupported optional fields where the exact document SDK does not expose them. 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/edit
Full JSON Payload
{
"commandId": "update-purchase-return-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-purchase-return",
"payload": {
"docNo": "PU-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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
- docNo
- optional AutoCount document number; omit to let AutoCount numbering generate it
- reason
- required business reason
- docDate
- required or optional YYYY-MM-DD document date depending on account-book numbering rules
- description
- optional document description/narration
- ref
- optional reference
- yourPONo
- optional customer/supplier PO/reference number where AutoCount exposes it
- creditorCode
- required AutoCount creditor/supplier code
- contact
- optional contact person alias for attention
- attention
- optional attention/contact person
- phone
- optional phone alias for phone1
- phone1
- optional phone 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
- deliverContact
- optional delivery contact
- deliverPhone1
- optional delivery phone
- deliverAddress1
- optional delivery address line 1
- deliverAddress2
- optional delivery address line 2
- deliverAddress3
- optional delivery address line 3
- deliverAddress4
- optional delivery address line 4
- salesAgent
- optional sales agent where AutoCount exposes it
- displayTerm
- optional credit term such as C.O.D. or 30 DAYS
- dueDate
- optional YYYY-MM-DD due date
- detailMode
- optional detail edit mode: replace | append | update | delete
- lines
- required array of item rows; items is also accepted as a compatibility alias
- items
- optional alias for lines
- supplierInvoiceNo
- optional supplier invoice number
- supplierDONo
- optional supplier delivery order number
- creditorName
- optional supplier display name; AutoCount creditor name is used when omitted
- branchCode
- optional creditor branch code/name where the customer uses branches
- purchaseLocation
- optional purchase/stock location such as HQ
- purchaseAgent
- optional Purchase Agent Maintenance code
- phone2
- optional secondary phone/mobile number
- fax1
- optional fax number printed on document
- 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
- 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": "update-purchase-return-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "update-purchase-return",
"payload": {
"docNo": "PU-000001",
"reason": "correct document detail",
"creditorCode": "400-S001",
"contact": "Supplier Sales Department",
"attention": "Supplier Sales Department",
"phone": "03-33333333",
"ref": "API-REF-UPDATED",
"yourPONo": "PO-UPDATED-001",
"deliverContact": "Warehouse",
"deliverPhone1": "03-22222222",
"deliverAddress1": "Warehouse 1",
"detailMode": "replace",
"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"
}
}
],
"supplierInvoiceNo": "SUP-INV-1001",
"supplierDONo": "SUP-DO-UPDATED-001",
"docDate": "2026-06-24",
"displayTerm": "30 DAYS",
"branchCode": "MAIN",
"purchaseLocation": "HQ",
"purchaseAgent": "PA01",
"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,
"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.
- 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.
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.
- 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.
- 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.
- 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.
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-goods-received-note-to-purchase-invoice-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "transfer-goods-received-note-to-purchase-invoice",
"payload": {
"sourceDocNo": "GRN-000001",
"targetDocNo": "",
"docDate": "2026-06-24",
"creditorCode": "400-S001",
"transferQtyMode": "outstanding",
"description": "Transfer goods received note to purchase invoice",
"ref": "API-TRANSFER-1001",
"lines": [
{
"sourceLineNo": 1,
"itemCode": "ITEM001",
"qty": 1,
"uom": "UNIT"
}
]
}
}
Payload Fields
- sourceDocNo
- required source goods received note document number
- targetDocNo
- optional target purchase 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
- 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-goods-received-note-to-purchase-invoice-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "transfer-goods-received-note-to-purchase-invoice",
"payload": {
"sourceDocNo": "GRN-000001",
"targetDocNo": "",
"docDate": "2026-06-24",
"creditorCode": "400-S001",
"transferQtyMode": "outstanding",
"description": "Transfer goods received note to purchase 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.
- 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",
"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
- 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",
"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.
- 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",
"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
- 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",
"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.
- 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 directly to purchase invoice.
Uses AutoCount transfer logic where the account book allows direct purchase-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/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": {
"sourceDocNo": "PO-000001",
"targetDocNo": "",
"docDate": "2026-06-24",
"creditorCode": "400-S001",
"transferQtyMode": "outstanding",
"description": "Transfer purchase order to purchase invoice",
"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 purchase 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
- 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-purchase-invoice-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "transfer-purchase-order-to-purchase-invoice",
"payload": {
"sourceDocNo": "PO-000001",
"targetDocNo": "",
"docDate": "2026-06-24",
"creditorCode": "400-S001",
"transferQtyMode": "outstanding",
"description": "Transfer purchase order to purchase 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.
- 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields and line/detail edit. detailMode: replace | append | update | delete. Credit notes also support knock-off allocation edit when the SDK exposes safe knock-off methods.
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": "AR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"lines": [
{
"accNo": "400-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- lines
- optional line/detail edit array; each row supports lineNo/dtlKey, accNo/accountNo/glAccount/postingAccountNo, description, amount, taxCode, deptNo, projNo, classification
- 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
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": "AR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"lines": [
{
"accNo": "400-0000",
"description": "Corrected line",
"amount": 100,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields, payment/detail edit, and knock-off allocation edit when safe SDK methods are available. detailMode: replace | append | update | delete.
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": "OR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "RI",
"docKey": "424496",
"docNo": "IV-000001",
"amount": 100
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- paymentLines
- optional AR/AP payment/detail edit array; each row supports lineNo/dtlKey, paymentMethod, paymentAmount/paymentAmt/amount, paymentBy, chequeNo, bankCharge
- knockOffs
- optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
- knockOffMode
- optional knock-off edit mode: replace | append | update
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": "OR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "RI",
"docKey": "424496",
"docNo": "IV-000001",
"amount": 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields, payment/detail edit, and knock-off allocation edit when safe SDK methods are available. detailMode: replace | append | update | delete.
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": "PV-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "RI",
"docKey": "424496",
"docNo": "IV-000001",
"amount": 100
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- paymentLines
- optional AR/AP payment/detail edit array; each row supports lineNo/dtlKey, paymentMethod, paymentAmount/paymentAmt/amount, paymentBy, chequeNo, bankCharge
- knockOffs
- optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
- knockOffMode
- optional knock-off edit mode: replace | append | update
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": "PV-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "RI",
"docKey": "424496",
"docNo": "IV-000001",
"amount": 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields and line/detail edit. detailMode: replace | append | update | delete. Credit notes also support knock-off allocation edit when the SDK exposes safe knock-off methods.
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": "AR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"lines": [
{
"accNo": "400-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- lines
- optional line/detail edit array; each row supports lineNo/dtlKey, accNo/accountNo/glAccount/postingAccountNo, description, amount, taxCode, deptNo, projNo, classification
- 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
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": "AR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"lines": [
{
"accNo": "400-0000",
"description": "Corrected line",
"amount": 100,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields and line/detail edit. detailMode: replace | append | update | delete. Credit notes also support knock-off allocation edit when the SDK exposes safe knock-off methods.
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": "AR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"lines": [
{
"accNo": "400-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- lines
- optional line/detail edit array; each row supports lineNo/dtlKey, accNo/accountNo/glAccount/postingAccountNo, description, amount, taxCode, deptNo, projNo, classification
- 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
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": "AR-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"debtorCode": "300-A001",
"detailMode": "replace",
"lines": [
{
"accNo": "400-0000",
"description": "Corrected line",
"amount": 100,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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": 0
}
}
Payload Fields
- accNo
- required debtor/customer code; debtorCode or customerCode 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-debtor-detail-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "get-debtor-detail",
"payload": {
"accNo": "300-A001",
"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.
- 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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. 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.
- 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. 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields and line/detail edit. detailMode: replace | append | update | delete. If lines do not include lineNo/dtlKey, the connector treats the request as replace. Use detailMode replace when splitting one AP invoice line into multiple lines, including RM0.00 detail lines. Credit notes also support knock-off allocation edit when the SDK exposes safe knock-off methods. For AP invoice number changes: use docNo to find the existing AP invoice, newDocNo to change AutoCount DocNo, and supplierInvoiceNo/invoiceNo to change the supplier invoice number.
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": "AP-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"lines": [
{
"accNo": "500-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
],
"newDocNo": "API-000001-UPDATED",
"supplierInvoiceNo": "SUP-INV-UPDATED-001"
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- lines
- optional line/detail edit array; each row supports lineNo/dtlKey, accNo/accountNo/glAccount/postingAccountNo, description, amount, taxCode, deptNo, projNo, classification
- 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
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": "AP-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"lines": [
{
"accNo": "500-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
],
"newDocNo": "API-000001-UPDATED",
"supplierInvoiceNo": "SUP-INV-UPDATED-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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields, payment/detail edit, and knock-off allocation edit when safe SDK methods are available. detailMode: replace | append | update | delete.
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": "PV-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "PB",
"docKey": "424496",
"docNo": "PI-000001",
"amount": 100
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- paymentLines
- optional AR/AP payment/detail edit array; each row supports lineNo/dtlKey, paymentMethod, paymentAmount/paymentAmt/amount, paymentBy, chequeNo, bankCharge
- knockOffs
- optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
- knockOffMode
- optional knock-off edit mode: replace | append | update
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": "PV-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "PB",
"docKey": "424496",
"docNo": "PI-000001",
"amount": 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields, payment/detail edit, and knock-off allocation edit when safe SDK methods are available. detailMode: replace | append | update | delete.
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": "PV-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "PB",
"docKey": "424496",
"docNo": "PI-000001",
"amount": 100
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- paymentLines
- optional AR/AP payment/detail edit array; each row supports lineNo/dtlKey, paymentMethod, paymentAmount/paymentAmt/amount, paymentBy, chequeNo, bankCharge
- knockOffs
- optional knock-off allocation edit array; each row supports docType, docKey, docNo, amount
- knockOffMode
- optional knock-off edit mode: replace | append | update
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": "PV-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"paymentLines": [
{
"paymentMethod": "CASH",
"paymentAmount": 100,
"chequeNo": "API-EDIT-001"
}
],
"knockOffs": [
{
"docType": "PB",
"docKey": "424496",
"docNo": "PI-000001",
"amount": 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 one or many real supplier invoice knock-offs.
Requires write access permission. Real knock-off validation is proven; saving should still be tested per account book. 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
- _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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields and line/detail edit. detailMode: replace | append | update | delete. If lines do not include lineNo/dtlKey, the connector treats the request as replace. Use detailMode replace when splitting one AP invoice line into multiple lines, including RM0.00 detail lines. Credit notes also support knock-off allocation edit when the SDK exposes safe knock-off methods.
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": "AP-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"lines": [
{
"accNo": "500-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- lines
- optional line/detail edit array; each row supports lineNo/dtlKey, accNo/accountNo/glAccount/postingAccountNo, description, amount, taxCode, deptNo, projNo, classification
- 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
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": "AP-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"lines": [
{
"accNo": "500-0000",
"description": "Corrected line",
"amount": 100,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Creates AP debit note through AutoCount SDK. 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
- _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.
- 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.
Uses AutoCount SDK load/edit + Save. Header/simple fields are enabled. Line/detail, payment-detail, and knock-off reallocation edits remain guarded until proven. Uses AutoCount SDK load/edit + Save for header/simple fields and line/detail edit. detailMode: replace | append | update | delete. If lines do not include lineNo/dtlKey, the connector treats the request as replace. Use detailMode replace when splitting one AP invoice line into multiple lines, including RM0.00 detail lines. Credit notes also support knock-off allocation edit when the SDK exposes safe knock-off methods.
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": "AP-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"lines": [
{
"accNo": "500-0000",
"description": "Corrected line",
"amount": 100,
"taxCode": "S-0"
}
]
}
}
Payload Fields
- docNo
- required existing document number unless docKey is supplied
- docKey
- optional existing document key
- reason
- optional business reason for audit
- docDate
- optional YYYY-MM-DD document date
- description
- optional document description/narration
- 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
- optional detail edit mode: replace | append | update | delete
- lines
- optional line/detail edit array; each row supports lineNo/dtlKey, accNo/accountNo/glAccount/postingAccountNo, description, amount, taxCode, deptNo, projNo, classification
- 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
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": "AP-000001",
"reason": "correct header fields",
"description": "Updated by API",
"ref": "API-REF-UPDATED",
"creditorCode": "400-S001",
"detailMode": "replace",
"lines": [
{
"accNo": "500-0000",
"description": "Corrected line",
"amount": 100,
"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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Stock
Items, balance, stock adjustment, receive, issue, transfer, UOM conversion, stock take, write-off, BOM, package, and assembly.
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.
- 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.
- 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.
- 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.
- 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.
- 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-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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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-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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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-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.
- 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-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.
- 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.
- 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.
- 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.
- 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.
- 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-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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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-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.
- 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.
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.
- 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.
stock-balanceRead
Inquire stock balance by item/location using AutoCount stock balance by location logic.
Returns rows from the first non-empty AutoCount result table plus table summaries. Use this when a customer asks stock quantity by location.
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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
list-item-packagesRead
List item package records.
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.
- 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.
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": {
"docNo": "PKG-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-package-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "get-item-package",
"payload": {
"docNo": "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.
- 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.
Validation only; does not save. Full human payload reference for Item Package. Component item codes and UOM must exist in AutoCount.
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": {
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"packageCode": "PKG-API",
"description": "API Package",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package example"
}
}
Payload Fields
- items
- required package component rows
- packageCode
- required package item/code
- description
- optional package description
- desc2
- optional second description
- uom
- optional package UOM
- price
- optional package selling price
- isActive
- optional boolean active flag
- lines
- optional alias for items
- 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
- 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": {
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"packageCode": "PKG-API",
"description": "API Package",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package 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.
- 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.
Creates item package through AutoCount SDK. Full human payload reference for Item Package. Component item codes and UOM must exist in AutoCount.
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",
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"description": "API Package",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package example"
}
}
Payload Fields
- packageCode
- required package item/code
- description
- optional package description
- items
- required package component rows
- desc2
- optional second description
- uom
- optional package UOM
- price
- optional package selling price
- isActive
- optional boolean active flag
- lines
- optional alias for items
- 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
- 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",
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"description": "API Package",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package 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.
- 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
Guarded item package edit request.
Returns editBlocked until item package update safety is proven. Full human payload reference for Item Package. Component item codes and UOM must exist in AutoCount.
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": "correct package",
"description": "API Package",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package example"
}
}
Payload Fields
- packageCode
- required package item/code
- reason
- required business reason
- description
- optional package description
- desc2
- optional second description
- uom
- optional package UOM
- price
- optional package selling price
- isActive
- optional boolean active flag
- items
- required package component rows
- lines
- optional alias for items
- 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
- 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": "correct package",
"description": "API Package",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package 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.
- 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.
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/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": "void package"
}
}
Payload Fields
- packageCode
- required
- 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-package-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "void-item-package",
"payload": {
"packageCode": "PKG-API",
"reason": "void 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.
- 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
Guarded item package delete request.
Deletion remains guarded for master definitions.
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": "remove package"
}
}
Payload Fields
- packageCode
- required
- 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": "delete-item-package-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "delete-item-package",
"payload": {
"packageCode": "PKG-API",
"reason": "remove 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.
- 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.
- 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.
- 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.
Validation only; does not save. Full human payload reference for Item BOM. Finished and component item codes must exist in the same account book and be valid for BOM usage. New account books normally need these items created before BOM/manufacturing commands.
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": {
"items": [
{
"itemCode": "ITEM001",
"qty": 1
}
],
"itemCode": "FINISHED-API",
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM setup example"
}
}
Payload Fields
- items
- module-specific stock lines
- itemCode
- required finished item code
- description
- optional BOM description
- uom
- optional finished item UOM
- qty
- optional finished quantity, default 1
- components
- required component item rows
- lines
- optional alias for components
- scrapPercent
- optional scrap percentage where supported
- 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
- 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": {
"items": [
{
"itemCode": "ITEM001",
"qty": 1
}
],
"itemCode": "FINISHED-API",
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM 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.
- 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.
Creates item BOM through AutoCount SDK. Manufacturing commands should use BOM parent/component item codes from the same account book. Full human payload reference for Item BOM. Finished and component item codes must exist in the same account book and be valid for BOM usage. New account books normally need these items created before BOM/manufacturing commands.
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",
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM setup example"
}
}
Payload Fields
- itemCode
- required finished item code
- components
- required component item rows
- description
- optional BOM description
- uom
- optional finished item UOM
- qty
- optional finished quantity, default 1
- lines
- optional alias for components
- scrapPercent
- optional scrap percentage where supported
- 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
- 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",
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM 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.
- 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.
Updates item BOM through AutoCount SDK. Full human payload reference for Item BOM. Finished and component item codes must exist in the same account book and be valid for BOM usage. New account books normally need these items created before BOM/manufacturing commands.
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": {
"itemCode": "FINISHED-API",
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"reason": "correct BOM",
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM setup example"
}
}
Payload Fields
- itemCode
- required finished item code
- components
- required component item rows
- reason
- required business reason
- description
- optional BOM description
- uom
- optional finished item UOM
- qty
- optional finished quantity, default 1
- lines
- optional alias for components
- scrapPercent
- optional scrap percentage where supported
- 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
- 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": {
"itemCode": "FINISHED-API",
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"reason": "correct BOM",
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM 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.
- 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.
- 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
Guarded item BOM delete request.
Deletion remains guarded for master definitions.
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",
"reason": "remove 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": "delete-item-bom-001",
"connectorId": "customer-main",
"companyId": "macsofttest",
"type": "delete-item-bom",
"payload": {
"itemCode": "FINISHED-API",
"reason": "remove 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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,
"controlAccount": "300-0000",
"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 debtor control account
- 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,
"controlAccount": "300-0000",
"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.
- 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",
"controlAccount": "300-0000",
"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 debtor control account
- 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",
"controlAccount": "300-0000",
"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.
- 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.
- 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.
- 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,
"controlAccount": "400-0000",
"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 creditor control account
- 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,
"controlAccount": "400-0000",
"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.
- 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",
"controlAccount": "400-0000",
"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 creditor control account
- 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",
"controlAccount": "400-0000",
"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.
- 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.
- 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.
- 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.
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. 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
},
{
"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",
"barCode": "9550000000011",
"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 UOM rows written through AutoCount DLL ItemUomTable; supports uom, rate, shelf, price/sellingPrice, cost/purchasePrice, minSalePrice, maxSalePrice, minPurchasePrice, maxPurchasePrice, normalLevel, reorderLevel, reorderQty, barCode, price2-price6, weight, weightUom, measurement
- 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
- barCode
- optional barcode
- 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
},
{
"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",
"barCode": "9550000000011",
"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.
- 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. 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
},
{
"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",
"barCode": "9550000000011",
"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 UOM rows written through AutoCount DLL ItemUomTable; supports uom, rate, shelf, price/sellingPrice, cost/purchasePrice, minSalePrice, maxSalePrice, minPurchasePrice, maxPurchasePrice, normalLevel, reorderLevel, reorderQty, barCode, price2-price6, weight, weightUom, measurement
- 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
- barCode
- optional barcode
- 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
},
{
"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",
"barCode": "9550000000011",
"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.
- 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.
- 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.
- 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.
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.
- 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.
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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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"
}
}
],
"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"
}
}
],
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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,
"controlAccount": "400-0000",
"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,
"controlAccount": "400-0000",
"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.
- 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,
"controlAccount": "300-0000",
"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,
"controlAccount": "300-0000",
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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"
}
}
],
"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"
}
}
],
"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.
- 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",
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM setup example"
}
],
"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",
"description": "API BOM",
"uom": "UNIT",
"qty": 1,
"components": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
},
{
"itemCode": "RAW-API-2",
"description": "Raw material 2",
"qty": 3,
"uom": "UNIT",
"location": "HQ",
"unitCost": 5
}
],
"lines": [
{
"itemCode": "RAW-API-1",
"description": "Raw material 1",
"qty": 2,
"uom": "UNIT",
"location": "HQ",
"unitCost": 10
}
],
"scrapPercent": 0,
"remark1": "Created by API",
"remark2": "BOM setup example"
}
],
"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.
- 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",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package example"
}
],
"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",
"desc2": "Package second description",
"uom": "SET",
"price": 120,
"isActive": true,
"items": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
},
{
"itemCode": "ITEM002",
"description": "Component 2",
"qty": 2,
"uom": "UNIT",
"unitPrice": 10
}
],
"lines": [
{
"itemCode": "ITEM001",
"description": "Component 1",
"qty": 1,
"uom": "UNIT",
"unitPrice": 100
}
],
"remark1": "Created by API",
"remark2": "Item package example"
}
],
"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.
- 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",
"barCode": "9550000000011",
"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
},
{
"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",
"barCode": "9550000000011",
"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
},
{
"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.
- 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.
- 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"
}
}
],
"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"
}
}
],
"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.
- 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"
}
}
],
"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"
}
}
],
"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.
- 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"
}
}
],
"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"
}
}
],
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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,
"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"
}
}
],
"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,
"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"
}
}
],
"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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.