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.<<>> ) over guessed business values.Base URL example:
http://your-autocount-host:9999Headers example:
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: "<<>>" DocNoFormatName: "<<>>" DebtorName: "<<>>" when not enriching from master dataDisplayTerm: "<<>>" CurrencyCode: "<<>>" <<>> TaxCode: "<<>>" is preferred over manually forcing a tax code"Options": {
"DocNoFormatName": "<<<Default>>>",
"SaveAsDraft": true
}
After a successful create:
docKeyGetRecord endpointDocNoDocKey{
"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.
{
"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
}
}
{
"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: "<<>>" and DocNoFormatName: "<<>>" .TaxCode: "<<>>" 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: "<<>>" and DocNoFormatName: "<<>>" .TaxCode: "<<>>" unless the system proves a specific value.Use this pattern for transfer documents:
{
"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.
9999 over HTTP in the tested environment.404, which is normal for the service.X-API-NAMEX-API-KEYUpdateRecord?docKey=....POST {} instead of GET.SaveAsDraft: false did not reliably convert it into a final transferable PO in UI testing; creating a fresh final PO was reliable.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.00001 worked repeatedly in sales invoices with:FABRICMETERMYSTaxCode: "<<>>" worked and is preferred.DocNo was missing; adding DocNo: "<<>>" fixed it./api/Invoice/CreateRecord, not /api/SalesInvoice/CreateRecord.SO for SO → DODO for DO → InvoiceRead references/test-notes.md for the observed behavior and payload patterns discovered during live testing.
共 1 个版本