Use this skill to create or test AutoCount documents through the AutoCount Web API.
Supported document work in this skill:
X-API-NAME: 9999X-API-KEY: 9999Content-Type: application/jsonSaveAsDraft: true unless the user explicitly wants final posting.SaveAsDraft: false). Draft purchase documents cannot be used as transfer sources.<<<Default>>>) over guessed business values.Base URL example:
http://your-autocount-host:9999Headers example:
http
X-API-NAME: <your-api-name>
X-API-KEY: <your-api-key>
Content-Type: application/json
POST {{localURL}}/api/SalesOrder/CreateRecordGET {{localURL}}/api/SalesOrder/GetRecord?docKey=...POST {{localURL}}/api/DeliveryOrder/CreateRecordGET {{localURL}}/api/DeliveryOrder/GetRecord?docKey=...POST {{localURL}}/api/Invoice/CreateRecordGET {{localURL}}/api/Invoice/GetRecord?docKey=...POST {{localURL}}/api/CreditNote/CreateRecordGET {{localURL}}/api/CreditNote/GetRecord?docKey=...POST {{localURL}}/api/CreditNote/UpdateRecord?docKey=...POST {{localURL}}/api/CreditNote/CancelRecord?docKey=...POST {{localURL}}/api/CreditNote/DeleteRecord?docKey=...POST {{localURL}}/api/PurchaseOrder/CreateRecordPOST {{localURL}}/api/PurchaseOrder/UpdateRecord?docKey=...POST {{localURL}}/api/PurchaseInvoice/CreateRecordPOST {{localURL}}/api/GoodsReceivedNote/CreateRecordGET {{localURL}}/api/PurchaseOrder/GetRecord?docKey=...POST {{localURL}}/api/PurchaseOrder/GetRecordListGET {{localURL}}/api/GoodsReceivedNote/GetRecord?docKey=...POST {{localURL}}/api/GoodsReceivedNote/GetRecordListGET {{localURL}}/api/PurchaseInvoice/GetRecord?docKey=...GET {{localURL}}/api/Debtor/GetRecordListGET {{localURL}}/api/Creditor/GetRecordListGET {{localURL}}/api/Item/GetRecordListGET {{localURL}}/api/Location/GetRecordListGET {{localURL}}/api/Currency/GetRecordListUse AutoCount defaults where supported:
DocNo: "<<<Default>>>"DocNoFormatName: "<<<Default>>>"DebtorName: "<<<Default>>>" when not enriching from master dataDisplayTerm: "<<<Default>>>"CurrencyCode: "<<<Default>>>"<<<Default>>>TaxCode: "<<<Default>>>" is preferred over manually forcing a tax codejson
"Options": {
"DocNoFormatName": "<<<Default>>>",
"SaveAsDraft": true
}
After a successful create:
docKeyGetRecord endpointDocNoDocKeyjson
{
"Master": {
"DocNo": "<<<Default>>>",
"DocDate": "2026-03-27",
"DebtorCode": "SS29",
"DebtorName": "<<<Default>>>",
"SalesLocation": "HQ",
"DisplayTerm": "<<<Default>>>",
"CurrencyCode": "<<<Default>>>"
},
"Details": [
{
"ItemCode": "00001",
"UOM": "METER",
"UserUOM": "<<<Default>>>",
"Location": "HQ",
"Description": "<<<Default>>>",
"Qty": 2,
"UnitPrice": 22.22,
"TaxCode": "<<<Default>>>",
"Classification": "010",
"OriginCountryCode": "MYS"
}
],
"Options": {
"DocNoFormatName": "<<<Default>>>",
"SaveAsDraft": true
}
}
Purchase documents use a similar body shape to sales invoices, but with purchase-side party/location fields.
json
{
"Master": {
"DocNo": "<<<Default>>>",
"CreditorCode": "400-S001",
"CreditorName": "SUPPLIER",
"PurchaseLocation": "HQ",
"DocDate": "2026-03-27",
"Description": "PURCHASE INVOICE",
"DisplayTerm": "C.O.D.",
"CurrencyCode": "MYR",
"CurrencyRate": 1
},
"Details": [
{
"DeliveryDate": "2026-03-27",
"ItemCode": "00002",
"UOM": "SET",
"UserUOM": "SET",
"Location": "HQ",
"Description": "SOFA 沙发",
"Qty": 10,
"FOCQty": 0,
"UnitPrice": 1000,
"Discount": "",
"TaxCode": "<<<Default>>>"
}
],
"Options": {
"DocNoFormatName": "<<<Default>>>",
"SaveAsDraft": true
}
}
json
{
"Master": {
"DocNo": "<<<Default>>>",
"SupplierDONo": "AUTO-GRN-20260327-01",
"CreditorCode": "400-S001",
"CreditorName": "SUPPLIER",
"PurchaseLocation": "HQ",
"DocDate": "2026-03-27",
"Description": "GOODS RECEIVED NOTE",
"DisplayTerm": "C.O.D.",
"CurrencyCode": "MYR",
"CurrencyRate": 1
},
"Details": [
{
"DeliveryDate": "2026-03-27",
"ItemCode": "00002",
"UOM": "SET",
"UserUOM": "SET",
"Location": "HQ",
"Description": "SOFA 沙发",
"Qty": 10,
"FOCQty": 0,
"UnitPrice": 1000,
"Discount": "",
"TaxCode": "<<<Default>>>"
}
],
"Options": {
"DocNoFormatName": "<<<Default>>>",
"SaveAsDraft": true
}
}
Use this when the user wants sales document progression.
Details: []TransferDetails[]POST /api/DeliveryOrder/CreateRecordTransferDetails[].DocType = "SO"POST /api/Invoice/CreateRecordTransferDetails[].DocType = "DO"SalesLocation on invoice payloads and sales-side master payloads where appropriate.DocNo: "<<<Default>>>" and DocNoFormatName: "<<<Default>>>".TaxCode: "<<<Default>>>" unless the system proves a specific value.A full sales chain was live-tested successfully:
DocType: "SO"DocType: "DO"Use this when the user wants purchase document progression.
POST /api/PurchaseOrder/GetRecordList and body {}GET /api/PurchaseOrder/GetRecord?docKey=...Details: []TransferDetails[]POST /api/GoodsReceivedNote/CreateRecordTransferDetails[].DocType = "PO"POST /api/PurchaseInvoice/CreateRecordTransferDetails[].DocType = "GR"TransferDetails[].DocType = "PO"SupplierDONo when creating GRNs.DocNo: "<<<Default>>>" and DocNoFormatName: "<<<Default>>>".TaxCode: "<<<Default>>>" unless the system proves a specific value.Use this pattern for transfer documents:
json
{
"Master": {
"DocNo": "<<<Default>>>",
"DocDate": "2026-04-09",
"CreditorCode": "400-S001",
"CreditorName": "<<<Default>>>",
"PurchaseLocation": "HQ",
"DisplayTerm": "<<<Default>>>",
"CurrencyCode": "<<<Default>>>",
"CurrencyRate": "<<<Default>>>"
},
"Details": [],
"TransferDetails": [
{
"DocType": "PO",
"DocNo": "PO-000038",
"ItemCode": "00002",
"UOM": "SET",
"TransferQty": 5,
"TransferFOCQty": 0
}
],
"Options": {
"DocNoFormatName": "<<<Default>>>",
"SaveAsDraft": false
}
}
Swap DocType as follows:
PO for PO → GRNPO for PO → PIGR for GRN → PISO for SO → DODO for DO → InvoiceA full purchase chain was live-tested successfully:
DocType: "PO"DocType: "GR"AutoCount tracks transfer quantity at table level even when the normal PO API does not expose it. Observed relevant DB fields include:
PODTL.QtyPODTL.TransferedQtyPODTL.TransferablePIDTL.FromDocTypePIDTL.FromDocNoWorking balance formula:
Qty - TransferedQtyImportant: the standard PurchaseOrder/GetRecord API response did not expose TransferedQty, so automation should not assume the API will prevent over-transfer. Validate quantities before transfer when possible.
Treat these as real mutations.
UpdateRecord expects a clean create-style payload more often than a raw GetRecord echo.CancelRecord and DeleteRecord are destructive.GetRecord may return record-not-found.DocNo and DocKey back to the user.For Credit Note, the following worked in live testing:
POST /api/CreditNote/UpdateRecord?docKey=...POST /api/CreditNote/CancelRecord?docKey=...POST /api/CreditNote/DeleteRecord?docKey=...Observed behavior:
trueGetRecord returned record-not-found for the test documentBefore document creation, optionally fetch master data and copy display fields into the payload.
DebtorNameInvAddr1..4Phone1AttentionDisplayTermCurrencyCodeCreditorNameDisplayTermCurrencyCodeDescriptionUOMThis makes the final document more complete in the AutoCount UI.
AutoCount Web API was reachable on port 9999 over HTTP in the tested environment.
Root URL returned 404, which is normal for the service.
Authentication uses headers, not curl basic auth:
X-API-NAMEX-API-KEYSales order create/get worked.
Delivery order create/get worked.
Sales invoice create/get worked repeatedly.
Credit note create/get worked.
Credit note update worked.
Credit note cancel worked.
Credit note delete route worked and the test document became non-retrievable afterward.
Purchase invoice create worked.
GRN create worked.
Purchase order create worked.
Purchase order update worked when using a clean create-style payload against UpdateRecord?docKey=....
PO list requires POST {} instead of GET.
PO get worked with valid doc keys.
Updating a draft PO with SaveAsDraft: false did not reliably convert it into a final transferable PO in UI testing; creating a fresh final PO was reliable.
Transfer source docs must be final, not draft.
For transfer documents, Details: [] plus TransferDetails[] worked; mixing Details[] with TransferDetails[] created an extra unlinked manual line.
TransferDetails[].DocType values confirmed in live testing:
PO for PO → GRNPO for PO → PIGR for GRN → PIGRN as a purchase invoice transfer doc type failed with Invalid transfer document.
A full live chain succeeded: PO → GRN → PI.
A full live chain succeeded: SO → DO → Invoice.
Lean payloads can create documents, but UI-visible debtor/item display fields may remain blank unless explicitly enriched.
Item 00001 worked repeatedly in sales invoices with:
FABRICMETERMYSItem list response does not necessarily expose tax code fields.
Do not manually force tax codes unless explicitly instructed or proven from system data.
Using TaxCode: "<<<Default>>>" worked and is preferred.
GRN create initially failed when DocNo was missing; adding DocNo: "<<<Default>>>" fixed it.
Sales invoice route is /api/Invoice/CreateRecord, not /api/SalesInvoice/CreateRecord.
Sales transfer doc types confirmed in live testing:
SO for SO → DODO for DO → InvoiceRead references/test-notes.md for the observed behavior and payload patterns discovered during live testing.