Environments and the sandbox
Mikono has a sandbox and a production environment, each with its own base URL and its own keys. This guide explains the difference and what the sandbox organisation holds.
Two environments
| Environment | Base URL | Key prefix | Data |
|---|---|---|---|
| Sandbox | https://calculating-gnu-991.convex.site/api/v1 | mk_test_ | Synthetic. Safe to write. |
| Production | https://<production host>/api/v1 | mk_live_ | The distributor’s real records. |
- A key works only in the environment that issued it, because the key’s hash is stored there. A sandbox key sent to production returns
401 wrong_environment, and so does the reverse. - The production host is given to you when production access is turned on. Keep the base URL in your configuration, not in code, so moving from sandbox to production is a configuration change.
GET /healthreports which environment you reached in itsenvironmentfield:testfor the sandbox,livefor production.
What the sandbox holds
Sandbox keys belong to Kampala Beverage Distributors (Demo), a synthetic beverage distributor in Kampala. Every name, code, phone number and amount in it is made up. It holds:
- 60 outlets (bars, wholesalers, shops and restaurants) with DMS outlet codes of the form
UG2xxxxxx, for exampleUG2104417, 15 on each route; - 16 products with 6-digit DMS product codes, for example
780256(Tusker Lager 500ml), priced per bottle in UGX, plus three returnable containers (two empty bottles and a crate) without DMS codes; - four routes, each worked by one van salesman, and two trucks. Each route’s code,
KBDVSM001toKBDVSM004, is also its salesman’s DMS code: use it assalesmanCodeon DMS documents; - ten working days of trading history before the day it was seeded: trips, invoices, collections, customer returns, empties and stock movements, with every trip day settled; and that day’s trips still open.
Getting a sandbox key
- Partners ask the Mikono team for a sandbox key. The team creates it on the sandbox organisation and sends the secret through a secure channel. It can read every resource, post DMS documents (
dms:ingest) and read their flags (dms:flags:read); it cannot write other records. - The team can register a webhook endpoint for you at the same time, subscribed to
dms.document.flaggedandinvoice.created. Its signing secret is also shown once. - Anyone with the Manage settings permission on the sandbox organisation can also create keys with other scopes in Settings → Developers → API keys.
Sandbox keys start with mk_test_. Call GET /me with yours to see its scopes; the Getting started guide walks through the first call.
The sandbox DMS connection
The sandbox organisation has one DMS connection, for Mikono’s own canonical JSON format (system canonical). Documents you post to it must carry these values:
| Setting | Value |
|---|---|
| Endpoint | POST /dms/canonical/documents |
| Distributor code | KBD001 |
| Transport | JSON over the API |
| Flags returned | In the response, and as dms.document.flagged webhooks |
| Outlet, product and salesman codes | The sandbox codes above |
A document with another distributor code is rejected with R07. One with a customer or product code the sandbox does not know is held with R08 and retried for 48 hours, then rejected with R08. The DMS integration guide lists every reason code.
Records you create
The sandbox is not reset. Records you create through the API stay, alongside the synthetic history, and other partners testing on the sandbox can see them.
- Every write made with an API key is recorded in the organisation’s audit log with the source
Integration, the key and the request ID, and is attributed to the key’s own service account, namedAPI: <key name>. - Documents posted to the DMS connection are attributed to the connection’s service account,
DMS: canonical (KBD001), and are also audited with the sourceIntegration. - Settings → Developers → API log lists every call, with a link to the record it touched.
If the sandbox is not connected to a QuickBooks company, posted documents carry their Mikono reference and quickbooksRef: null.
Create a sandbox key
- Sign in to Mikono with an account that is a member of Kampala Beverage Distributors (Demo), and select that organisation. Creating keys needs the Manage settings permission.
- Open Settings → Developers. If API access is off, turn it on there.
- Under API keys, choose Create key. Name it after the system that will use it, and pick only the scopes it needs, for example
customers:readandinvoices:read. - Copy the secret. It starts with
mk_test_and is shown once; the list shows only its prefix after that. - Call
GET /mewith the key to check its organisation and scopes.
Production
- API access is off for every organisation until one of its administrators turns it on in Settings → Developers.
- Production keys never have request or response bodies kept in the API log.
- The same endpoints, rules and limits apply in both environments. A flow that works in the sandbox works in production with a production key and base URL.
Versioning is described in the Changelog.