API Icon
API Icon
Developer Tools

Autocount Plugin API Test

Test tool for DKSH DMS_CC_API integration. Monitor live payloads sent to the Mock Worker D1.

BASE URL
https://dksh-api-mock.kslbs.workers.dev/dksh/
CHECKING

Snapshot Tester

DKSHDKSH Mock API

Admin credentials unlock this private Mock API console. DKSH upload authentication itself uses the DLP token inside the JSON request body.

API Reference

DKSH v1.5-compatible snapshot routes plus a Mock API availability control.

POST/api/ExternalSalesOrderInv/upload

Invoice snapshot

Receive the complete current 15-calendar-day Invoice set as { token, details }.

POST/api/ExternalGoodReturn/upload

Goods Return snapshot

Receive the complete current 15-calendar-day Goods Return set as { token, details }.

GET / POST/api/control/status

Mock availability

Read, pause or resume the Mock API. Paused Plugin routes return HTTP 503.

DELETE/api/control/records/:type/:id

Delete test record

Delete one received Invoice or Good Return line after admin credential validation.

Synchronization Log

Every line below comes from the independent Mock Worker D1. Each accepted request replaces the previous complete snapshot for that DLP token and endpoint.
Deletion rule: A document omitted from the next submitted 15-day snapshot is treated as deleted.

LIVE · 3 SECONDS

Received invoices

0 LINES
No received records yet. Upload from the AC Plugin or send a test snapshot above.

Received credit notes

0 LINES
No received records yet. Upload from the AC Plugin or send a test snapshot above.

Integration Rules

Updated for the latest DKSH clarification and the payload currently produced by DKSH Integration.

One full snapshot per endpoint

At the scheduled time, the Plugin sends all eligible Invoices in one request and all eligible Goods Returns in a separate request. It does not post one document at a time.

Rolling 15 calendar days

Every request contains documents dated within the latest 15 calendar days, inclusive of today. changedDate is sent on every line.

Omission means deletion

Each successful request replaces the previous snapshot for that DLP and endpoint. Any previously received in-window document omitted from the new snapshot is treated as deleted.

DLP token in request body

DKSH supplies one token per distributor. The Plugin sends { token, details }; Login, Refresh Token, Revoke Token and Authorization headers are not used.

DKSH-only master data

Only selected DKSH products are included. prdCode and custCode must match DMS master data; the Plugin uses AutoCount codes directly when no mapping override is entered.

Smallest/Base UOM

Non-Base UOM quantities are multiplied by the AutoCount UOM Rate. The resulting Base UOM quantity must be a positive whole number.

Combine matching products

Lines in the same document that resolve to the same DKSH product code are combined; Base UOM quantity and ttlAfterDisc are summed.

All-or-nothing validation

If any selected document has a missing mapping or invalid quantity, that endpoint snapshot is not sent. An empty snapshot is skipped.

200,000-line ceiling

The Plugin blocks an endpoint snapshot above DKSH's approximate 200,000-line limit instead of splitting it, because splitting would change deletion semantics.

Daily PC election

The logged-in SQL Server PC uploads first. If it is unavailable, the alphabetically first active client takes over after a two-minute grace period; a shared database lease prevents duplicate posting.

Retry behavior

A failed or timed-out full snapshot is retried after 15 minutes. A successful snapshot is sent once per configured Posting Time each day.

Mock outage

Pause API makes upload routes return HTTP 503. Read-only monitoring and the Resume control remain available.

Payload Schema

Line-level payload definitions expected by the Mock Worker.Highlighted fields are compulsory

Sales Order Invoice details

FieldTypeDescription
dstCodestringDistributor code supplied by DKSH.
invNostringInvoice number.
invDatedate/timeInvoice date within the current 15-calendar-day snapshot.
custCodestringCustomer code maintained in DMS.
prdCodestringDKSH product code maintained in DMS.
qtyintegerPositive whole-number quantity in the smallest/Base UOM.
ttlAfterDiscdecimalTotal amount after discount for the combined product line.
remarkstringOptional AutoCount document remark.
changedDatedate/timeDocument changed date; always sent by the Plugin.

Goods Return details

FieldTypeDescription
dstCodestringDistributor code supplied by DKSH.
grNostringGoods Return number.
grDatedate/timeGoods Return date within the current 15-calendar-day snapshot.
custCodestringCustomer code maintained in DMS.
prdCodestringDKSH product code maintained in DMS.
qtyintegerPositive whole-number quantity in the smallest/Base UOM.
ttlAfterDiscdecimalTotal amount after discount for the combined product line.
remarkstringOptional AutoCount document remark.
changedDatedate/timeDocument changed date; always sent by the Plugin.