curl --request POST \
--url https://sync2books-compliance-api.apps.kintro.money/v1/items \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"externalId": "SKU-1042",
"name": "500ml Cooking Oil",
"sku": "COOK-OIL-500",
"taxCategory": "VAT_STANDARD",
"productTypeCode": "2",
"classificationCode": "50150000",
"unitCode": "U",
"packagingUnitCode": "NT",
"unitPrice": 3500
}
'import requests
url = "https://sync2books-compliance-api.apps.kintro.money/v1/items"
payload = {
"externalId": "SKU-1042",
"name": "500ml Cooking Oil",
"sku": "COOK-OIL-500",
"taxCategory": "VAT_STANDARD",
"productTypeCode": "2",
"classificationCode": "50150000",
"unitCode": "U",
"packagingUnitCode": "NT",
"unitPrice": 3500
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalId: 'SKU-1042',
name: '500ml Cooking Oil',
sku: 'COOK-OIL-500',
taxCategory: 'VAT_STANDARD',
productTypeCode: '2',
classificationCode: '50150000',
unitCode: 'U',
packagingUnitCode: 'NT',
unitPrice: 3500
})
};
fetch('https://sync2books-compliance-api.apps.kintro.money/v1/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sync2books-compliance-api.apps.kintro.money/v1/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'externalId' => 'SKU-1042',
'name' => '500ml Cooking Oil',
'sku' => 'COOK-OIL-500',
'taxCategory' => 'VAT_STANDARD',
'productTypeCode' => '2',
'classificationCode' => '50150000',
'unitCode' => 'U',
'packagingUnitCode' => 'NT',
'unitPrice' => 3500
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sync2books-compliance-api.apps.kintro.money/v1/items"
payload := strings.NewReader("{\n \"externalId\": \"SKU-1042\",\n \"name\": \"500ml Cooking Oil\",\n \"sku\": \"COOK-OIL-500\",\n \"taxCategory\": \"VAT_STANDARD\",\n \"productTypeCode\": \"2\",\n \"classificationCode\": \"50150000\",\n \"unitCode\": \"U\",\n \"packagingUnitCode\": \"NT\",\n \"unitPrice\": 3500\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sync2books-compliance-api.apps.kintro.money/v1/items")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"SKU-1042\",\n \"name\": \"500ml Cooking Oil\",\n \"sku\": \"COOK-OIL-500\",\n \"taxCategory\": \"VAT_STANDARD\",\n \"productTypeCode\": \"2\",\n \"classificationCode\": \"50150000\",\n \"unitCode\": \"U\",\n \"packagingUnitCode\": \"NT\",\n \"unitPrice\": 3500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sync2books-compliance-api.apps.kintro.money/v1/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"SKU-1042\",\n \"name\": \"500ml Cooking Oil\",\n \"sku\": \"COOK-OIL-500\",\n \"taxCategory\": \"VAT_STANDARD\",\n \"productTypeCode\": \"2\",\n \"classificationCode\": \"50150000\",\n \"unitCode\": \"U\",\n \"packagingUnitCode\": \"NT\",\n \"unitPrice\": 3500\n}"
response = http.request(request)
puts response.read_body{
"data": {
"item": {
"id": "itm_example_1",
"externalId": "SKU-1042",
"name": "500ml Cooking Oil",
"sku": "COOK-OIL-500",
"taxCategory": "VAT_STANDARD",
"taxTypeCode": "B",
"productTypeCode": "2",
"classificationCode": "50150000",
"unitCode": "U",
"packagingUnitCode": "NT",
"unitPrice": 3500,
"stockTracked": true,
"registrationStatus": "PENDING",
"needs": {
"productType": false,
"classificationMapping": false
}
}
}
}Create or update an item
Creates an item, or updates the one with the same externalId. The item starts as PENDING: it is not registered with KRA until you call POST /v1/items/{id}/register. The call returns 201 for both a create and an update.
Required scope: catalog:write.
curl --request POST \
--url https://sync2books-compliance-api.apps.kintro.money/v1/items \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"externalId": "SKU-1042",
"name": "500ml Cooking Oil",
"sku": "COOK-OIL-500",
"taxCategory": "VAT_STANDARD",
"productTypeCode": "2",
"classificationCode": "50150000",
"unitCode": "U",
"packagingUnitCode": "NT",
"unitPrice": 3500
}
'import requests
url = "https://sync2books-compliance-api.apps.kintro.money/v1/items"
payload = {
"externalId": "SKU-1042",
"name": "500ml Cooking Oil",
"sku": "COOK-OIL-500",
"taxCategory": "VAT_STANDARD",
"productTypeCode": "2",
"classificationCode": "50150000",
"unitCode": "U",
"packagingUnitCode": "NT",
"unitPrice": 3500
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalId: 'SKU-1042',
name: '500ml Cooking Oil',
sku: 'COOK-OIL-500',
taxCategory: 'VAT_STANDARD',
productTypeCode: '2',
classificationCode: '50150000',
unitCode: 'U',
packagingUnitCode: 'NT',
unitPrice: 3500
})
};
fetch('https://sync2books-compliance-api.apps.kintro.money/v1/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sync2books-compliance-api.apps.kintro.money/v1/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'externalId' => 'SKU-1042',
'name' => '500ml Cooking Oil',
'sku' => 'COOK-OIL-500',
'taxCategory' => 'VAT_STANDARD',
'productTypeCode' => '2',
'classificationCode' => '50150000',
'unitCode' => 'U',
'packagingUnitCode' => 'NT',
'unitPrice' => 3500
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sync2books-compliance-api.apps.kintro.money/v1/items"
payload := strings.NewReader("{\n \"externalId\": \"SKU-1042\",\n \"name\": \"500ml Cooking Oil\",\n \"sku\": \"COOK-OIL-500\",\n \"taxCategory\": \"VAT_STANDARD\",\n \"productTypeCode\": \"2\",\n \"classificationCode\": \"50150000\",\n \"unitCode\": \"U\",\n \"packagingUnitCode\": \"NT\",\n \"unitPrice\": 3500\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sync2books-compliance-api.apps.kintro.money/v1/items")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"SKU-1042\",\n \"name\": \"500ml Cooking Oil\",\n \"sku\": \"COOK-OIL-500\",\n \"taxCategory\": \"VAT_STANDARD\",\n \"productTypeCode\": \"2\",\n \"classificationCode\": \"50150000\",\n \"unitCode\": \"U\",\n \"packagingUnitCode\": \"NT\",\n \"unitPrice\": 3500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sync2books-compliance-api.apps.kintro.money/v1/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"SKU-1042\",\n \"name\": \"500ml Cooking Oil\",\n \"sku\": \"COOK-OIL-500\",\n \"taxCategory\": \"VAT_STANDARD\",\n \"productTypeCode\": \"2\",\n \"classificationCode\": \"50150000\",\n \"unitCode\": \"U\",\n \"packagingUnitCode\": \"NT\",\n \"unitPrice\": 3500\n}"
response = http.request(request)
puts response.read_body{
"data": {
"item": {
"id": "itm_example_1",
"externalId": "SKU-1042",
"name": "500ml Cooking Oil",
"sku": "COOK-OIL-500",
"taxCategory": "VAT_STANDARD",
"taxTypeCode": "B",
"productTypeCode": "2",
"classificationCode": "50150000",
"unitCode": "U",
"packagingUnitCode": "NT",
"unitPrice": 3500,
"stockTracked": true,
"registrationStatus": "PENDING",
"needs": {
"productType": false,
"classificationMapping": false
}
}
}
}Authorizations
Your API key, for example cmp_sk_test_xxxxxxxxxxxxxxxxxxxxxxxx. Create one on the Integrations page of the compliance dashboard.
Body
Your own identifier. Sending it again updates the same item.
100200VAT_STANDARD is KRA tax type B (16%), VAT_ZERO is C (0%), EXEMPT is A, OTHER is D and VAT_8 is E (8%).
VAT_STANDARD, VAT_ZERO, EXEMPT, OTHER, VAT_8 A string, not a number. 1 raw material, 2 finished product, 3 service.
1, 2, 3 100The KRA item classification. Required before the item can be registered. Search with GET /v1/lookups/classifications.
20KRA quantity unit code, for example U. See GET /v1/lookups/codes?codeClass=10.
2KRA packaging unit code, for example NT. See GET /v1/lookups/codes?codeClass=17.
2The default unit price.
x >= 0The business to act for. Required for organisation-wide keys; omit it for a business-bound key. List the ids you can use with GET /v1/businesses.
Response
The item as stored.
Show child attributes
Show child attributes