Skip to main content
This quickstart takes you from a test key to a KRA-signed receipt and a credit note, against the KRA sandbox. It uses curl, with Node.js and Python versions of the sale call. All requests go to https://sync2books-compliance-api.apps.kintro.money/v1. The same address serves the sandbox and production: the key you send decides which one you reach.

Before you start

  • A business added in the compliance dashboard with a sandbox eTIMS connection.
  • A dashboard administrator to create an API key for it. Only administrators can manage keys.
1

Get a test key

In the compliance dashboard, select the business and open Integrations. Choose Create API key, pick Test mode and copy the key. It is shown once. See Authentication & API keys.Put the key and the base URL in your shell. The key below is a placeholder:
2

Check the key

environment is SANDBOX for a test key. scope is business when the key is limited to one business, and then businessId is that business. scopes lists what the key may do, and rateLimitPerMin is your request budget.
3

Create an item

Every sale line refers to a registered item. Create one:
The response is 201 with the item. Its registrationStatus is PENDING: it exists, but KRA does not know it yet. Keep the item id. To find a classificationCode, see Items.
4

Register it with KRA

The item comes back with registrationStatus set to REGISTERED. If you get a 422 with the code item_incomplete, read error.item.needs to see what is missing.
5

Add opening stock

Goods are stock-tracked, so a sale deducts stock. Add some first:
The response is 201 with quantityOnHand. Services are not stock-tracked and need no stock.
6

Issue a sale

Always send an Idempotency-Key, so a retried request cannot file a second invoice. Prices are tax inclusive.
A 201 means KRA accepted the sale. The response includes the signed receipt, abridged here:
The VAT is split out of the price for you, line by line, from the item’s tax type.
7

Download the receipt

Add ?copy=true for a customer copy marked COPY.
8

Repeat the sale safely

Send step 6 again with the same Idempotency-Key. Use -i to see the headers:
The answer is 200 with the header Idempotent-Replayed: true, and nothing is filed with KRA again. See Idempotency.
9

Issue a credit note

The credit note reverses the whole sale. Its totals are negative, and receipt.originalCuInvoiceNo points back at the sale. A sale can be credited once. See Credit notes.
Never put a key in client-side code, a mobile app or a repository. Keep it on your server and load it from the environment, as the examples above do.