Wprowadzenie
K2Online API V2 v3.1
K2Online API V2 to REST‑owe API zaprojektowane do integracji systemów zewnętrznych z systemem K2Online. Umożliwia kompleksowe zarządzanie kluczowymi danymi biznesowymi, takimi jak produkty, stany magazynowe, kontrahenci, dokumenty handlowe, czy promocje. API jest przeznaczone dla deweloperów, którzy chcą zautomatyzować wymianę danych pomiędzy K2Online a innymi aplikacjami, np. platformami e-commerce, systemami ERP czy narzędziami CRM.
Architektura API opiera się na operacjach typu REST i wykorzystuje format JSON do przesyłania danych. Wiele operacji, zwłaszcza tych dotyczących masowej aktualizacji danych, jest kolejkowana w celu zapewnienia niezawodności. Status takich operacji można monitorować za pomocą dedykowanych endpointów. Po wysłaniu listy obiektów otrzymujesz transactionNumber, a postęp sprawdzasz przez endpointy …/bulk/status. Standard wszystkich odpowiedzi obejmuje pola errorCode i errorMessage. Autoryzacja odbywa się nagłówkiem apiKey uzyskanym przez endpoint logowania. klucz jest ważny 24 godziny.
Konwencje:
-
Uwierzytelnianie: apiKey w nagłówku pobierany przez POST /api/getapikey. Odpowiedź może zawierać także pole token do ewentualnego drugiego poziomu zabezpieczeń.
-
Format danych: JSON (Content-Type: application/json, Accept: application/json) — zgodnie z przykładami przy każdym zasobie.
-
Stronicowanie: zasoby listujące obsługują pageSize i pageNumber; w odpowiedzi znajdują się pageNumber i nextPageNumber.
-
Operacje masowe: odpowiedź zawiera transactionNumber; status i ewentualne ID zapisanych rekordów odczytasz przez …/bulk/status z polami transactionStatus, transactionStatusDescription, transactionTimestamp, postItemIDs.
Uwierzytelnianie
Logowanie
Code samples
curl --request POST \
--url https://example.com/api/getapikey \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"clientCode":"string","login":"string","password":"string"}'
fetch("https://example.com/api/getapikey", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"body": "{\"clientCode\":\"string\",\"login\":\"string\",\"password\":\"string\"}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/getapikey"
payload = {
"clientCode": "string",
"login": "string",
"password": "string"
}
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"clientCode\":\"string\",\"login\":\"string\",\"password\":\"string\"}");
Request request = new Request.Builder()
.url("https://example.com/api/getapikey")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/getapikey"
payload := strings.NewReader("{\"clientCode\":\"string\",\"login\":\"string\",\"password\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/getapikey");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddParameter("application/json", "{\"clientCode\":\"string\",\"login\":\"string\",\"password\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/getapikey",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"clientCode\":\"string\",\"login\":\"string\",\"password\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/getapikey
Zwraca apiKey (ważny 24 h) służący do autoryzacji wszystkich pozostałych wywołań. W przypadku dodatkowych zabezpieczeń może zwrócić również token. Nie wymaga autoryzacji. Użycie: wywołaj na starcie integracji lub przed wygaśnięciem klucza i dołączaj apiKey w nagłówku kolejnych żądań.
Body parameter
{
"clientCode": "string",
"login": "string",
"password": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» clientCode | body | string | true | Kod klienta |
» login | body | string | true | Login użytkownika API |
» password | body | string | true | Hasło użytkownika API |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"apiKey": "string",
"token": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Uwierzytelniono (errorCode=0) lub błąd (errorCode<>0) | Inline |
Response Schema
Status Code 200
Odpowiedź na uwierzytelnienie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» apiKey | string | false | none | Klucz API ważny 24h |
» token | string | false | none | Dodatkowy token do ew. 2 poziomu zabezpieczeń |
Słownik
Pobieranie listy grup towarowych
Code samples
curl --request GET \
--url https://example.com/api/v2/k2online/product-groups \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/product-groups", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/product-groups"
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/product-groups")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/product-groups"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/product-groups");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/product-groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/product-groups
Zwraca stronicowaną listę grup towarowych wraz z identyfikatorem K2OnlineID. Parametry pageSize i pageNumber kontrolują stronicowanie; w odpowiedzi są pageNumber oraz nextPageNumber. Użycie: jednorazowe pełne pobranie lub okresowe odświeżanie mapowania kategorii po stronie sklepu/PIM.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
pageSize | query | integer | false | Ilość wyników na stronie (domyślnie 20, max 100) |
pageNumber | query | integer | false | Numer strony (domyślnie 1) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"groups": [
{
"ID": "",
"nazwa_jednostki": "KG",
"czy_waga": 1,
"usuniety": 0,
"nazwa_jednostki_pelna": "Kilogram",
"K2OnlineID": 0
}
],
"pageNumber": 0,
"nextPageNumber": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano listę grup towarowych | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» groups | [allOf] | false | none | Lista grup towarowych |
»» Jednostka miary - z identyfikatorem K2Online | ProductUnitGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | ProductUnit | false | none | none |
»»»» ID | number | false | none | none |
»»»» nazwa_jednostki | string | true | none | none |
»»»» czy_waga | integer | false | none | none |
»»»» usuniety | integer | false | none | none |
»»»» nazwa_jednostki_pelna | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» K2OnlineID | integer | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» pageNumber | integer | false | none | Aktualny numer strony |
» nextPageNumber | integer | false | none | Następny numer strony, jeśli nie ma to dane zostały odczytane do końca |
Enumerated Values
Property | Value |
---|---|
czy_waga | 0 |
czy_waga | 1 |
usuniety | 0 |
usuniety | 1 |
Aktualizacja grup towarowych
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/product-groups \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"groups":[{"ID":"","ID_nadrzedny":"","symbol_grupy":"PŁ","nazwa_grupy":"Płaszcze","usuniety":0,"czy_wirtualna":0,"opis_grupy":"Płaszcze","saldo_stanow":1,"czy_naliczac_punkty":0,"czy_usluga":0,"K2OnlineID":0,"K2OnlineID_nadrzedny":0}]}'
fetch("https://example.com/api/v2/k2online/product-groups", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"groups\":[{\"ID\":\"\",\"ID_nadrzedny\":\"\",\"symbol_grupy\":\"PŁ\",\"nazwa_grupy\":\"Płaszcze\",\"usuniety\":0,\"czy_wirtualna\":0,\"opis_grupy\":\"Płaszcze\",\"saldo_stanow\":1,\"czy_naliczac_punkty\":0,\"czy_usluga\":0,\"K2OnlineID\":0,\"K2OnlineID_nadrzedny\":0}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/product-groups"
payload = {"groups": [
{
"ID": "",
"ID_nadrzedny": "",
"symbol_grupy": "PŁ",
"nazwa_grupy": "Płaszcze",
"usuniety": 0,
"czy_wirtualna": 0,
"opis_grupy": "Płaszcze",
"saldo_stanow": 1,
"czy_naliczac_punkty": 0,
"czy_usluga": 0,
"K2OnlineID": 0,
"K2OnlineID_nadrzedny": 0
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"groups\":[{\"ID\":\"\",\"ID_nadrzedny\":\"\",\"symbol_grupy\":\"PŁ\",\"nazwa_grupy\":\"Płaszcze\",\"usuniety\":0,\"czy_wirtualna\":0,\"opis_grupy\":\"Płaszcze\",\"saldo_stanow\":1,\"czy_naliczac_punkty\":0,\"czy_usluga\":0,\"K2OnlineID\":0,\"K2OnlineID_nadrzedny\":0}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/product-groups")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/product-groups"
payload := strings.NewReader("{\"groups\":[{\"ID\":\"\",\"ID_nadrzedny\":\"\",\"symbol_grupy\":\"PŁ\",\"nazwa_grupy\":\"Płaszcze\",\"usuniety\":0,\"czy_wirtualna\":0,\"opis_grupy\":\"Płaszcze\",\"saldo_stanow\":1,\"czy_naliczac_punkty\":0,\"czy_usluga\":0,\"K2OnlineID\":0,\"K2OnlineID_nadrzedny\":0}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/product-groups");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"groups\":[{\"ID\":\"\",\"ID_nadrzedny\":\"\",\"symbol_grupy\":\"PŁ\",\"nazwa_grupy\":\"Płaszcze\",\"usuniety\":0,\"czy_wirtualna\":0,\"opis_grupy\":\"Płaszcze\",\"saldo_stanow\":1,\"czy_naliczac_punkty\":0,\"czy_usluga\":0,\"K2OnlineID\":0,\"K2OnlineID_nadrzedny\":0}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/product-groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"groups\":[{\"ID\":\"\",\"ID_nadrzedny\":\"\",\"symbol_grupy\":\"PŁ\",\"nazwa_grupy\":\"Płaszcze\",\"usuniety\":0,\"czy_wirtualna\":0,\"opis_grupy\":\"Płaszcze\",\"saldo_stanow\":1,\"czy_naliczac_punkty\":0,\"czy_usluga\":0,\"K2OnlineID\":0,\"K2OnlineID_nadrzedny\":0}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/product-groups
Masowa aktualizacja lub dopisanie grup towarowych. Wysyłasz tablicę groups. W odpowiedzi otrzymasz listę błędów dla konkretnych rekordów (postItemErrors) oraz mapowanie lokalnych ID na K2OnlineID w postItemIDs. Użycie: synchronizacja słowników towarowych z systemem źródłowym (np. PIM/ERP).
Body parameter
{
"groups": [
{
"ID": "",
"ID_nadrzedny": "",
"symbol_grupy": "PŁ",
"nazwa_grupy": "Płaszcze",
"usuniety": 0,
"czy_wirtualna": 0,
"opis_grupy": "Płaszcze",
"saldo_stanow": 1,
"czy_naliczac_punkty": 0,
"czy_usluga": 0,
"K2OnlineID": 0,
"K2OnlineID_nadrzedny": 0
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» groups | body | [allOf] | false | Lista grup |
»» Grupa towarowa - z identyfikatorem K2Online | body | ProductGroupGET | false | none |
»»» anonymous | body | ProductGroup | false | none |
»»»» ID | body | number | false | none |
»»»» ID_nadrzedny | body | number | false | none |
»»»» symbol_grupy | body | string | true | none |
»»»» nazwa_grupy | body | string | false | none |
»»»» usuniety | body | integer | false | none |
»»»» czy_wirtualna | body | integer | false | none |
»»»» opis_grupy | body | string | false | none |
»»»» saldo_stanow | body | integer | false | none |
»»»» czy_naliczac_punkty | body | integer | false | none |
»»»» czy_usluga | body | integer | false | none |
»»» anonymous | body | object | false | none |
»»»» K2OnlineID | body | integer | false | none |
»»»» K2OnlineID_nadrzedny | body | integer | false | none |
Enumerated Values
Parameter | Value |
---|---|
»»»» usuniety | 0 |
»»»» usuniety | 1 |
»»»» czy_wirtualna | 0 |
»»»» czy_wirtualna | 1 |
»»»» saldo_stanow | 0 |
»»»» saldo_stanow | 1 |
»»»» czy_naliczac_punkty | 0 |
»»»» czy_naliczac_punkty | 1 |
»»»» czy_usluga | 0 |
»»»» czy_usluga | 1 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"postItemErrors": [
{
"ID": "string",
"errorCode": 0,
"errorMessage": "string"
}
],
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę jednostek (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» postItemErrors | [POSTItemError] | false | none | Lista błędów |
»» Błąd zapisu obiektu POST | POSTItemError | false | none | none |
»»» ID | string | false | none | none |
»»» errorCode | integer | false | none | none |
»»» errorMessage | string | false | none | none |
» postItemIDs | [POSTItemID] | false | none | Lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Pobieranie listy jednostek miary
Code samples
curl --request GET \
--url https://example.com/api/v2/k2online/product-units \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/product-units", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/product-units"
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/product-units")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/product-units"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/product-units");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/product-units",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/product-units
Zwraca stronicowaną listę jednostek z polami m.in. nazwa_jednostki, czy_waga, K2OnlineID. Obsługuje pageSize i pageNumber. Użycie: budowa słownika jednostek w sklepie/PIM i prawidłowe mapowanie jednostek do towarów.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
pageSize | query | integer | false | Ilość wyników na stronie (domyślnie 20, max 100) |
pageNumber | query | integer | false | Numer strony (domyślnie 1) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"units": [
{
"ID": "",
"nazwa_jednostki": "KG",
"czy_waga": 1,
"usuniety": 0,
"nazwa_jednostki_pelna": "Kilogram",
"K2OnlineID": 0
}
],
"pageNumber": 0,
"nextPageNumber": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano listę jednostek miary | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» units | [allOf] | false | none | Lista jednostek |
»» Jednostka miary - z identyfikatorem K2Online | ProductUnitGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | ProductUnit | false | none | none |
»»»» ID | number | false | none | none |
»»»» nazwa_jednostki | string | true | none | none |
»»»» czy_waga | integer | false | none | none |
»»»» usuniety | integer | false | none | none |
»»»» nazwa_jednostki_pelna | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» K2OnlineID | integer | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» pageNumber | integer | false | none | Aktualny numer strony |
» nextPageNumber | integer | false | none | Następny numer strony, jeśli nie ma to dane zostały odczytane do końca |
Enumerated Values
Property | Value |
---|---|
czy_waga | 0 |
czy_waga | 1 |
usuniety | 0 |
usuniety | 1 |
Aktualizacja jednostek miary
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/product-units \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"units":[{"ID":"","nazwa_jednostki":"KG","czy_waga":1,"usuniety":0,"nazwa_jednostki_pelna":"Kilogram"}]}'
fetch("https://example.com/api/v2/k2online/product-units", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"units\":[{\"ID\":\"\",\"nazwa_jednostki\":\"KG\",\"czy_waga\":1,\"usuniety\":0,\"nazwa_jednostki_pelna\":\"Kilogram\"}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/product-units"
payload = {"units": [
{
"ID": "",
"nazwa_jednostki": "KG",
"czy_waga": 1,
"usuniety": 0,
"nazwa_jednostki_pelna": "Kilogram"
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"units\":[{\"ID\":\"\",\"nazwa_jednostki\":\"KG\",\"czy_waga\":1,\"usuniety\":0,\"nazwa_jednostki_pelna\":\"Kilogram\"}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/product-units")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/product-units"
payload := strings.NewReader("{\"units\":[{\"ID\":\"\",\"nazwa_jednostki\":\"KG\",\"czy_waga\":1,\"usuniety\":0,\"nazwa_jednostki_pelna\":\"Kilogram\"}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/product-units");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"units\":[{\"ID\":\"\",\"nazwa_jednostki\":\"KG\",\"czy_waga\":1,\"usuniety\":0,\"nazwa_jednostki_pelna\":\"Kilogram\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/product-units",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"units\":[{\"ID\":\"\",\"nazwa_jednostki\":\"KG\",\"czy_waga\":1,\"usuniety\":0,\"nazwa_jednostki_pelna\":\"Kilogram\"}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/product-units
Masowe utworzenie/aktualizacja jednostek. Wysyłasz jednostki miar, a w odpowiedzi otrzymasz postItemErrors i postItemIDs z nadanymi K2OnlineID dla każdej z wysłanych jednostek miar. Użycie: utrzymanie spójnego słownika jednostek między systemami.
Body parameter
{
"units": [
{
"ID": "",
"nazwa_jednostki": "KG",
"czy_waga": 1,
"usuniety": 0,
"nazwa_jednostki_pelna": "Kilogram"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» units | body | [ProductUnit] | false | Lista jednostek |
»» Jednostka miary | body | ProductUnit | false | none |
»»» ID | body | number | false | none |
»»» nazwa_jednostki | body | string | true | none |
»»» czy_waga | body | integer | false | none |
»»» usuniety | body | integer | false | none |
»»» nazwa_jednostki_pelna | body | string | false | none |
Enumerated Values
Parameter | Value |
---|---|
»»» czy_waga | 0 |
»»» czy_waga | 1 |
»»» usuniety | 0 |
»»» usuniety | 1 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"postItemErrors": [
{
"ID": "string",
"errorCode": 0,
"errorMessage": "string"
}
],
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę jednostek (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» postItemErrors | [POSTItemError] | false | none | Lista błędów |
»» Błąd zapisu obiektu POST | POSTItemError | false | none | none |
»»» ID | string | false | none | none |
»»» errorCode | integer | false | none | none |
»»» errorMessage | string | false | none | none |
» postItemIDs | [POSTItemID] | false | none | Lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Pobieranie listy towarów
Code samples
curl --request GET \
--url https://example.com/api/v2/k2online/products \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/products", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/products"
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/products")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/products");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/products
Zwraca stronicowaną listę towarów z wariantami (SKU), cenami, stawkami VAT i metadanymi (data_modyfikacji, K2OnlineID). Opcjonalny parametr onlyMine służy do filtrowania rekordów powiązanych z własnym ID. Użycie: pełna synchronizacja towarów w sklepie.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
pageSize | query | integer | false | Ilość wyników na stronie (domyślnie 20, max 100) |
pageNumber | query | integer | false | Numer strony (domyślnie 1) |
onlyMine | query | integer | false | Czy zwrócić tylko rekordy z moim ID (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"products": [
{
"ID": "prod-abc-123",
"kod_producenta": "MODEL_XYZ_001",
"id_jednostki_miary": 1,
"id_grupy_towarow": 10,
"nazwa_towaru": "Klawiatura mechaniczna",
"usuniety": 0,
"op_01": "Kolor: Czarny",
"op_02": "Materiał: Aluminium",
"op_03": "Waga: 1.2 kg",
"op_04": "Producent: TechCorp",
"op_05": "Typ: Gamingowa",
"op_06": "Wersja: PRO",
"warianty": [
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025",
"K2OnlineID": 0,
"data_modyfikacji": "string"
}
],
"K2OnlineID": 0,
"symbol_grupy_towarow": "string",
"nazwa_jednostki_miary": "string",
"data_modyfikacji": "string"
}
],
"pageNumber": 0,
"nextPageNumber": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano listę towarów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» products | [allOf] | false | none | Lista towarów |
»» Towar - z identyfikatorem K2Online | ProductGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Product | false | none | none |
»»»» ID | number | false | none | none |
»»»» kod_producenta | string | false | none | none |
»»»» id_jednostki_miary | integer | false | none | none |
»»»» id_grupy_towarow | integer | false | none | none |
»»»» nazwa_towaru | string | false | none | none |
»»»» usuniety | integer | false | none | none |
»»»» op_01 | string | false | none | none |
»»»» op_02 | string | false | none | none |
»»»» op_03 | string | false | none | none |
»»»» op_04 | string | false | none | none |
»»»» op_05 | string | false | none | none |
»»»» op_06 | string | false | none | none |
»»»» warianty | [ProductVariant] | false | none | none |
»»»»» Wariant towaru | ProductVariant | false | none | none |
»»»»»» ID | number | true | none | none |
»»»»»» sku | string | true | none | none |
»»»»»» kod_plu | string | false | none | none |
»»»»»» kod_kreskowy | string | false | none | none |
»»»»»» cena | number(float) | false | none | none |
»»»»»» cena_wejsciowa | number(float) | false | none | none |
»»»»»» stawka_vat | string | false | none | none |
»»»»»» usuniety | integer | false | none | none |
»»»»»» op_01 | string | false | none | none |
»»»»»» op_02 | string | false | none | none |
»»»»»» op_03 | string | false | none | none |
»»»»»» op_04 | string | false | none | none |
»»»»»» op_05 | string | false | none | none |
»»»»»» op_06 | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» K2OnlineID | integer | false | none | none |
»»»» symbol_grupy_towarow | string | false | none | none |
»»»» nazwa_jednostki_miary | string | false | none | none |
»»»» data_modyfikacji | string | false | none | none |
»»»» warianty | [allOf] | false | none | none |
»»»»» Wariant towaru - z identyfikatorem K2Online | ProductVariantGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»»»» anonymous | ProductVariant | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»»»» anonymous | object | false | none | none |
»»»»»»» K2OnlineID | integer | false | none | none |
»»»»»»» data_modyfikacji | string | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» pageNumber | integer | false | none | Aktualny numer strony |
» nextPageNumber | integer | false | none | Następny numer strony, jeśli nie ma to dane zostały odczytane do końca |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
usuniety | 0 |
usuniety | 1 |
Pobieranie statusu transakcji zapisu towarów
Code samples
curl --request GET \
--url 'https://example.com/api/v2/k2online/products/bulk/status?transactionNumber=string' \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/products/bulk/status?transactionNumber=string", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/products/bulk/status"
querystring = {"transactionNumber":"string"}
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/products/bulk/status?transactionNumber=string")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/products/bulk/status?transactionNumber=string"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/products/bulk/status?transactionNumber=string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/products/bulk/status?transactionNumber=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/products/bulk/status
Zwraca stan przetwarzania transakcji wskazanej przez transactionNumber oraz — opcjonalnie (getIDs=1) — listę postItemIDs z K2OnlineID (również dla wariantów). Użycie: odpytywanie w pętli do momentu zakończenia zadania i pobranie mapowania ID.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
transactionNumber | query | string | true | Numer transakcji |
getIDs | query | integer | false | Czy pobrać identyfikatory (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionStatus": 0,
"transactionStatusDescription": "string",
"transactionTimestamp": "string",
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0,
"variants": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano status | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» transactionStatus | integer | false | none | Status transakcji (10 - oczekuje, 20 - rozpoczęto przetwarzanie, 30 - zakończono przetwarzanie) |
» transactionStatusDescription | string | false | none | Opis statusu |
» transactionTimestamp | string | false | none | Czas zmiany statusu |
» postItemIDs | [POSTItemIDWithVariants] | false | none | Ewentualna lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST zawierającego warianty | POSTItemIDWithVariants | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
»»» variants | [POSTItemID] | false | none | none |
»»»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»»»» ID | string | false | none | none |
»»»»» K2OnlineID | integer | false | none | none |
Aktualizacja listy towarów
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/products/bulk \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"products":[{"ID":"prod-abc-123","kod_producenta":"MODEL_XYZ_001","id_jednostki_miary":1,"id_grupy_towarow":10,"nazwa_towaru":"Klawiatura mechaniczna","usuniety":0,"op_01":"Kolor: Czarny","op_02":"Materiał: Aluminium","op_03":"Waga: 1.2 kg","op_04":"Producent: TechCorp","op_05":"Typ: Gamingowa","op_06":"Wersja: PRO","warianty":[{"ID":"var-12345","sku":"PROD-ABC-BLACK-L","kod_plu":"PLU-54321","kod_kreskowy":"1234567890123","cena":99.99,"cena_wejsciowa":50,"stawka_vat":"23","usuniety":0,"op_01":"Rozmiar: L","op_02":"Kolor: Czarny","op_03":"Materiał: Bawełna","op_04":"Dostępność: W magazynie","op_05":"Sezon: Lato","op_06":"Kolekcja: Wiosna 2025"}]}]}'
fetch("https://example.com/api/v2/k2online/products/bulk", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"products\":[{\"ID\":\"prod-abc-123\",\"kod_producenta\":\"MODEL_XYZ_001\",\"id_jednostki_miary\":1,\"id_grupy_towarow\":10,\"nazwa_towaru\":\"Klawiatura mechaniczna\",\"usuniety\":0,\"op_01\":\"Kolor: Czarny\",\"op_02\":\"Materiał: Aluminium\",\"op_03\":\"Waga: 1.2 kg\",\"op_04\":\"Producent: TechCorp\",\"op_05\":\"Typ: Gamingowa\",\"op_06\":\"Wersja: PRO\",\"warianty\":[{\"ID\":\"var-12345\",\"sku\":\"PROD-ABC-BLACK-L\",\"kod_plu\":\"PLU-54321\",\"kod_kreskowy\":\"1234567890123\",\"cena\":99.99,\"cena_wejsciowa\":50,\"stawka_vat\":\"23\",\"usuniety\":0,\"op_01\":\"Rozmiar: L\",\"op_02\":\"Kolor: Czarny\",\"op_03\":\"Materiał: Bawełna\",\"op_04\":\"Dostępność: W magazynie\",\"op_05\":\"Sezon: Lato\",\"op_06\":\"Kolekcja: Wiosna 2025\"}]}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/products/bulk"
payload = {"products": [
{
"ID": "prod-abc-123",
"kod_producenta": "MODEL_XYZ_001",
"id_jednostki_miary": 1,
"id_grupy_towarow": 10,
"nazwa_towaru": "Klawiatura mechaniczna",
"usuniety": 0,
"op_01": "Kolor: Czarny",
"op_02": "Materiał: Aluminium",
"op_03": "Waga: 1.2 kg",
"op_04": "Producent: TechCorp",
"op_05": "Typ: Gamingowa",
"op_06": "Wersja: PRO",
"warianty": [
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025"
}
]
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"products\":[{\"ID\":\"prod-abc-123\",\"kod_producenta\":\"MODEL_XYZ_001\",\"id_jednostki_miary\":1,\"id_grupy_towarow\":10,\"nazwa_towaru\":\"Klawiatura mechaniczna\",\"usuniety\":0,\"op_01\":\"Kolor: Czarny\",\"op_02\":\"Materiał: Aluminium\",\"op_03\":\"Waga: 1.2 kg\",\"op_04\":\"Producent: TechCorp\",\"op_05\":\"Typ: Gamingowa\",\"op_06\":\"Wersja: PRO\",\"warianty\":[{\"ID\":\"var-12345\",\"sku\":\"PROD-ABC-BLACK-L\",\"kod_plu\":\"PLU-54321\",\"kod_kreskowy\":\"1234567890123\",\"cena\":99.99,\"cena_wejsciowa\":50,\"stawka_vat\":\"23\",\"usuniety\":0,\"op_01\":\"Rozmiar: L\",\"op_02\":\"Kolor: Czarny\",\"op_03\":\"Materiał: Bawełna\",\"op_04\":\"Dostępność: W magazynie\",\"op_05\":\"Sezon: Lato\",\"op_06\":\"Kolekcja: Wiosna 2025\"}]}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/products/bulk")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/products/bulk"
payload := strings.NewReader("{\"products\":[{\"ID\":\"prod-abc-123\",\"kod_producenta\":\"MODEL_XYZ_001\",\"id_jednostki_miary\":1,\"id_grupy_towarow\":10,\"nazwa_towaru\":\"Klawiatura mechaniczna\",\"usuniety\":0,\"op_01\":\"Kolor: Czarny\",\"op_02\":\"Materiał: Aluminium\",\"op_03\":\"Waga: 1.2 kg\",\"op_04\":\"Producent: TechCorp\",\"op_05\":\"Typ: Gamingowa\",\"op_06\":\"Wersja: PRO\",\"warianty\":[{\"ID\":\"var-12345\",\"sku\":\"PROD-ABC-BLACK-L\",\"kod_plu\":\"PLU-54321\",\"kod_kreskowy\":\"1234567890123\",\"cena\":99.99,\"cena_wejsciowa\":50,\"stawka_vat\":\"23\",\"usuniety\":0,\"op_01\":\"Rozmiar: L\",\"op_02\":\"Kolor: Czarny\",\"op_03\":\"Materiał: Bawełna\",\"op_04\":\"Dostępność: W magazynie\",\"op_05\":\"Sezon: Lato\",\"op_06\":\"Kolekcja: Wiosna 2025\"}]}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/products/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"products\":[{\"ID\":\"prod-abc-123\",\"kod_producenta\":\"MODEL_XYZ_001\",\"id_jednostki_miary\":1,\"id_grupy_towarow\":10,\"nazwa_towaru\":\"Klawiatura mechaniczna\",\"usuniety\":0,\"op_01\":\"Kolor: Czarny\",\"op_02\":\"Materiał: Aluminium\",\"op_03\":\"Waga: 1.2 kg\",\"op_04\":\"Producent: TechCorp\",\"op_05\":\"Typ: Gamingowa\",\"op_06\":\"Wersja: PRO\",\"warianty\":[{\"ID\":\"var-12345\",\"sku\":\"PROD-ABC-BLACK-L\",\"kod_plu\":\"PLU-54321\",\"kod_kreskowy\":\"1234567890123\",\"cena\":99.99,\"cena_wejsciowa\":50,\"stawka_vat\":\"23\",\"usuniety\":0,\"op_01\":\"Rozmiar: L\",\"op_02\":\"Kolor: Czarny\",\"op_03\":\"Materiał: Bawełna\",\"op_04\":\"Dostępność: W magazynie\",\"op_05\":\"Sezon: Lato\",\"op_06\":\"Kolekcja: Wiosna 2025\"}]}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/products/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"products\":[{\"ID\":\"prod-abc-123\",\"kod_producenta\":\"MODEL_XYZ_001\",\"id_jednostki_miary\":1,\"id_grupy_towarow\":10,\"nazwa_towaru\":\"Klawiatura mechaniczna\",\"usuniety\":0,\"op_01\":\"Kolor: Czarny\",\"op_02\":\"Materiał: Aluminium\",\"op_03\":\"Waga: 1.2 kg\",\"op_04\":\"Producent: TechCorp\",\"op_05\":\"Typ: Gamingowa\",\"op_06\":\"Wersja: PRO\",\"warianty\":[{\"ID\":\"var-12345\",\"sku\":\"PROD-ABC-BLACK-L\",\"kod_plu\":\"PLU-54321\",\"kod_kreskowy\":\"1234567890123\",\"cena\":99.99,\"cena_wejsciowa\":50,\"stawka_vat\":\"23\",\"usuniety\":0,\"op_01\":\"Rozmiar: L\",\"op_02\":\"Kolor: Czarny\",\"op_03\":\"Materiał: Bawełna\",\"op_04\":\"Dostępność: W magazynie\",\"op_05\":\"Sezon: Lato\",\"op_06\":\"Kolekcja: Wiosna 2025\"}]}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/products/bulk
Przyjmuje listę produktów (z wariantami) do przetworzenia i zwraca transactionNumber. Szczegóły statusu i identyfikatory zapisanych rekordów sprawdzisz w GET …/products/bulk/status. Użycie: hurtowa inicjalna migracja lub większe aktualizacje katalogu
Body parameter
{
"products": [
{
"ID": "prod-abc-123",
"kod_producenta": "MODEL_XYZ_001",
"id_jednostki_miary": 1,
"id_grupy_towarow": 10,
"nazwa_towaru": "Klawiatura mechaniczna",
"usuniety": 0,
"op_01": "Kolor: Czarny",
"op_02": "Materiał: Aluminium",
"op_03": "Waga: 1.2 kg",
"op_04": "Producent: TechCorp",
"op_05": "Typ: Gamingowa",
"op_06": "Wersja: PRO",
"warianty": [
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025"
}
]
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» products | body | [Product] | false | Lista towarów |
»» Towar | body | Product | false | none |
»»» ID | body | number | false | none |
»»» kod_producenta | body | string | false | none |
»»» id_jednostki_miary | body | integer | false | none |
»»» id_grupy_towarow | body | integer | false | none |
»»» nazwa_towaru | body | string | false | none |
»»» usuniety | body | integer | false | none |
»»» op_01 | body | string | false | none |
»»» op_02 | body | string | false | none |
»»» op_03 | body | string | false | none |
»»» op_04 | body | string | false | none |
»»» op_05 | body | string | false | none |
»»» op_06 | body | string | false | none |
»»» warianty | body | [ProductVariant] | false | none |
»»»» Wariant towaru | body | ProductVariant | false | none |
»»»»» ID | body | number | true | none |
»»»»» sku | body | string | true | none |
»»»»» kod_plu | body | string | false | none |
»»»»» kod_kreskowy | body | string | false | none |
»»»»» cena | body | number(float) | false | none |
»»»»» cena_wejsciowa | body | number(float) | false | none |
»»»»» stawka_vat | body | string | false | none |
»»»»» usuniety | body | integer | false | none |
»»»»» op_01 | body | string | false | none |
»»»»» op_02 | body | string | false | none |
»»»»» op_03 | body | string | false | none |
»»»»» op_04 | body | string | false | none |
»»»»» op_05 | body | string | false | none |
»»»»» op_06 | body | string | false | none |
Enumerated Values
Parameter | Value |
---|---|
»»» usuniety | 0 |
»»» usuniety | 1 |
»»»»» usuniety | 0 |
»»»»» usuniety | 1 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionNumber": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę towarów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» transactionNumber | string | false | none | Identyfikator transakcji, do sprawdzenia przez endpoint bulk-status |
Cenniki
Pobieranie statusu transakcji zapisu cenników
Code samples
curl --request GET \
--url 'https://example.com/api/v2/k2online/pricelists/bulk/status?transactionNumber=string' \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/pricelists/bulk/status?transactionNumber=string", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/pricelists/bulk/status"
querystring = {"transactionNumber":"string"}
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/pricelists/bulk/status?transactionNumber=string")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/pricelists/bulk/status?transactionNumber=string"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/pricelists/bulk/status?transactionNumber=string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/pricelists/bulk/status?transactionNumber=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/pricelists/bulk/status
Zwraca bieżący stan przetwarzania transakcji (transactionStatus, transactionStatusDescription) oraz — przy getIDs=1 — identyfikatory zapisanych pozycji w postItemIDs. Użycie: monitorowanie i rozwiązywanie ewentualnych błędów zapisu cenników.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
transactionNumber | query | string | true | Numer transakcji |
getIDs | query | integer | false | Czy pobrać identyfikatory (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionStatus": 0,
"transactionStatusDescription": "string",
"transactionTimestamp": "string",
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano status | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» transactionStatus | integer | false | none | Status transakcji (10 - oczekuje, 20 - rozpoczęto przetwarzanie, 30 - zakończono przetwarzanie) |
» transactionStatusDescription | string | false | none | Opis statusu |
» transactionTimestamp | string | false | none | Czas zmiany statusu |
» postItemIDs | [POSTItemID] | false | none | Ewentualna lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Aktualizacja listy cenników
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/pricelists/bulk \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"pricelists":[{"ID":"c0a80113-7815-4673-8a30-e88764132456","nazwa_cennika":"WAW-1","opis_cennika":"Przeceny","grupa_magazynow":"WAW","symbol_magazynu":"MAG01","nr_ceny":1,"pozycje":[{"ID":"c0a80114-7815-4673-8a30-e88764132456","id_wariantu_towaru":205,"cena":12.34,"stawka_vat":"23","wazny_od":"2025-06-01","wazny_do":"2025-06-30"}]}]}'
fetch("https://example.com/api/v2/k2online/pricelists/bulk", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"pricelists\":[{\"ID\":\"c0a80113-7815-4673-8a30-e88764132456\",\"nazwa_cennika\":\"WAW-1\",\"opis_cennika\":\"Przeceny\",\"grupa_magazynow\":\"WAW\",\"symbol_magazynu\":\"MAG01\",\"nr_ceny\":1,\"pozycje\":[{\"ID\":\"c0a80114-7815-4673-8a30-e88764132456\",\"id_wariantu_towaru\":205,\"cena\":12.34,\"stawka_vat\":\"23\",\"wazny_od\":\"2025-06-01\",\"wazny_do\":\"2025-06-30\"}]}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/pricelists/bulk"
payload = {"pricelists": [
{
"ID": "c0a80113-7815-4673-8a30-e88764132456",
"nazwa_cennika": "WAW-1",
"opis_cennika": "Przeceny",
"grupa_magazynow": "WAW",
"symbol_magazynu": "MAG01",
"nr_ceny": 1,
"pozycje": [
{
"ID": "c0a80114-7815-4673-8a30-e88764132456",
"id_wariantu_towaru": 205,
"cena": 12.34,
"stawka_vat": "23",
"wazny_od": "2025-06-01",
"wazny_do": "2025-06-30"
}
]
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"pricelists\":[{\"ID\":\"c0a80113-7815-4673-8a30-e88764132456\",\"nazwa_cennika\":\"WAW-1\",\"opis_cennika\":\"Przeceny\",\"grupa_magazynow\":\"WAW\",\"symbol_magazynu\":\"MAG01\",\"nr_ceny\":1,\"pozycje\":[{\"ID\":\"c0a80114-7815-4673-8a30-e88764132456\",\"id_wariantu_towaru\":205,\"cena\":12.34,\"stawka_vat\":\"23\",\"wazny_od\":\"2025-06-01\",\"wazny_do\":\"2025-06-30\"}]}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/pricelists/bulk")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/pricelists/bulk"
payload := strings.NewReader("{\"pricelists\":[{\"ID\":\"c0a80113-7815-4673-8a30-e88764132456\",\"nazwa_cennika\":\"WAW-1\",\"opis_cennika\":\"Przeceny\",\"grupa_magazynow\":\"WAW\",\"symbol_magazynu\":\"MAG01\",\"nr_ceny\":1,\"pozycje\":[{\"ID\":\"c0a80114-7815-4673-8a30-e88764132456\",\"id_wariantu_towaru\":205,\"cena\":12.34,\"stawka_vat\":\"23\",\"wazny_od\":\"2025-06-01\",\"wazny_do\":\"2025-06-30\"}]}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/pricelists/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"pricelists\":[{\"ID\":\"c0a80113-7815-4673-8a30-e88764132456\",\"nazwa_cennika\":\"WAW-1\",\"opis_cennika\":\"Przeceny\",\"grupa_magazynow\":\"WAW\",\"symbol_magazynu\":\"MAG01\",\"nr_ceny\":1,\"pozycje\":[{\"ID\":\"c0a80114-7815-4673-8a30-e88764132456\",\"id_wariantu_towaru\":205,\"cena\":12.34,\"stawka_vat\":\"23\",\"wazny_od\":\"2025-06-01\",\"wazny_do\":\"2025-06-30\"}]}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/pricelists/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"pricelists\":[{\"ID\":\"c0a80113-7815-4673-8a30-e88764132456\",\"nazwa_cennika\":\"WAW-1\",\"opis_cennika\":\"Przeceny\",\"grupa_magazynow\":\"WAW\",\"symbol_magazynu\":\"MAG01\",\"nr_ceny\":1,\"pozycje\":[{\"ID\":\"c0a80114-7815-4673-8a30-e88764132456\",\"id_wariantu_towaru\":205,\"cena\":12.34,\"stawka_vat\":\"23\",\"wazny_od\":\"2025-06-01\",\"wazny_do\":\"2025-06-30\"}]}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/pricelists/bulk
Wysyłasz listę pozycji cennikowych. Serwer uruchamia zadanie i zwraca transactionNumber. Użycie: masowe ładowanie/odświeżanie cenników.
Body parameter
{
"pricelists": [
{
"ID": "c0a80113-7815-4673-8a30-e88764132456",
"nazwa_cennika": "WAW-1",
"opis_cennika": "Przeceny",
"grupa_magazynow": "WAW",
"symbol_magazynu": "MAG01",
"nr_ceny": 1,
"pozycje": [
{
"ID": "c0a80114-7815-4673-8a30-e88764132456",
"id_wariantu_towaru": 205,
"cena": 12.34,
"stawka_vat": "23",
"wazny_od": "2025-06-01",
"wazny_do": "2025-06-30"
}
]
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» pricelists | body | [PriceList] | false | Lista towarów |
»» Cennik | body | PriceList | false | none |
»»» ID | body | number | true | none |
»»» nazwa_cennika | body | string | false | none |
»»» opis_cennika | body | string | false | none |
»»» grupa_magazynow | body | string | false | none |
»»» symbol_magazynu | body | string | false | none |
»»» nr_ceny | body | integer | false | none |
»»» pozycje | body | [PriceListItem] | false | none |
»»»» Pozycja cennika | body | PriceListItem | false | none |
»»»»» ID | body | string | true | none |
»»»»» id_wariantu_towaru | body | integer | true | none |
»»»»» cena | body | number | true | none |
»»»»» stawka_vat | body | string | true | none |
»»»»» wazny_od | body | string(date) | true | none |
»»»»» wazny_do | body | string(date) | true | none |
Enumerated Values
Parameter | Value |
---|---|
»»» nr_ceny | 0 |
»»» nr_ceny | 1 |
»»» nr_ceny | 2 |
»»» nr_ceny | 3 |
»»» nr_ceny | 4 |
»»» nr_ceny | 5 |
»»» nr_ceny | 6 |
»»» nr_ceny | 7 |
»»» nr_ceny | 8 |
»»» nr_ceny | 9 |
»»» nr_ceny | 10 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionNumber": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę cenników | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» transactionNumber | string | false | none | Identyfikator transakcji, do sprawdzenia przez endpoint bulk-status |
Stany wg SKU
Aktualizacja stanów wg SKU - wartości względne
Code samples
curl --request PUT \
--url https://example.com/api/v2/k2online/sku-quantities \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"change":{"id":1,"magazyn":"001","pozycje":[{"sku":"123456","stan":2}]}}'
fetch("https://example.com/api/v2/k2online/sku-quantities", {
"method": "PUT",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/sku-quantities"
payload = {"change": {
"id": 1,
"magazyn": "001",
"pozycje": [
{
"sku": "123456",
"stan": 2
}
]
}}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("PUT", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/sku-quantities")
.put(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/sku-quantities"
payload := strings.NewReader("{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/sku-quantities");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/sku-quantities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
PUT /api/v2/k2online/sku-quantities
Aktualizuje stany magazynowe wariantów (SKU) — wartości w pozycje[].stan są traktowane jako zmiana stanu w ramach wskazanego magazynu (magazyn). Użycie: szybkie aktualizowanie zmian stanów po sprzedaży/przyjęciu, gdy znasz różnicę stanu.
Body parameter
{
"change": {
"id": 1,
"magazyn": "001",
"pozycje": [
{
"sku": "123456",
"stan": 2
}
]
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» change | body | ArticleSKUChange | false | none |
»» id | body | integer | false | none |
»» magazyn | body | string | false | none |
»» pozycje | body | [ArticleSKU] | false | none |
»»» Towar wg SKU | body | ArticleSKU | false | none |
»»»» sku | body | string | false | none |
»»»» stan | body | number | false | none |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę jednostek (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
Aktualizacja stanów wg SKU - wartości bezwzględne
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/sku-quantities \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"change":{"id":1,"magazyn":"001","pozycje":[{"sku":"123456","stan":2}]}}'
fetch("https://example.com/api/v2/k2online/sku-quantities", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/sku-quantities"
payload = {"change": {
"id": 1,
"magazyn": "001",
"pozycje": [
{
"sku": "123456",
"stan": 2
}
]
}}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/sku-quantities")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/sku-quantities"
payload := strings.NewReader("{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/sku-quantities");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/sku-quantities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"change\":{\"id\":1,\"magazyn\":\"001\",\"pozycje\":[{\"sku\":\"123456\",\"stan\":2}]}}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/sku-quantities
Ustawia docelowe wartości stanów SKU w podanym magazynie — pozycje[].stan oznacza wartość końcową. Użycie: cykliczne ustawienie stanów magazynowych zgodnych z zewnętrznym systemem ERP.
Body parameter
{
"change": {
"id": 1,
"magazyn": "001",
"pozycje": [
{
"sku": "123456",
"stan": 2
}
]
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» change | body | ArticleSKUChange | false | none |
»» id | body | integer | false | none |
»» magazyn | body | string | false | none |
»» pozycje | body | [ArticleSKU] | false | none |
»»» Towar wg SKU | body | ArticleSKU | false | none |
»»»» sku | body | string | false | none |
»»»» stan | body | number | false | none |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę jednostek (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
Kontrahenci
Pobieranie listy kontrahentów
Code samples
curl --request GET \
--url https://example.com/api/v2/k2online/contractors \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/contractors", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/contractors"
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/contractors")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/contractors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/contractors");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/contractors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/contractors
Zwraca stronicowaną listę kontrahentów na potrzeby synchronizacji danych klientów/firm. Parametry stronicowania jak w innych listach. Struktura odpowiedzi zgodna z konwencją (errorCode, errorMessage, dane i nextPageNumber). Użycie: regularna inkrementalna wymiana kontrahentów między CRM/ERP a systemem K2Online.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
pageSize | query | integer | false | Ilość wyników na stronie (domyślnie 20, max 100) |
pageNumber | query | integer | false | Numer strony (domyślnie 1) |
onlyMine | query | integer | false | Czy zwrócić tylko rekordy z moim ID (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"contractors": [
{
"ID": "",
"nazwa_kontrahenta": "Firma Testowa S.A.",
"numer_kontrahenta": "K-001/2024",
"regon": "123456789",
"nip": "9876543210",
"adres_kod_pocztowy": "00-001",
"adres_panstwo": "Polska",
"adres_miasto": "Warszawa",
"adres_ulica": "Marszałkowska",
"adres_numer": "123/45",
"telefon": "+48 123 456 789",
"email": "kontakt@firma.pl",
"rabat": 15.5,
"bank": "mBank S.A.",
"numer_subkonta": "PL10114020040000310212345678",
"forma_zaplaty": "przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"usuniety": 0,
"czy_blokada_sprzedazy": 0,
"czy_przekroczona_karencja": 1,
"tagi": "kluczowy,zagraniczny,vip",
"id_typu_kontrahenta": 2,
"K2OnlineID": 0
}
],
"pageNumber": 0,
"nextPageNumber": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano listę towarów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» contractors | [allOf] | false | none | Lista towarów |
»» Kontrahent - z identyfikatorem K2Online | ContractorGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Contractor | false | none | Model danych kontrahenta |
»»»» ID | number | false | none | none |
»»»» nazwa_kontrahenta | string | false | none | none |
»»»» numer_kontrahenta | string | true | none | none |
»»»» regon | string | false | none | none |
»»»» nip | string | false | none | none |
»»»» adres_kod_pocztowy | string | false | none | none |
»»»» adres_panstwo | string | false | none | none |
»»»» adres_miasto | string | false | none | none |
»»»» adres_ulica | string | false | none | none |
»»»» adres_numer | string | false | none | none |
»»»» telefon | string | false | none | none |
string(email) | false | none | none | |
»»»» rabat | number(float) | false | none | none |
»»»» bank | string | false | none | none |
»»»» numer_subkonta | string | false | none | none |
»»»» forma_zaplaty | string | false | none | none |
»»»» dni_zaplaty | integer(int32) | false | none | none |
»»»» data_biezacego_salda | string(date-time) | false | none | none |
»»»» biezace_saldo | number(float) | false | none | none |
»»»» usuniety | integer(int32) | false | none | none |
»»»» czy_blokada_sprzedazy | integer(int32) | false | none | none |
»»»» czy_przekroczona_karencja | integer(int32) | false | none | none |
»»»» tagi | string | false | none | none |
»»»» id_typu_kontrahenta | integer(int32) | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» K2OnlineID | integer | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» pageNumber | integer | false | none | Aktualny numer strony |
» nextPageNumber | integer | false | none | Następny numer strony, jeśli nie ma to dane zostały odczytane do końca |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
czy_blokada_sprzedazy | 0 |
czy_blokada_sprzedazy | 1 |
czy_przekroczona_karencja | 0 |
czy_przekroczona_karencja | 1 |
Pobieranie statusu transakcji zapisu kontrahentów
Code samples
curl --request GET \
--url 'https://example.com/api/v2/k2online/contractors/bulk/status?transactionNumber=string' \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/contractors/bulk/status?transactionNumber=string", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/contractors/bulk/status"
querystring = {"transactionNumber":"string"}
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/contractors/bulk/status?transactionNumber=string")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/contractors/bulk/status?transactionNumber=string"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/contractors/bulk/status?transactionNumber=string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/contractors/bulk/status?transactionNumber=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/contractors/bulk/status
Zwraca stan przetwarzania (transactionStatus, transactionStatusDescription, transactionTimestamp) oraz — przy getIDs=1 — postItemIDs. Użycie: monitorowanie pocesu wysyłki kontrahentów.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
transactionNumber | query | string | true | Numer transakcji |
getIDs | query | integer | false | Czy pobrać identyfikatory (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionStatus": 0,
"transactionStatusDescription": "string",
"transactionTimestamp": "string",
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano status | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» transactionStatus | integer | false | none | Status transakcji (10 - oczekuje, 20 - rozpoczęto przetwarzanie, 30 - zakończono przetwarzanie) |
» transactionStatusDescription | string | false | none | Opis statusu |
» transactionTimestamp | string | false | none | Czas zmiany statusu |
» postItemIDs | [POSTItemID] | false | none | Ewentualna lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Aktualizacja listy kontrahentów
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/contractors/bulk \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"contractors":[{"ID":"","nazwa_kontrahenta":"Firma Testowa S.A.","numer_kontrahenta":"K-001/2024","regon":"123456789","nip":"9876543210","adres_kod_pocztowy":"00-001","adres_panstwo":"Polska","adres_miasto":"Warszawa","adres_ulica":"Marszałkowska","adres_numer":"123/45","telefon":"+48 123 456 789","email":"kontakt@firma.pl","rabat":15.5,"bank":"mBank S.A.","numer_subkonta":"PL10114020040000310212345678","forma_zaplaty":"przelew","dni_zaplaty":14,"data_biezacego_salda":"2025-06-12T10:00:00+02:00","biezace_saldo":-2500.5,"usuniety":0,"czy_blokada_sprzedazy":0,"czy_przekroczona_karencja":1,"tagi":"kluczowy,zagraniczny,vip","id_typu_kontrahenta":2}]}'
fetch("https://example.com/api/v2/k2online/contractors/bulk", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"contractors\":[{\"ID\":\"\",\"nazwa_kontrahenta\":\"Firma Testowa S.A.\",\"numer_kontrahenta\":\"K-001/2024\",\"regon\":\"123456789\",\"nip\":\"9876543210\",\"adres_kod_pocztowy\":\"00-001\",\"adres_panstwo\":\"Polska\",\"adres_miasto\":\"Warszawa\",\"adres_ulica\":\"Marszałkowska\",\"adres_numer\":\"123/45\",\"telefon\":\"+48 123 456 789\",\"email\":\"kontakt@firma.pl\",\"rabat\":15.5,\"bank\":\"mBank S.A.\",\"numer_subkonta\":\"PL10114020040000310212345678\",\"forma_zaplaty\":\"przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"usuniety\":0,\"czy_blokada_sprzedazy\":0,\"czy_przekroczona_karencja\":1,\"tagi\":\"kluczowy,zagraniczny,vip\",\"id_typu_kontrahenta\":2}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/contractors/bulk"
payload = {"contractors": [
{
"ID": "",
"nazwa_kontrahenta": "Firma Testowa S.A.",
"numer_kontrahenta": "K-001/2024",
"regon": "123456789",
"nip": "9876543210",
"adres_kod_pocztowy": "00-001",
"adres_panstwo": "Polska",
"adres_miasto": "Warszawa",
"adres_ulica": "Marszałkowska",
"adres_numer": "123/45",
"telefon": "+48 123 456 789",
"email": "kontakt@firma.pl",
"rabat": 15.5,
"bank": "mBank S.A.",
"numer_subkonta": "PL10114020040000310212345678",
"forma_zaplaty": "przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"usuniety": 0,
"czy_blokada_sprzedazy": 0,
"czy_przekroczona_karencja": 1,
"tagi": "kluczowy,zagraniczny,vip",
"id_typu_kontrahenta": 2
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"contractors\":[{\"ID\":\"\",\"nazwa_kontrahenta\":\"Firma Testowa S.A.\",\"numer_kontrahenta\":\"K-001/2024\",\"regon\":\"123456789\",\"nip\":\"9876543210\",\"adres_kod_pocztowy\":\"00-001\",\"adres_panstwo\":\"Polska\",\"adres_miasto\":\"Warszawa\",\"adres_ulica\":\"Marszałkowska\",\"adres_numer\":\"123/45\",\"telefon\":\"+48 123 456 789\",\"email\":\"kontakt@firma.pl\",\"rabat\":15.5,\"bank\":\"mBank S.A.\",\"numer_subkonta\":\"PL10114020040000310212345678\",\"forma_zaplaty\":\"przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"usuniety\":0,\"czy_blokada_sprzedazy\":0,\"czy_przekroczona_karencja\":1,\"tagi\":\"kluczowy,zagraniczny,vip\",\"id_typu_kontrahenta\":2}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/contractors/bulk")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/contractors/bulk"
payload := strings.NewReader("{\"contractors\":[{\"ID\":\"\",\"nazwa_kontrahenta\":\"Firma Testowa S.A.\",\"numer_kontrahenta\":\"K-001/2024\",\"regon\":\"123456789\",\"nip\":\"9876543210\",\"adres_kod_pocztowy\":\"00-001\",\"adres_panstwo\":\"Polska\",\"adres_miasto\":\"Warszawa\",\"adres_ulica\":\"Marszałkowska\",\"adres_numer\":\"123/45\",\"telefon\":\"+48 123 456 789\",\"email\":\"kontakt@firma.pl\",\"rabat\":15.5,\"bank\":\"mBank S.A.\",\"numer_subkonta\":\"PL10114020040000310212345678\",\"forma_zaplaty\":\"przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"usuniety\":0,\"czy_blokada_sprzedazy\":0,\"czy_przekroczona_karencja\":1,\"tagi\":\"kluczowy,zagraniczny,vip\",\"id_typu_kontrahenta\":2}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/contractors/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"contractors\":[{\"ID\":\"\",\"nazwa_kontrahenta\":\"Firma Testowa S.A.\",\"numer_kontrahenta\":\"K-001/2024\",\"regon\":\"123456789\",\"nip\":\"9876543210\",\"adres_kod_pocztowy\":\"00-001\",\"adres_panstwo\":\"Polska\",\"adres_miasto\":\"Warszawa\",\"adres_ulica\":\"Marszałkowska\",\"adres_numer\":\"123/45\",\"telefon\":\"+48 123 456 789\",\"email\":\"kontakt@firma.pl\",\"rabat\":15.5,\"bank\":\"mBank S.A.\",\"numer_subkonta\":\"PL10114020040000310212345678\",\"forma_zaplaty\":\"przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"usuniety\":0,\"czy_blokada_sprzedazy\":0,\"czy_przekroczona_karencja\":1,\"tagi\":\"kluczowy,zagraniczny,vip\",\"id_typu_kontrahenta\":2}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/contractors/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"contractors\":[{\"ID\":\"\",\"nazwa_kontrahenta\":\"Firma Testowa S.A.\",\"numer_kontrahenta\":\"K-001/2024\",\"regon\":\"123456789\",\"nip\":\"9876543210\",\"adres_kod_pocztowy\":\"00-001\",\"adres_panstwo\":\"Polska\",\"adres_miasto\":\"Warszawa\",\"adres_ulica\":\"Marszałkowska\",\"adres_numer\":\"123/45\",\"telefon\":\"+48 123 456 789\",\"email\":\"kontakt@firma.pl\",\"rabat\":15.5,\"bank\":\"mBank S.A.\",\"numer_subkonta\":\"PL10114020040000310212345678\",\"forma_zaplaty\":\"przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"usuniety\":0,\"czy_blokada_sprzedazy\":0,\"czy_przekroczona_karencja\":1,\"tagi\":\"kluczowy,zagraniczny,vip\",\"id_typu_kontrahenta\":2}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/contractors/bulk
Przyjmuje listę kontrahentów do zapisu i zwraca transactionNumber do sprawdzenia przez …/contractors/bulk/status. Użycie: inicjalna migracja lub większe poprawki danych kontrahentów.
Body parameter
{
"contractors": [
{
"ID": "",
"nazwa_kontrahenta": "Firma Testowa S.A.",
"numer_kontrahenta": "K-001/2024",
"regon": "123456789",
"nip": "9876543210",
"adres_kod_pocztowy": "00-001",
"adres_panstwo": "Polska",
"adres_miasto": "Warszawa",
"adres_ulica": "Marszałkowska",
"adres_numer": "123/45",
"telefon": "+48 123 456 789",
"email": "kontakt@firma.pl",
"rabat": 15.5,
"bank": "mBank S.A.",
"numer_subkonta": "PL10114020040000310212345678",
"forma_zaplaty": "przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"usuniety": 0,
"czy_blokada_sprzedazy": 0,
"czy_przekroczona_karencja": 1,
"tagi": "kluczowy,zagraniczny,vip",
"id_typu_kontrahenta": 2
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» contractors | body | [Contractor] | false | Lista towarów |
»» Kontrahent | body | Contractor | false | Model danych kontrahenta |
»»» ID | body | number | false | none |
»»» nazwa_kontrahenta | body | string | false | none |
»»» numer_kontrahenta | body | string | true | none |
»»» regon | body | string | false | none |
»»» nip | body | string | false | none |
»»» adres_kod_pocztowy | body | string | false | none |
»»» adres_panstwo | body | string | false | none |
»»» adres_miasto | body | string | false | none |
»»» adres_ulica | body | string | false | none |
»»» adres_numer | body | string | false | none |
»»» telefon | body | string | false | none |
body | string(email) | false | none | |
»»» rabat | body | number(float) | false | none |
»»» bank | body | string | false | none |
»»» numer_subkonta | body | string | false | none |
»»» forma_zaplaty | body | string | false | none |
»»» dni_zaplaty | body | integer(int32) | false | none |
»»» data_biezacego_salda | body | string(date-time) | false | none |
»»» biezace_saldo | body | number(float) | false | none |
»»» usuniety | body | integer(int32) | false | none |
»»» czy_blokada_sprzedazy | body | integer(int32) | false | none |
»»» czy_przekroczona_karencja | body | integer(int32) | false | none |
»»» tagi | body | string | false | none |
»»» id_typu_kontrahenta | body | integer(int32) | false | none |
Enumerated Values
Parameter | Value |
---|---|
»»» usuniety | 0 |
»»» usuniety | 1 |
»»» czy_blokada_sprzedazy | 0 |
»»» czy_blokada_sprzedazy | 1 |
»»» czy_przekroczona_karencja | 0 |
»»» czy_przekroczona_karencja | 1 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionNumber": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę kontrahentów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» transactionNumber | string | false | none | Identyfikator transakcji, do sprawdzenia przez endpoint bulk-status |
Aktualizacja sald kontrahentów
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/contractors-current-limit \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"contractors":[{"ID":"","numer_kontrahenta":"K-001/2024","forma_zaplaty":"Przelew","dni_zaplaty":14,"data_biezacego_salda":"2025-06-12T10:00:00+02:00","biezace_saldo":-2500.5,"powod_braku":"string"}]}'
fetch("https://example.com/api/v2/k2online/contractors-current-limit", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"contractors\":[{\"ID\":\"\",\"numer_kontrahenta\":\"K-001/2024\",\"forma_zaplaty\":\"Przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"powod_braku\":\"string\"}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/contractors-current-limit"
payload = {"contractors": [
{
"ID": "",
"numer_kontrahenta": "K-001/2024",
"forma_zaplaty": "Przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"powod_braku": "string"
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"contractors\":[{\"ID\":\"\",\"numer_kontrahenta\":\"K-001/2024\",\"forma_zaplaty\":\"Przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"powod_braku\":\"string\"}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/contractors-current-limit")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/contractors-current-limit"
payload := strings.NewReader("{\"contractors\":[{\"ID\":\"\",\"numer_kontrahenta\":\"K-001/2024\",\"forma_zaplaty\":\"Przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"powod_braku\":\"string\"}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/contractors-current-limit");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"contractors\":[{\"ID\":\"\",\"numer_kontrahenta\":\"K-001/2024\",\"forma_zaplaty\":\"Przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"powod_braku\":\"string\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/contractors-current-limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"contractors\":[{\"ID\":\"\",\"numer_kontrahenta\":\"K-001/2024\",\"forma_zaplaty\":\"Przelew\",\"dni_zaplaty\":14,\"data_biezacego_salda\":\"2025-06-12T10:00:00+02:00\",\"biezace_saldo\":-2500.5,\"powod_braku\":\"string\"}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/contractors-current-limit
Opis
Body parameter
{
"contractors": [
{
"ID": "",
"numer_kontrahenta": "K-001/2024",
"forma_zaplaty": "Przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"powod_braku": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» contractors | body | [ContractorCurrentLimit] | false | Lista kontrahentów |
»» Kontrahent - zmiana salda | body | ContractorCurrentLimit | false | none |
»»» ID | body | string | false | none |
»»» numer_kontrahenta | body | string | true | none |
»»» forma_zaplaty | body | string | false | none |
»»» dni_zaplaty | body | integer(int32) | false | none |
»»» data_biezacego_salda | body | string(date) | false | none |
»»» biezace_saldo | body | number(float) | false | none |
»»» powod_braku | body | string | false | none |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"postItemErrors": [
{
"ID": "string",
"errorCode": 0,
"errorMessage": "string"
}
],
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę kontrahentów (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» postItemErrors | [POSTItemError] | false | none | Lista błędów |
»» Błąd zapisu obiektu POST | POSTItemError | false | none | none |
»»» ID | string | false | none | none |
»»» errorCode | integer | false | none | none |
»»» errorMessage | string | false | none | none |
» postItemIDs | [POSTItemID] | false | none | Lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Dokumenty
Pobieranie listy kwitów kasowych
Code samples
curl --request GET \
--url https://example.com/api/v2/k2online/bills \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/bills", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/bills"
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/bills")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/bills"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/bills");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/bills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/bills
Zwraca listę kwitów kasowych (KP/KW) na potrzeby rozrachunków i uzgadniania płatności. Parametry stronicowania dostępne jak w pozostałych listach. Użycie: integracje finansowo‑kasowe, zasilanie raportów i rozliczeń w zewnętrznych systemach.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
pageSize | query | integer | false | Ilość wyników na stronie (domyślnie 20, max 100) |
pageNumber | query | integer | false | Numer strony (domyślnie 1) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"bills": [
{
"K2OnlineID": 0,
"zmiana_data_rozpoczecia": "string",
"zmiana_data_zakonczenia": "string",
"wartosc": 0,
"data": "string",
"login": "string",
"symbol_magazynu": "string",
"symbol_stanowiska": "string",
"symbol_kwitu": "string",
"opis": null,
"numer_kwitu": "string"
}
],
"pageNumber": 0,
"nextPageNumber": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano listę kwitów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» bills | [BillGET] | false | none | Lista towarów |
»» Kwit kasowy - z identyfikatorem K2Online | BillGET | false | none | none |
»»» K2OnlineID | integer | false | none | none |
»»» zmiana_data_rozpoczecia | string | false | none | none |
»»» zmiana_data_zakonczenia | string | false | none | none |
»»» wartosc | number | false | none | none |
»»» data | string | false | none | none |
»»» login | string | false | none | none |
»»» symbol_magazynu | string | false | none | none |
»»» symbol_stanowiska | string | false | none | none |
»»» symbol_kwitu | string | false | none | none |
»»» opis | any | false | none | none |
»»» numer_kwitu | string | false | none | none |
» pageNumber | integer | false | none | Aktualny numer strony |
» nextPageNumber | integer | false | none | Następny numer strony, jeśli nie ma to dane zostały odczytane do końca |
Pobieranie listy dokumentów
Code samples
curl --request GET \
--url https://example.com/api/v2/k2online/documents \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/documents", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/documents"
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/documents")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/documents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/documents");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/documents
Zwraca listę dokumentów (np. sprzedażowych/magazynowych) wraz z podstawowymi polami do synchronizacji. Parametry stronicowania jak w innych listach. Użycie: raportowanie, integracje księgowe i weryfikacja przepływu.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
storeSymbol | query | string | false | Symbol magazynu |
documentSymbols | query | string | false | Lista symboli typu dokumentu (z przecinkami) |
idDokumentuK2Online | query | string | false | Identyfikator dokumentu K2Online (jeśli podany, nieistotne są symbole magazynu i dokumentu) |
dateFrom | query | string | false | Data początkowa YYYY-MM-DD hh:mm:ss |
pageSize | query | integer | false | Ilość wyników na stronie (domyślnie 20, max 100) |
pageNumber | query | integer | false | Numer strony (domyślnie 1) |
onlyMine | query | integer | false | Czy zwrócić tylko rekordy z moim ID (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"documents": [
{
"ID": "c0a80112-7815-4673-8a30-e88764132456",
"id_dokumentu_nadrzednego": 12345,
"symbol_dokumentu": "FV",
"numer_dokumentu": "FV/001/2025",
"data_dokumentu": "2025-07-15T10:30:00+02:00",
"magazyn": "MAG01",
"magazyn_z": "MAGWZ",
"magazyn_do": "MAGPZ",
"usuniety": 0,
"status_zatwierdzony": 1,
"data_zatwierdzenia": "2025-07-15T10:31:00+02:00",
"opis": "Faktura sprzedaży dla klienta ABC.",
"login": "jan.kowalski",
"nip_paragonu": "1234567890",
"pozycje": [
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "string",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0,
"sku": "string",
"kod_plu": "string",
"data_modyfikacji": "string"
}
],
"platnosci": [
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0,
"id_platnosci": 0
}
],
"id_kontrahenta": 101,
"K2OnlineID": 0,
"data_modyfikacji": "string"
}
],
"pageNumber": 0,
"nextPageNumber": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano listę dokumentów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» documents | [allOf] | false | none | Lista dokumentów |
»» Dokument - z identyfikatorem K2Online | DocumentGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Document | false | none | none |
»»»» ID | number | false | none | none |
»»»» id_dokumentu_nadrzednego | integer | false | none | none |
»»»» symbol_dokumentu | string | false | none | none |
»»»» numer_dokumentu | string | true | none | none |
»»»» data_dokumentu | string(date-time) | true | none | none |
»»»» magazyn | string | true | none | none |
»»»» magazyn_z | string | false | none | none |
»»»» magazyn_do | string | false | none | none |
»»»» usuniety | integer | false | none | none |
»»»» status_zatwierdzony | integer | false | none | none |
»»»» data_zatwierdzenia | string | false | none | none |
»»»» opis | string | false | none | none |
»»»» login | string | false | none | none |
»»»» nip_paragonu | string | false | none | none |
»»»» pozycje | [DocumentItem] | false | none | none |
»»»»» Pozycja dokumentu | DocumentItem | false | none | none |
»»»»»» ID | string | false | none | none |
»»»»»» id_wariantu_towaru | integer | true | none | none |
»»»»»» nazwa_towaru | string | false | none | none |
»»»»»» ilosc | number(float) | true | none | none |
»»»»»» cena | number(float) | false | none | none |
»»»»»» cena_koncowa | number(float) | true | none | none |
»»»»»» stawka_vat | string | true | none | none |
»»»»»» magazyn_symbol | string | false | none | none |
»»»»»» bylo | integer | false | none | none |
»»»»»» usuniety | integer | false | none | none |
»»»» platnosci | [DocumentPayment] | false | none | none |
»»»»» Płatność dokumentu | DocumentPayment | false | none | none |
»»»»»» symbol_formy_platnosci | string | true | none | none |
»»»»»» wartosc | number(float) | true | none | none |
»»»»»» termin_platnosci | string(date) | false | none | none |
»»»»»» kod_bonu | string | false | none | none |
»»»»»» usuniety | integer | false | none | none |
»»»» id_kontrahenta | integer | true | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» K2OnlineID | integer | false | none | none |
»»»» data_modyfikacji | string | false | none | none |
»»»» pozycje | [allOf] | false | none | none |
»»»»» Pozycja dokumentu - z identyfikatorem K2Online | DocumentItemGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»»»» anonymous | DocumentItem | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»»»» anonymous | object | false | none | none |
»»»»»»» sku | string | false | none | none |
»»»»»»» kod_plu | string | false | none | none |
»»»»»»» nazwa_towaru | string | false | none | none |
»»»»»»» data_modyfikacji | string | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»» platnosci | [allOf] | false | none | none |
»»»»» Płatność dokumentu - z identyfikatorem K2Online | DocumentPaymentGET | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»»»» anonymous | DocumentPayment | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»»»» anonymous | object | false | none | none |
»»»»»»» id_platnosci | integer | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» pageNumber | integer | false | none | Aktualny numer strony |
» nextPageNumber | integer | false | none | Następny numer strony, jeśli nie ma to dane zostały odczytane do końca |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
status_zatwierdzony | 0 |
status_zatwierdzony | 1 |
bylo | 0 |
bylo | 1 |
usuniety | 0 |
usuniety | 1 |
usuniety | 0 |
usuniety | 1 |
Pobieranie statusu transakcji zapisu dokumenów
Code samples
curl --request GET \
--url 'https://example.com/api/v2/k2online/documents/bulk/status?transactionNumber=string' \
--header 'Accept: application/json' \
--header 'apiKey: API_KEY'
fetch("https://example.com/api/v2/k2online/documents/bulk/status?transactionNumber=string", {
"method": "GET",
"headers": {
"Accept": "application/json",
"apiKey": "API_KEY"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/documents/bulk/status"
querystring = {"transactionNumber":"string"}
headers = {
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/documents/bulk/status?transactionNumber=string")
.get()
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/documents/bulk/status?transactionNumber=string"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/documents/bulk/status?transactionNumber=string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/documents/bulk/status?transactionNumber=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
GET /api/v2/k2online/documents/bulk/status
Sprawdza status zadania masowego zapisu dokumentów wskazanego przez transactionNumber. Opcjonalnie zwraca postItemIDs (przy getIDs=1). Użycie: nadzór nad importem dokumentów oraz diagnostyka błędów.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
transactionNumber | query | string | true | Numer transakcji |
getIDs | query | integer | false | Czy pobrać identyfikatory (0 - nie, 1 - tak) |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionStatus": 0,
"transactionStatusDescription": "string",
"transactionTimestamp": "string",
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Odczytano status | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=OK) |
» errorMessage | string | true | none | Opis błędu |
» transactionStatus | integer | false | none | Status transakcji (10 - oczekuje, 20 - rozpoczęto przetwarzanie, 30 - zakończono przetwarzanie) |
» transactionStatusDescription | string | false | none | Opis statusu |
» transactionTimestamp | string | false | none | Czas zmiany statusu |
» postItemIDs | [POSTItemID] | false | none | Ewentualna lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Aktualizacja listy dokumentów
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/documents/bulk \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"documents":[{"ID":"c0a80112-7815-4673-8a30-e88764132456","id_dokumentu_nadrzednego":12345,"symbol_dokumentu":"FV","numer_dokumentu":"FV/001/2025","data_dokumentu":"2025-07-15T10:30:00+02:00","magazyn":"MAG01","magazyn_z":"MAGWZ","magazyn_do":"MAGPZ","usuniety":0,"status_zatwierdzony":1,"data_zatwierdzenia":"2025-07-15T10:31:00+02:00","opis":"Faktura sprzedaży dla klienta ABC.","login":"jan.kowalski","nip_paragonu":"1234567890","pozycje":[{"ID":"item-c0a80112-7815","id_wariantu_towaru":205,"nazwa_towaru":"Towar testowy","ilosc":2.5,"cena":120,"cena_koncowa":100,"stawka_vat":"23","magazyn_symbol":"MAG01","bylo":1,"usuniety":0}],"platnosci":[{"symbol_formy_platnosci":"P","wartosc":250.75,"termin_platnosci":"2025-08-15","kod_bonu":"BON-XYZ-123","usuniety":0}],"id_kontrahenta":101}]}'
fetch("https://example.com/api/v2/k2online/documents/bulk", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"documents\":[{\"ID\":\"c0a80112-7815-4673-8a30-e88764132456\",\"id_dokumentu_nadrzednego\":12345,\"symbol_dokumentu\":\"FV\",\"numer_dokumentu\":\"FV/001/2025\",\"data_dokumentu\":\"2025-07-15T10:30:00+02:00\",\"magazyn\":\"MAG01\",\"magazyn_z\":\"MAGWZ\",\"magazyn_do\":\"MAGPZ\",\"usuniety\":0,\"status_zatwierdzony\":1,\"data_zatwierdzenia\":\"2025-07-15T10:31:00+02:00\",\"opis\":\"Faktura sprzedaży dla klienta ABC.\",\"login\":\"jan.kowalski\",\"nip_paragonu\":\"1234567890\",\"pozycje\":[{\"ID\":\"item-c0a80112-7815\",\"id_wariantu_towaru\":205,\"nazwa_towaru\":\"Towar testowy\",\"ilosc\":2.5,\"cena\":120,\"cena_koncowa\":100,\"stawka_vat\":\"23\",\"magazyn_symbol\":\"MAG01\",\"bylo\":1,\"usuniety\":0}],\"platnosci\":[{\"symbol_formy_platnosci\":\"P\",\"wartosc\":250.75,\"termin_platnosci\":\"2025-08-15\",\"kod_bonu\":\"BON-XYZ-123\",\"usuniety\":0}],\"id_kontrahenta\":101}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/documents/bulk"
payload = {"documents": [
{
"ID": "c0a80112-7815-4673-8a30-e88764132456",
"id_dokumentu_nadrzednego": 12345,
"symbol_dokumentu": "FV",
"numer_dokumentu": "FV/001/2025",
"data_dokumentu": "2025-07-15T10:30:00+02:00",
"magazyn": "MAG01",
"magazyn_z": "MAGWZ",
"magazyn_do": "MAGPZ",
"usuniety": 0,
"status_zatwierdzony": 1,
"data_zatwierdzenia": "2025-07-15T10:31:00+02:00",
"opis": "Faktura sprzedaży dla klienta ABC.",
"login": "jan.kowalski",
"nip_paragonu": "1234567890",
"pozycje": [
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "Towar testowy",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0
}
],
"platnosci": [
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0
}
],
"id_kontrahenta": 101
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"documents\":[{\"ID\":\"c0a80112-7815-4673-8a30-e88764132456\",\"id_dokumentu_nadrzednego\":12345,\"symbol_dokumentu\":\"FV\",\"numer_dokumentu\":\"FV/001/2025\",\"data_dokumentu\":\"2025-07-15T10:30:00+02:00\",\"magazyn\":\"MAG01\",\"magazyn_z\":\"MAGWZ\",\"magazyn_do\":\"MAGPZ\",\"usuniety\":0,\"status_zatwierdzony\":1,\"data_zatwierdzenia\":\"2025-07-15T10:31:00+02:00\",\"opis\":\"Faktura sprzedaży dla klienta ABC.\",\"login\":\"jan.kowalski\",\"nip_paragonu\":\"1234567890\",\"pozycje\":[{\"ID\":\"item-c0a80112-7815\",\"id_wariantu_towaru\":205,\"nazwa_towaru\":\"Towar testowy\",\"ilosc\":2.5,\"cena\":120,\"cena_koncowa\":100,\"stawka_vat\":\"23\",\"magazyn_symbol\":\"MAG01\",\"bylo\":1,\"usuniety\":0}],\"platnosci\":[{\"symbol_formy_platnosci\":\"P\",\"wartosc\":250.75,\"termin_platnosci\":\"2025-08-15\",\"kod_bonu\":\"BON-XYZ-123\",\"usuniety\":0}],\"id_kontrahenta\":101}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/documents/bulk")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/documents/bulk"
payload := strings.NewReader("{\"documents\":[{\"ID\":\"c0a80112-7815-4673-8a30-e88764132456\",\"id_dokumentu_nadrzednego\":12345,\"symbol_dokumentu\":\"FV\",\"numer_dokumentu\":\"FV/001/2025\",\"data_dokumentu\":\"2025-07-15T10:30:00+02:00\",\"magazyn\":\"MAG01\",\"magazyn_z\":\"MAGWZ\",\"magazyn_do\":\"MAGPZ\",\"usuniety\":0,\"status_zatwierdzony\":1,\"data_zatwierdzenia\":\"2025-07-15T10:31:00+02:00\",\"opis\":\"Faktura sprzedaży dla klienta ABC.\",\"login\":\"jan.kowalski\",\"nip_paragonu\":\"1234567890\",\"pozycje\":[{\"ID\":\"item-c0a80112-7815\",\"id_wariantu_towaru\":205,\"nazwa_towaru\":\"Towar testowy\",\"ilosc\":2.5,\"cena\":120,\"cena_koncowa\":100,\"stawka_vat\":\"23\",\"magazyn_symbol\":\"MAG01\",\"bylo\":1,\"usuniety\":0}],\"platnosci\":[{\"symbol_formy_platnosci\":\"P\",\"wartosc\":250.75,\"termin_platnosci\":\"2025-08-15\",\"kod_bonu\":\"BON-XYZ-123\",\"usuniety\":0}],\"id_kontrahenta\":101}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/documents/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"documents\":[{\"ID\":\"c0a80112-7815-4673-8a30-e88764132456\",\"id_dokumentu_nadrzednego\":12345,\"symbol_dokumentu\":\"FV\",\"numer_dokumentu\":\"FV/001/2025\",\"data_dokumentu\":\"2025-07-15T10:30:00+02:00\",\"magazyn\":\"MAG01\",\"magazyn_z\":\"MAGWZ\",\"magazyn_do\":\"MAGPZ\",\"usuniety\":0,\"status_zatwierdzony\":1,\"data_zatwierdzenia\":\"2025-07-15T10:31:00+02:00\",\"opis\":\"Faktura sprzedaży dla klienta ABC.\",\"login\":\"jan.kowalski\",\"nip_paragonu\":\"1234567890\",\"pozycje\":[{\"ID\":\"item-c0a80112-7815\",\"id_wariantu_towaru\":205,\"nazwa_towaru\":\"Towar testowy\",\"ilosc\":2.5,\"cena\":120,\"cena_koncowa\":100,\"stawka_vat\":\"23\",\"magazyn_symbol\":\"MAG01\",\"bylo\":1,\"usuniety\":0}],\"platnosci\":[{\"symbol_formy_platnosci\":\"P\",\"wartosc\":250.75,\"termin_platnosci\":\"2025-08-15\",\"kod_bonu\":\"BON-XYZ-123\",\"usuniety\":0}],\"id_kontrahenta\":101}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/documents/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"documents\":[{\"ID\":\"c0a80112-7815-4673-8a30-e88764132456\",\"id_dokumentu_nadrzednego\":12345,\"symbol_dokumentu\":\"FV\",\"numer_dokumentu\":\"FV/001/2025\",\"data_dokumentu\":\"2025-07-15T10:30:00+02:00\",\"magazyn\":\"MAG01\",\"magazyn_z\":\"MAGWZ\",\"magazyn_do\":\"MAGPZ\",\"usuniety\":0,\"status_zatwierdzony\":1,\"data_zatwierdzenia\":\"2025-07-15T10:31:00+02:00\",\"opis\":\"Faktura sprzedaży dla klienta ABC.\",\"login\":\"jan.kowalski\",\"nip_paragonu\":\"1234567890\",\"pozycje\":[{\"ID\":\"item-c0a80112-7815\",\"id_wariantu_towaru\":205,\"nazwa_towaru\":\"Towar testowy\",\"ilosc\":2.5,\"cena\":120,\"cena_koncowa\":100,\"stawka_vat\":\"23\",\"magazyn_symbol\":\"MAG01\",\"bylo\":1,\"usuniety\":0}],\"platnosci\":[{\"symbol_formy_platnosci\":\"P\",\"wartosc\":250.75,\"termin_platnosci\":\"2025-08-15\",\"kod_bonu\":\"BON-XYZ-123\",\"usuniety\":0}],\"id_kontrahenta\":101}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/documents/bulk
Opis
Body parameter
{
"documents": [
{
"ID": "c0a80112-7815-4673-8a30-e88764132456",
"id_dokumentu_nadrzednego": 12345,
"symbol_dokumentu": "FV",
"numer_dokumentu": "FV/001/2025",
"data_dokumentu": "2025-07-15T10:30:00+02:00",
"magazyn": "MAG01",
"magazyn_z": "MAGWZ",
"magazyn_do": "MAGPZ",
"usuniety": 0,
"status_zatwierdzony": 1,
"data_zatwierdzenia": "2025-07-15T10:31:00+02:00",
"opis": "Faktura sprzedaży dla klienta ABC.",
"login": "jan.kowalski",
"nip_paragonu": "1234567890",
"pozycje": [
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "Towar testowy",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0
}
],
"platnosci": [
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0
}
],
"id_kontrahenta": 101
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» documents | body | [Document] | false | Lista dokumentów |
»» Dokument | body | Document | false | none |
»»» ID | body | number | false | none |
»»» id_dokumentu_nadrzednego | body | integer | false | none |
»»» symbol_dokumentu | body | string | false | none |
»»» numer_dokumentu | body | string | true | none |
»»» data_dokumentu | body | string(date-time) | true | none |
»»» magazyn | body | string | true | none |
»»» magazyn_z | body | string | false | none |
»»» magazyn_do | body | string | false | none |
»»» usuniety | body | integer | false | none |
»»» status_zatwierdzony | body | integer | false | none |
»»» data_zatwierdzenia | body | string | false | none |
»»» opis | body | string | false | none |
»»» login | body | string | false | none |
»»» nip_paragonu | body | string | false | none |
»»» pozycje | body | [DocumentItem] | false | none |
»»»» Pozycja dokumentu | body | DocumentItem | false | none |
»»»»» ID | body | string | false | none |
»»»»» id_wariantu_towaru | body | integer | true | none |
»»»»» nazwa_towaru | body | string | false | none |
»»»»» ilosc | body | number(float) | true | none |
»»»»» cena | body | number(float) | false | none |
»»»»» cena_koncowa | body | number(float) | true | none |
»»»»» stawka_vat | body | string | true | none |
»»»»» magazyn_symbol | body | string | false | none |
»»»»» bylo | body | integer | false | none |
»»»»» usuniety | body | integer | false | none |
»»» platnosci | body | [DocumentPayment] | false | none |
»»»» Płatność dokumentu | body | DocumentPayment | false | none |
»»»»» symbol_formy_platnosci | body | string | true | none |
»»»»» wartosc | body | number(float) | true | none |
»»»»» termin_platnosci | body | string(date) | false | none |
»»»»» kod_bonu | body | string | false | none |
»»»»» usuniety | body | integer | false | none |
»»» id_kontrahenta | body | integer | true | none |
Enumerated Values
Parameter | Value |
---|---|
»»» usuniety | 0 |
»»» usuniety | 1 |
»»» status_zatwierdzony | 0 |
»»» status_zatwierdzony | 1 |
»»»»» bylo | 0 |
»»»»» bylo | 1 |
»»»»» usuniety | 0 |
»»»»» usuniety | 1 |
»»»»» usuniety | 0 |
»»»»» usuniety | 1 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"transactionNumber": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę dokumentów | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» transactionNumber | string | false | none | Identyfikator transakcji, do sprawdzenia przez endpoint bulk-status |
Aktualizacja statusów zatwierdzenia
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/documents-confirmation \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"documents":[{"ID":"string","numer_dokumentu":"string","status_zatwierdzony":0,"data_zatwierdzenia":"string"}]}'
fetch("https://example.com/api/v2/k2online/documents-confirmation", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"documents\":[{\"ID\":\"string\",\"numer_dokumentu\":\"string\",\"status_zatwierdzony\":0,\"data_zatwierdzenia\":\"string\"}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/documents-confirmation"
payload = {"documents": [
{
"ID": "string",
"numer_dokumentu": "string",
"status_zatwierdzony": 0,
"data_zatwierdzenia": "string"
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"documents\":[{\"ID\":\"string\",\"numer_dokumentu\":\"string\",\"status_zatwierdzony\":0,\"data_zatwierdzenia\":\"string\"}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/documents-confirmation")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/documents-confirmation"
payload := strings.NewReader("{\"documents\":[{\"ID\":\"string\",\"numer_dokumentu\":\"string\",\"status_zatwierdzony\":0,\"data_zatwierdzenia\":\"string\"}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/documents-confirmation");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"documents\":[{\"ID\":\"string\",\"numer_dokumentu\":\"string\",\"status_zatwierdzony\":0,\"data_zatwierdzenia\":\"string\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/documents-confirmation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"documents\":[{\"ID\":\"string\",\"numer_dokumentu\":\"string\",\"status_zatwierdzony\":0,\"data_zatwierdzenia\":\"string\"}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/documents-confirmation
Umożliwia masowe ustawienie statusu zatwierdzenia dokumentów (status_zatwierdzony, data_zatwierdzenia) na podstawie wskazanych identyfikatorów/numerów dokumentu. Użycie: synchronizacja statusów dokumentów między systemami (np. akceptacja w ERP → aktualizacja w K2Online).
Body parameter
{
"documents": [
{
"ID": "string",
"numer_dokumentu": "string",
"status_zatwierdzony": 0,
"data_zatwierdzenia": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» documents | body | [DocumentConfirmation] | false | Lista jednostek |
»» Zatwierdzenie dokumentu | body | DocumentConfirmation | false | none |
»»» ID | body | number | false | none |
»»» numer_dokumentu | body | string | false | none |
»»» status_zatwierdzony | body | integer | false | none |
»»» data_zatwierdzenia | body | string | false | none |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"postItemErrors": [
{
"ID": "string",
"errorCode": 0,
"errorMessage": "string"
}
],
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę dokumentów (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=uwierzytelniono) |
» errorMessage | string | true | none | Opis błędu |
» postItemErrors | [POSTItemError] | false | none | Lista błędów |
»» Błąd zapisu obiektu POST | POSTItemError | false | none | none |
»»» ID | string | false | none | none |
»»» errorCode | integer | false | none | none |
»»» errorMessage | string | false | none | none |
» postItemIDs | [POSTItemID] | false | none | Lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Promocje
Aktualizacja promocji
Code samples
curl --request POST \
--url https://example.com/api/v2/k2online/promotions \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: API_KEY' \
--data '{"promotions":[{"symbol_akcji":"string","nazwa_akcji":"string","data_od":"2019-08-24T14:15:22Z","data_do":"2019-08-24T14:15:22Z","usuniety":0,"poniedzialek":"string","wtorek":"string","sroda":"string","czwartek":"string","piatek":"string","sobota":"string","niedziela":"string","identyfikator_wyzwalajacy":"string","limit_czas":0,"limit_sztuki":0,"limit_wartosc":0,"limit_paragony":0,"id_statusu_akcji":1,"rozlozenie_upustow":"p","id_grupy_kontrahentow":0,"kolejnosc":100,"czy_uwzgledniac_rabat_kontrahenta":0,"magazyny":[0],"regulamin":"string","minimalna_wartosc_dokumentu":0,"czy_mozna_laczyc":0,"czy_mozna_laczyc_pozycje":0,"zawsze_uwzgledniaj":0,"czy_naglowek":0,"id_typu_akcji":0,"parametry":{},"modele":["string"],"grupy_towarowe":["string"],"cechy":["string"],"warianty":["string"],"rozmiary":["string"]}]}'
fetch("https://example.com/api/v2/k2online/promotions", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
},
"body": "{\"promotions\":[{\"symbol_akcji\":\"string\",\"nazwa_akcji\":\"string\",\"data_od\":\"2019-08-24T14:15:22Z\",\"data_do\":\"2019-08-24T14:15:22Z\",\"usuniety\":0,\"poniedzialek\":\"string\",\"wtorek\":\"string\",\"sroda\":\"string\",\"czwartek\":\"string\",\"piatek\":\"string\",\"sobota\":\"string\",\"niedziela\":\"string\",\"identyfikator_wyzwalajacy\":\"string\",\"limit_czas\":0,\"limit_sztuki\":0,\"limit_wartosc\":0,\"limit_paragony\":0,\"id_statusu_akcji\":1,\"rozlozenie_upustow\":\"p\",\"id_grupy_kontrahentow\":0,\"kolejnosc\":100,\"czy_uwzgledniac_rabat_kontrahenta\":0,\"magazyny\":[0],\"regulamin\":\"string\",\"minimalna_wartosc_dokumentu\":0,\"czy_mozna_laczyc\":0,\"czy_mozna_laczyc_pozycje\":0,\"zawsze_uwzgledniaj\":0,\"czy_naglowek\":0,\"id_typu_akcji\":0,\"parametry\":{},\"modele\":[\"string\"],\"grupy_towarowe\":[\"string\"],\"cechy\":[\"string\"],\"warianty\":[\"string\"],\"rozmiary\":[\"string\"]}]}"
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
import requests
url = "https://example.com/api/v2/k2online/promotions"
payload = {"promotions": [
{
"symbol_akcji": "string",
"nazwa_akcji": "string",
"data_od": "2019-08-24T14:15:22Z",
"data_do": "2019-08-24T14:15:22Z",
"usuniety": 0,
"poniedzialek": "string",
"wtorek": "string",
"sroda": "string",
"czwartek": "string",
"piatek": "string",
"sobota": "string",
"niedziela": "string",
"identyfikator_wyzwalajacy": "string",
"limit_czas": 0,
"limit_sztuki": 0,
"limit_wartosc": 0,
"limit_paragony": 0,
"id_statusu_akcji": 1,
"rozlozenie_upustow": "p",
"id_grupy_kontrahentow": 0,
"kolejnosc": 100,
"czy_uwzgledniac_rabat_kontrahenta": 0,
"magazyny": [0],
"regulamin": "string",
"minimalna_wartosc_dokumentu": 0,
"czy_mozna_laczyc": 0,
"czy_mozna_laczyc_pozycje": 0,
"zawsze_uwzgledniaj": 0,
"czy_naglowek": 0,
"id_typu_akcji": 0,
"parametry": {},
"modele": ["string"],
"grupy_towarowe": ["string"],
"cechy": ["string"],
"warianty": ["string"],
"rozmiary": ["string"]
}
]}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"apiKey": "API_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"promotions\":[{\"symbol_akcji\":\"string\",\"nazwa_akcji\":\"string\",\"data_od\":\"2019-08-24T14:15:22Z\",\"data_do\":\"2019-08-24T14:15:22Z\",\"usuniety\":0,\"poniedzialek\":\"string\",\"wtorek\":\"string\",\"sroda\":\"string\",\"czwartek\":\"string\",\"piatek\":\"string\",\"sobota\":\"string\",\"niedziela\":\"string\",\"identyfikator_wyzwalajacy\":\"string\",\"limit_czas\":0,\"limit_sztuki\":0,\"limit_wartosc\":0,\"limit_paragony\":0,\"id_statusu_akcji\":1,\"rozlozenie_upustow\":\"p\",\"id_grupy_kontrahentow\":0,\"kolejnosc\":100,\"czy_uwzgledniac_rabat_kontrahenta\":0,\"magazyny\":[0],\"regulamin\":\"string\",\"minimalna_wartosc_dokumentu\":0,\"czy_mozna_laczyc\":0,\"czy_mozna_laczyc_pozycje\":0,\"zawsze_uwzgledniaj\":0,\"czy_naglowek\":0,\"id_typu_akcji\":0,\"parametry\":{},\"modele\":[\"string\"],\"grupy_towarowe\":[\"string\"],\"cechy\":[\"string\"],\"warianty\":[\"string\"],\"rozmiary\":[\"string\"]}]}");
Request request = new Request.Builder()
.url("https://example.com/api/v2/k2online/promotions")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("apiKey", "API_KEY")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v2/k2online/promotions"
payload := strings.NewReader("{\"promotions\":[{\"symbol_akcji\":\"string\",\"nazwa_akcji\":\"string\",\"data_od\":\"2019-08-24T14:15:22Z\",\"data_do\":\"2019-08-24T14:15:22Z\",\"usuniety\":0,\"poniedzialek\":\"string\",\"wtorek\":\"string\",\"sroda\":\"string\",\"czwartek\":\"string\",\"piatek\":\"string\",\"sobota\":\"string\",\"niedziela\":\"string\",\"identyfikator_wyzwalajacy\":\"string\",\"limit_czas\":0,\"limit_sztuki\":0,\"limit_wartosc\":0,\"limit_paragony\":0,\"id_statusu_akcji\":1,\"rozlozenie_upustow\":\"p\",\"id_grupy_kontrahentow\":0,\"kolejnosc\":100,\"czy_uwzgledniac_rabat_kontrahenta\":0,\"magazyny\":[0],\"regulamin\":\"string\",\"minimalna_wartosc_dokumentu\":0,\"czy_mozna_laczyc\":0,\"czy_mozna_laczyc_pozycje\":0,\"zawsze_uwzgledniaj\":0,\"czy_naglowek\":0,\"id_typu_akcji\":0,\"parametry\":{},\"modele\":[\"string\"],\"grupy_towarowe\":[\"string\"],\"cechy\":[\"string\"],\"warianty\":[\"string\"],\"rozmiary\":[\"string\"]}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("apiKey", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var client = new RestClient("https://example.com/api/v2/k2online/promotions");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("apiKey", "API_KEY");
request.AddParameter("application/json", "{\"promotions\":[{\"symbol_akcji\":\"string\",\"nazwa_akcji\":\"string\",\"data_od\":\"2019-08-24T14:15:22Z\",\"data_do\":\"2019-08-24T14:15:22Z\",\"usuniety\":0,\"poniedzialek\":\"string\",\"wtorek\":\"string\",\"sroda\":\"string\",\"czwartek\":\"string\",\"piatek\":\"string\",\"sobota\":\"string\",\"niedziela\":\"string\",\"identyfikator_wyzwalajacy\":\"string\",\"limit_czas\":0,\"limit_sztuki\":0,\"limit_wartosc\":0,\"limit_paragony\":0,\"id_statusu_akcji\":1,\"rozlozenie_upustow\":\"p\",\"id_grupy_kontrahentow\":0,\"kolejnosc\":100,\"czy_uwzgledniac_rabat_kontrahenta\":0,\"magazyny\":[0],\"regulamin\":\"string\",\"minimalna_wartosc_dokumentu\":0,\"czy_mozna_laczyc\":0,\"czy_mozna_laczyc_pozycje\":0,\"zawsze_uwzgledniaj\":0,\"czy_naglowek\":0,\"id_typu_akcji\":0,\"parametry\":{},\"modele\":[\"string\"],\"grupy_towarowe\":[\"string\"],\"cechy\":[\"string\"],\"warianty\":[\"string\"],\"rozmiary\":[\"string\"]}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/api/v2/k2online/promotions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"promotions\":[{\"symbol_akcji\":\"string\",\"nazwa_akcji\":\"string\",\"data_od\":\"2019-08-24T14:15:22Z\",\"data_do\":\"2019-08-24T14:15:22Z\",\"usuniety\":0,\"poniedzialek\":\"string\",\"wtorek\":\"string\",\"sroda\":\"string\",\"czwartek\":\"string\",\"piatek\":\"string\",\"sobota\":\"string\",\"niedziela\":\"string\",\"identyfikator_wyzwalajacy\":\"string\",\"limit_czas\":0,\"limit_sztuki\":0,\"limit_wartosc\":0,\"limit_paragony\":0,\"id_statusu_akcji\":1,\"rozlozenie_upustow\":\"p\",\"id_grupy_kontrahentow\":0,\"kolejnosc\":100,\"czy_uwzgledniac_rabat_kontrahenta\":0,\"magazyny\":[0],\"regulamin\":\"string\",\"minimalna_wartosc_dokumentu\":0,\"czy_mozna_laczyc\":0,\"czy_mozna_laczyc_pozycje\":0,\"zawsze_uwzgledniaj\":0,\"czy_naglowek\":0,\"id_typu_akcji\":0,\"parametry\":{},\"modele\":[\"string\"],\"grupy_towarowe\":[\"string\"],\"cechy\":[\"string\"],\"warianty\":[\"string\"],\"rozmiary\":[\"string\"]}]}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"apiKey: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
POST /api/v2/k2online/promotions
Masowe tworzenie/aktualizacja akcji promocyjnych (zakres dat, warunki, ograniczenia, powiązania z magazynami, grupami towarowymi i modelami). Odpowiedź zawiera standardowe postItemErrors/postItemIDs. Użycie: hurtowe wgrywanie definicji promocji z systemu marketing automation/ERP.
Body parameter
{
"promotions": [
{
"symbol_akcji": "string",
"nazwa_akcji": "string",
"data_od": "2019-08-24T14:15:22Z",
"data_do": "2019-08-24T14:15:22Z",
"usuniety": 0,
"poniedzialek": "string",
"wtorek": "string",
"sroda": "string",
"czwartek": "string",
"piatek": "string",
"sobota": "string",
"niedziela": "string",
"identyfikator_wyzwalajacy": "string",
"limit_czas": 0,
"limit_sztuki": 0,
"limit_wartosc": 0,
"limit_paragony": 0,
"id_statusu_akcji": 1,
"rozlozenie_upustow": "p",
"id_grupy_kontrahentow": 0,
"kolejnosc": 100,
"czy_uwzgledniac_rabat_kontrahenta": 0,
"magazyny": [
0
],
"regulamin": "string",
"minimalna_wartosc_dokumentu": 0,
"czy_mozna_laczyc": 0,
"czy_mozna_laczyc_pozycje": 0,
"zawsze_uwzgledniaj": 0,
"czy_naglowek": 0,
"id_typu_akcji": 0,
"parametry": {},
"modele": [
"string"
],
"grupy_towarowe": [
"string"
],
"cechy": [
"string"
],
"warianty": [
"string"
],
"rozmiary": [
"string"
]
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» promotions | body | [Promotion] | false | Lista promocji |
»» Promocja | body | Promotion | false | none |
»»» symbol_akcji | body | string | true | none |
»»» nazwa_akcji | body | string | false | none |
»»» data_od | body | string(date-time) | false | none |
»»» data_do | body | string(date-time) | false | none |
»»» usuniety | body | integer | false | none |
»»» poniedzialek | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» wtorek | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» sroda | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» czwartek | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» piatek | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» sobota | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» niedziela | body | string | false | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
»»» identyfikator_wyzwalajacy | body | string | false | none |
»»» limit_czas | body | integer | false | none |
»»» limit_sztuki | body | integer | false | none |
»»» limit_wartosc | body | number | false | none |
»»» limit_paragony | body | integer | false | none |
»»» id_statusu_akcji | body | integer | false | none |
»»» rozlozenie_upustow | body | string | false | none |
»»» id_grupy_kontrahentow | body | integer | false | none |
»»» kolejnosc | body | integer | false | none |
»»» czy_uwzgledniac_rabat_kontrahenta | body | integer | false | none |
»»» magazyny | body | [integer] | false | none |
»»» regulamin | body | string | false | none |
»»» minimalna_wartosc_dokumentu | body | number | false | none |
»»» czy_mozna_laczyc | body | integer | false | none |
»»» czy_mozna_laczyc_pozycje | body | integer | false | none |
»»» zawsze_uwzgledniaj | body | integer | false | none |
»»» czy_naglowek | body | integer | true | none |
»»» id_typu_akcji | body | integer | false | none |
»»» parametry | body | object | false | none |
»»» modele | body | [string] | false | none |
»»» grupy_towarowe | body | [string] | false | none |
»»» cechy | body | [string] | false | none |
»»» warianty | body | [string] | false | none |
»»» rozmiary | body | [string] | false | none |
Enumerated Values
Parameter | Value |
---|---|
»»» usuniety | 0 |
»»» usuniety | 1 |
»»» id_statusu_akcji | 1 |
»»» id_statusu_akcji | 2 |
»»» id_statusu_akcji | 3 |
»»» id_statusu_akcji | 4 |
»»» id_statusu_akcji | 5 |
»»» rozlozenie_upustow | p |
»»» rozlozenie_upustow | v |
»»» czy_uwzgledniac_rabat_kontrahenta | 0 |
»»» czy_uwzgledniac_rabat_kontrahenta | 1 |
»»» czy_mozna_laczyc | 0 |
»»» czy_mozna_laczyc | 1 |
»»» czy_mozna_laczyc_pozycje | 0 |
»»» czy_mozna_laczyc_pozycje | 1 |
»»» zawsze_uwzgledniaj | 0 |
»»» zawsze_uwzgledniaj | 1 |
»»» czy_naglowek | 0 |
»»» czy_naglowek | 1 |
Example responses
200 Response
{
"errorCode": 0,
"errorMessage": "string",
"postItemErrors": [
{
"ID": "string",
"errorCode": 0,
"errorMessage": "string"
}
],
"postItemIDs": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | [OK] | Przetworzono listę promocji (ewentualne błędy w tabeli postItemErrors) | Inline |
400 | [Bad Request] | Błędne dane wejściowe | None |
401 | [Unauthorized] | Błąd uwierzytelnienia | None |
500 | [Internal Server Error] | Wewnętrzny błąd serwera | None |
Response Schema
Status Code 200
Odpowiedź na polecenie
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» errorCode | integer | true | none | Kod błędu (0=przetworzono listę) |
» errorMessage | string | true | none | Opis błędu |
» postItemErrors | [POSTItemError] | false | none | Lista błędów |
»» Błąd zapisu obiektu POST | POSTItemError | false | none | none |
»»» ID | string | false | none | none |
»»» errorCode | integer | false | none | none |
»»» errorMessage | string | false | none | none |
» postItemIDs | [POSTItemID] | false | none | Lista zapisanych identyfikatorów |
»» Identyfikator zapisu obiektu POST | POSTItemID | false | none | none |
»»» ID | string | false | none | none |
»»» K2OnlineID | integer | false | none | none |
Schemas
ArticleSKU
{
"sku": "123456",
"stan": 2
}
Towar wg SKU
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
sku | string | false | none | none |
stan | number | false | none | none |
ArticleSKUChange
{
"id": 1,
"magazyn": "001",
"pozycje": [
{
"sku": "123456",
"stan": 2
}
]
}
Zmiana stanów
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | none |
magazyn | string | false | none | none |
pozycje | [ArticleSKU] | false | none | none |
BillGET
{
"K2OnlineID": 0,
"zmiana_data_rozpoczecia": "string",
"zmiana_data_zakonczenia": "string",
"wartosc": 0,
"data": "string",
"login": "string",
"symbol_magazynu": "string",
"symbol_stanowiska": "string",
"symbol_kwitu": "string",
"opis": null,
"numer_kwitu": "string"
}
Kwit kasowy - z identyfikatorem K2Online
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
K2OnlineID | integer | false | none | none |
zmiana_data_rozpoczecia | string | false | none | none |
zmiana_data_zakonczenia | string | false | none | none |
wartosc | number | false | none | none |
data | string | false | none | none |
login | string | false | none | none |
symbol_magazynu | string | false | none | none |
symbol_stanowiska | string | false | none | none |
symbol_kwitu | string | false | none | none |
opis | any | false | none | none |
numer_kwitu | string | false | none | none |
Contractor
{
"ID": "",
"nazwa_kontrahenta": "Firma Testowa S.A.",
"numer_kontrahenta": "K-001/2024",
"regon": "123456789",
"nip": "9876543210",
"adres_kod_pocztowy": "00-001",
"adres_panstwo": "Polska",
"adres_miasto": "Warszawa",
"adres_ulica": "Marszałkowska",
"adres_numer": "123/45",
"telefon": "+48 123 456 789",
"email": "kontakt@firma.pl",
"rabat": 15.5,
"bank": "mBank S.A.",
"numer_subkonta": "PL10114020040000310212345678",
"forma_zaplaty": "przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"usuniety": 0,
"czy_blokada_sprzedazy": 0,
"czy_przekroczona_karencja": 1,
"tagi": "kluczowy,zagraniczny,vip",
"id_typu_kontrahenta": 2
}
Kontrahent
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | false | none | none |
nazwa_kontrahenta | string | false | none | none |
numer_kontrahenta | string | true | none | none |
regon | string | false | none | none |
nip | string | false | none | none |
adres_kod_pocztowy | string | false | none | none |
adres_panstwo | string | false | none | none |
adres_miasto | string | false | none | none |
adres_ulica | string | false | none | none |
adres_numer | string | false | none | none |
telefon | string | false | none | none |
string(email) | false | none | none | |
rabat | number(float) | false | none | none |
bank | string | false | none | none |
numer_subkonta | string | false | none | none |
forma_zaplaty | string | false | none | none |
dni_zaplaty | integer(int32) | false | none | none |
data_biezacego_salda | string(date-time) | false | none | none |
biezace_saldo | number(float) | false | none | none |
usuniety | integer(int32) | false | none | none |
czy_blokada_sprzedazy | integer(int32) | false | none | none |
czy_przekroczona_karencja | integer(int32) | false | none | none |
tagi | string | false | none | none |
id_typu_kontrahenta | integer(int32) | false | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
czy_blokada_sprzedazy | 0 |
czy_blokada_sprzedazy | 1 |
czy_przekroczona_karencja | 0 |
czy_przekroczona_karencja | 1 |
ContractorCurrentLimit
{
"ID": "",
"numer_kontrahenta": "K-001/2024",
"forma_zaplaty": "Przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"powod_braku": "string"
}
Kontrahent - zmiana salda
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | string | false | none | none |
numer_kontrahenta | string | true | none | none |
forma_zaplaty | string | false | none | none |
dni_zaplaty | integer(int32) | false | none | none |
data_biezacego_salda | string(date) | false | none | none |
biezace_saldo | number(float) | false | none | none |
powod_braku | string | false | none | none |
ContractorGET
{
"ID": "",
"nazwa_kontrahenta": "Firma Testowa S.A.",
"numer_kontrahenta": "K-001/2024",
"regon": "123456789",
"nip": "9876543210",
"adres_kod_pocztowy": "00-001",
"adres_panstwo": "Polska",
"adres_miasto": "Warszawa",
"adres_ulica": "Marszałkowska",
"adres_numer": "123/45",
"telefon": "+48 123 456 789",
"email": "kontakt@firma.pl",
"rabat": 15.5,
"bank": "mBank S.A.",
"numer_subkonta": "PL10114020040000310212345678",
"forma_zaplaty": "przelew",
"dni_zaplaty": 14,
"data_biezacego_salda": "2025-06-12T10:00:00+02:00",
"biezace_saldo": -2500.5,
"usuniety": 0,
"czy_blokada_sprzedazy": 0,
"czy_przekroczona_karencja": 1,
"tagi": "kluczowy,zagraniczny,vip",
"id_typu_kontrahenta": 2,
"K2OnlineID": 0
}
Kontrahent - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | Contractor | false | none | Model danych kontrahenta |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» K2OnlineID | integer | false | none | none |
Document
{
"ID": "c0a80112-7815-4673-8a30-e88764132456",
"id_dokumentu_nadrzednego": 12345,
"symbol_dokumentu": "FV",
"numer_dokumentu": "FV/001/2025",
"data_dokumentu": "2025-07-15T10:30:00+02:00",
"magazyn": "MAG01",
"magazyn_z": "MAGWZ",
"magazyn_do": "MAGPZ",
"usuniety": 0,
"status_zatwierdzony": 1,
"data_zatwierdzenia": "2025-07-15T10:31:00+02:00",
"opis": "Faktura sprzedaży dla klienta ABC.",
"login": "jan.kowalski",
"nip_paragonu": "1234567890",
"pozycje": [
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "Towar testowy",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0
}
],
"platnosci": [
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0
}
],
"id_kontrahenta": 101
}
Dokument
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | false | none | none |
id_dokumentu_nadrzednego | integer | false | none | none |
symbol_dokumentu | string | false | none | none |
numer_dokumentu | string | true | none | none |
data_dokumentu | string(date-time) | true | none | none |
magazyn | string | true | none | none |
magazyn_z | string | false | none | none |
magazyn_do | string | false | none | none |
usuniety | integer | false | none | none |
status_zatwierdzony | integer | false | none | none |
data_zatwierdzenia | string | false | none | none |
opis | string | false | none | none |
login | string | false | none | none |
nip_paragonu | string | false | none | none |
pozycje | [DocumentItem] | false | none | none |
platnosci | [DocumentPayment] | false | none | none |
id_kontrahenta | integer | true | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
status_zatwierdzony | 0 |
status_zatwierdzony | 1 |
DocumentConfirmation
{
"ID": "string",
"numer_dokumentu": "string",
"status_zatwierdzony": 0,
"data_zatwierdzenia": "string"
}
Zatwierdzenie dokumentu
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | false | none | none |
numer_dokumentu | string | false | none | none |
status_zatwierdzony | integer | false | none | none |
data_zatwierdzenia | string | false | none | none |
DocumentGET
{
"ID": "c0a80112-7815-4673-8a30-e88764132456",
"id_dokumentu_nadrzednego": 12345,
"symbol_dokumentu": "FV",
"numer_dokumentu": "FV/001/2025",
"data_dokumentu": "2025-07-15T10:30:00+02:00",
"magazyn": "MAG01",
"magazyn_z": "MAGWZ",
"magazyn_do": "MAGPZ",
"usuniety": 0,
"status_zatwierdzony": 1,
"data_zatwierdzenia": "2025-07-15T10:31:00+02:00",
"opis": "Faktura sprzedaży dla klienta ABC.",
"login": "jan.kowalski",
"nip_paragonu": "1234567890",
"pozycje": [
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "string",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0,
"sku": "string",
"kod_plu": "string",
"data_modyfikacji": "string"
}
],
"platnosci": [
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0,
"id_platnosci": 0
}
],
"id_kontrahenta": 101,
"K2OnlineID": 0,
"data_modyfikacji": "string"
}
Dokument - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | Document | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» K2OnlineID | integer | false | none | none |
» data_modyfikacji | string | false | none | none |
» pozycje | [DocumentItemGET] | false | none | none |
» platnosci | [DocumentPaymentGET] | false | none | none |
DocumentItem
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "Towar testowy",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0
}
Pozycja dokumentu
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | string | false | none | none |
id_wariantu_towaru | integer | true | none | none |
nazwa_towaru | string | false | none | none |
ilosc | number(float) | true | none | none |
cena | number(float) | false | none | none |
cena_koncowa | number(float) | true | none | none |
stawka_vat | string | true | none | none |
magazyn_symbol | string | false | none | none |
bylo | integer | false | none | none |
usuniety | integer | false | none | none |
Enumerated Values
Property | Value |
---|---|
bylo | 0 |
bylo | 1 |
usuniety | 0 |
usuniety | 1 |
DocumentItemGET
{
"ID": "item-c0a80112-7815",
"id_wariantu_towaru": 205,
"nazwa_towaru": "string",
"ilosc": 2.5,
"cena": 120,
"cena_koncowa": 100,
"stawka_vat": "23",
"magazyn_symbol": "MAG01",
"bylo": 1,
"usuniety": 0,
"sku": "string",
"kod_plu": "string",
"data_modyfikacji": "string"
}
Pozycja dokumentu - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | DocumentItem | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» sku | string | false | none | none |
» kod_plu | string | false | none | none |
» nazwa_towaru | string | false | none | none |
» data_modyfikacji | string | false | none | none |
DocumentPayment
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0
}
Płatność dokumentu
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
symbol_formy_platnosci | string | true | none | none |
wartosc | number(float) | true | none | none |
termin_platnosci | string(date) | false | none | none |
kod_bonu | string | false | none | none |
usuniety | integer | false | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
DocumentPaymentGET
{
"symbol_formy_platnosci": "P",
"wartosc": 250.75,
"termin_platnosci": "2025-08-15",
"kod_bonu": "BON-XYZ-123",
"usuniety": 0,
"id_platnosci": 0
}
Płatność dokumentu - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | DocumentPayment | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» id_platnosci | integer | false | none | none |
POSTItemError
{
"ID": "string",
"errorCode": 0,
"errorMessage": "string"
}
Błąd zapisu obiektu POST
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | string | false | none | none |
errorCode | integer | false | none | none |
errorMessage | string | false | none | none |
POSTItemID
{
"ID": "string",
"K2OnlineID": 0
}
Identyfikator zapisu obiektu POST
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | string | false | none | none |
K2OnlineID | integer | false | none | none |
POSTItemIDWithVariants
{
"ID": "string",
"K2OnlineID": 0,
"variants": [
{
"ID": "string",
"K2OnlineID": 0
}
]
}
Identyfikator zapisu obiektu POST zawierającego warianty
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | string | false | none | none |
K2OnlineID | integer | false | none | none |
variants | [POSTItemID] | false | none | none |
PriceList
{
"ID": "c0a80113-7815-4673-8a30-e88764132456",
"nazwa_cennika": "WAW-1",
"opis_cennika": "Przeceny",
"grupa_magazynow": "WAW",
"symbol_magazynu": "MAG01",
"nr_ceny": 1,
"pozycje": [
{
"ID": "c0a80114-7815-4673-8a30-e88764132456",
"id_wariantu_towaru": 205,
"cena": 12.34,
"stawka_vat": "23",
"wazny_od": "2025-06-01",
"wazny_do": "2025-06-30"
}
]
}
Cennik
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | true | none | none |
nazwa_cennika | string | false | none | none |
opis_cennika | string | false | none | none |
grupa_magazynow | string | false | none | none |
symbol_magazynu | string | false | none | none |
nr_ceny | integer | false | none | none |
pozycje | [PriceListItem] | false | none | none |
Enumerated Values
Property | Value |
---|---|
nr_ceny | 0 |
nr_ceny | 1 |
nr_ceny | 2 |
nr_ceny | 3 |
nr_ceny | 4 |
nr_ceny | 5 |
nr_ceny | 6 |
nr_ceny | 7 |
nr_ceny | 8 |
nr_ceny | 9 |
nr_ceny | 10 |
PriceListItem
{
"ID": "c0a80114-7815-4673-8a30-e88764132456",
"id_wariantu_towaru": 205,
"cena": 12.34,
"stawka_vat": "23",
"wazny_od": "2025-06-01",
"wazny_do": "2025-06-30"
}
Pozycja cennika
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | string | true | none | none |
id_wariantu_towaru | integer | true | none | none |
cena | number | true | none | none |
stawka_vat | string | true | none | none |
wazny_od | string(date) | true | none | none |
wazny_do | string(date) | true | none | none |
Product
{
"ID": "prod-abc-123",
"kod_producenta": "MODEL_XYZ_001",
"id_jednostki_miary": 1,
"id_grupy_towarow": 10,
"nazwa_towaru": "Klawiatura mechaniczna",
"usuniety": 0,
"op_01": "Kolor: Czarny",
"op_02": "Materiał: Aluminium",
"op_03": "Waga: 1.2 kg",
"op_04": "Producent: TechCorp",
"op_05": "Typ: Gamingowa",
"op_06": "Wersja: PRO",
"warianty": [
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025"
}
]
}
Towar
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | false | none | none |
kod_producenta | string | false | none | none |
id_jednostki_miary | integer | false | none | none |
id_grupy_towarow | integer | false | none | none |
nazwa_towaru | string | false | none | none |
usuniety | integer | false | none | none |
op_01 | string | false | none | none |
op_02 | string | false | none | none |
op_03 | string | false | none | none |
op_04 | string | false | none | none |
op_05 | string | false | none | none |
op_06 | string | false | none | none |
warianty | [ProductVariant] | false | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
ProductGET
{
"ID": "prod-abc-123",
"kod_producenta": "MODEL_XYZ_001",
"id_jednostki_miary": 1,
"id_grupy_towarow": 10,
"nazwa_towaru": "Klawiatura mechaniczna",
"usuniety": 0,
"op_01": "Kolor: Czarny",
"op_02": "Materiał: Aluminium",
"op_03": "Waga: 1.2 kg",
"op_04": "Producent: TechCorp",
"op_05": "Typ: Gamingowa",
"op_06": "Wersja: PRO",
"warianty": [
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025",
"K2OnlineID": 0,
"data_modyfikacji": "string"
}
],
"K2OnlineID": 0,
"symbol_grupy_towarow": "string",
"nazwa_jednostki_miary": "string",
"data_modyfikacji": "string"
}
Towar - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | Product | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» K2OnlineID | integer | false | none | none |
» symbol_grupy_towarow | string | false | none | none |
» nazwa_jednostki_miary | string | false | none | none |
» data_modyfikacji | string | false | none | none |
» warianty | [ProductVariantGET] | false | none | none |
ProductGroup
{
"ID": "",
"ID_nadrzedny": "",
"symbol_grupy": "PŁ",
"nazwa_grupy": "Płaszcze",
"usuniety": 0,
"czy_wirtualna": 0,
"opis_grupy": "Płaszcze",
"saldo_stanow": 1,
"czy_naliczac_punkty": 0,
"czy_usluga": 0
}
Grupa towarowa
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | false | none | none |
ID_nadrzedny | number | false | none | none |
symbol_grupy | string | true | none | none |
nazwa_grupy | string | false | none | none |
usuniety | integer | false | none | none |
czy_wirtualna | integer | false | none | none |
opis_grupy | string | false | none | none |
saldo_stanow | integer | false | none | none |
czy_naliczac_punkty | integer | false | none | none |
czy_usluga | integer | false | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
czy_wirtualna | 0 |
czy_wirtualna | 1 |
saldo_stanow | 0 |
saldo_stanow | 1 |
czy_naliczac_punkty | 0 |
czy_naliczac_punkty | 1 |
czy_usluga | 0 |
czy_usluga | 1 |
ProductGroupGET
{
"ID": "",
"ID_nadrzedny": "",
"symbol_grupy": "PŁ",
"nazwa_grupy": "Płaszcze",
"usuniety": 0,
"czy_wirtualna": 0,
"opis_grupy": "Płaszcze",
"saldo_stanow": 1,
"czy_naliczac_punkty": 0,
"czy_usluga": 0,
"K2OnlineID": 0,
"K2OnlineID_nadrzedny": 0
}
Grupa towarowa - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | ProductGroup | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» K2OnlineID | integer | false | none | none |
» K2OnlineID_nadrzedny | integer | false | none | none |
ProductUnit
{
"ID": "",
"nazwa_jednostki": "KG",
"czy_waga": 1,
"usuniety": 0,
"nazwa_jednostki_pelna": "Kilogram"
}
Jednostka miary
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | false | none | none |
nazwa_jednostki | string | true | none | none |
czy_waga | integer | false | none | none |
usuniety | integer | false | none | none |
nazwa_jednostki_pelna | string | false | none | none |
Enumerated Values
Property | Value |
---|---|
czy_waga | 0 |
czy_waga | 1 |
usuniety | 0 |
usuniety | 1 |
ProductUnitGET
{
"ID": "",
"nazwa_jednostki": "KG",
"czy_waga": 1,
"usuniety": 0,
"nazwa_jednostki_pelna": "Kilogram",
"K2OnlineID": 0
}
Jednostka miary - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | ProductUnit | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» K2OnlineID | integer | false | none | none |
ProductVariant
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025"
}
Wariant towaru
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ID | number | true | none | none |
sku | string | true | none | none |
kod_plu | string | false | none | none |
kod_kreskowy | string | false | none | none |
cena | number(float) | false | none | none |
cena_wejsciowa | number(float) | false | none | none |
stawka_vat | string | false | none | none |
usuniety | integer | false | none | none |
op_01 | string | false | none | none |
op_02 | string | false | none | none |
op_03 | string | false | none | none |
op_04 | string | false | none | none |
op_05 | string | false | none | none |
op_06 | string | false | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
ProductVariantGET
{
"ID": "var-12345",
"sku": "PROD-ABC-BLACK-L",
"kod_plu": "PLU-54321",
"kod_kreskowy": "1234567890123",
"cena": 99.99,
"cena_wejsciowa": 50,
"stawka_vat": "23",
"usuniety": 0,
"op_01": "Rozmiar: L",
"op_02": "Kolor: Czarny",
"op_03": "Materiał: Bawełna",
"op_04": "Dostępność: W magazynie",
"op_05": "Sezon: Lato",
"op_06": "Kolekcja: Wiosna 2025",
"K2OnlineID": 0,
"data_modyfikacji": "string"
}
Wariant towaru - z identyfikatorem K2Online
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | ProductVariant | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» K2OnlineID | integer | false | none | none |
» data_modyfikacji | string | false | none | none |
Promotion
{
"symbol_akcji": "string",
"nazwa_akcji": "string",
"data_od": "2019-08-24T14:15:22Z",
"data_do": "2019-08-24T14:15:22Z",
"usuniety": 0,
"poniedzialek": "string",
"wtorek": "string",
"sroda": "string",
"czwartek": "string",
"piatek": "string",
"sobota": "string",
"niedziela": "string",
"identyfikator_wyzwalajacy": "string",
"limit_czas": 0,
"limit_sztuki": 0,
"limit_wartosc": 0,
"limit_paragony": 0,
"id_statusu_akcji": 1,
"rozlozenie_upustow": "p",
"id_grupy_kontrahentow": 0,
"kolejnosc": 100,
"czy_uwzgledniac_rabat_kontrahenta": 0,
"magazyny": [
0
],
"regulamin": "string",
"minimalna_wartosc_dokumentu": 0,
"czy_mozna_laczyc": 0,
"czy_mozna_laczyc_pozycje": 0,
"zawsze_uwzgledniaj": 0,
"czy_naglowek": 0,
"id_typu_akcji": 0,
"parametry": {},
"modele": [
"string"
],
"grupy_towarowe": [
"string"
],
"cechy": [
"string"
],
"warianty": [
"string"
],
"rozmiary": [
"string"
]
}
Promocja
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
symbol_akcji | string | true | none | none |
nazwa_akcji | string | false | none | none |
data_od | string(date-time) | false | none | none |
data_do | string(date-time) | false | none | none |
usuniety | integer | false | none | none |
poniedzialek | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
wtorek | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
sroda | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
czwartek | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
piatek | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
sobota | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
niedziela | string | false | none | Zakres liczb całkowitych w formacie PostgreSQL (np. [0,1440), (0,1440]) |
identyfikator_wyzwalajacy | string | false | none | none |
limit_czas | integer | false | none | none |
limit_sztuki | integer | false | none | none |
limit_wartosc | number | false | none | none |
limit_paragony | integer | false | none | none |
id_statusu_akcji | integer | false | none | none |
rozlozenie_upustow | string | false | none | none |
id_grupy_kontrahentow | integer | false | none | none |
kolejnosc | integer | false | none | none |
czy_uwzgledniac_rabat_kontrahenta | integer | false | none | none |
magazyny | [integer] | false | none | none |
regulamin | string | false | none | none |
minimalna_wartosc_dokumentu | number | false | none | none |
czy_mozna_laczyc | integer | false | none | none |
czy_mozna_laczyc_pozycje | integer | false | none | none |
zawsze_uwzgledniaj | integer | false | none | none |
czy_naglowek | integer | true | none | none |
id_typu_akcji | integer | false | none | none |
parametry | object | false | none | none |
modele | [string] | false | none | none |
grupy_towarowe | [string] | false | none | none |
cechy | [string] | false | none | none |
warianty | [string] | false | none | none |
rozmiary | [string] | false | none | none |
Enumerated Values
Property | Value |
---|---|
usuniety | 0 |
usuniety | 1 |
id_statusu_akcji | 1 |
id_statusu_akcji | 2 |
id_statusu_akcji | 3 |
id_statusu_akcji | 4 |
id_statusu_akcji | 5 |
rozlozenie_upustow | p |
rozlozenie_upustow | v |
czy_uwzgledniac_rabat_kontrahenta | 0 |
czy_uwzgledniac_rabat_kontrahenta | 1 |
czy_mozna_laczyc | 0 |
czy_mozna_laczyc | 1 |
czy_mozna_laczyc_pozycje | 0 |
czy_mozna_laczyc_pozycje | 1 |
zawsze_uwzgledniaj | 0 |
zawsze_uwzgledniaj | 1 |
czy_naglowek | 0 |
czy_naglowek | 1 |