Retrieves the item categories.
curl --request GET \
--url https://api.example.com/api/item-categories \
--header 'Authorization: <authorization>' \
--header 'organization-id: <organization-id>'import requests
url = "https://api.example.com/api/item-categories"
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'organization-id': '<organization-id>'}
};
fetch('https://api.example.com/api/item-categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/item-categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"organization-id: <organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/item-categories"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/item-categories")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/item-categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
response = http.request(request)
puts response.read_body[
{
"id": 1,
"name": "Electronics",
"userId": 1,
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z",
"count": 5,
"description": "Electronic devices and accessories",
"costAccountId": 1,
"sellAccountId": 1,
"inventoryAccountId": 1,
"costMethod": "FIFO"
}
]Item Categories
Retrieves the item categories.
GET
/
api
/
item-categories
Retrieves the item categories.
curl --request GET \
--url https://api.example.com/api/item-categories \
--header 'Authorization: <authorization>' \
--header 'organization-id: <organization-id>'import requests
url = "https://api.example.com/api/item-categories"
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'organization-id': '<organization-id>'}
};
fetch('https://api.example.com/api/item-categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/item-categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"organization-id: <organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/item-categories"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/item-categories")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/item-categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
response = http.request(request)
puts response.read_body[
{
"id": 1,
"name": "Electronics",
"userId": 1,
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z",
"count": 5,
"description": "Electronic devices and accessories",
"costAccountId": 1,
"sellAccountId": 1,
"inventoryAccountId": 1,
"costMethod": "FIFO"
}
]Headers
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
Example:
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Response
200 - application/json
The item categories have been successfully retrieved.
The unique identifier of the item category
Example:
1
The name of the item category
Example:
"Electronics"
The user ID who created the category
Example:
1
The creation date of the category
Example:
"2024-03-20T10:00:00Z"
The last update date of the category
Example:
"2024-03-20T10:00:00Z"
The number of items in this category
Example:
5
The description of the item category
Example:
"Electronic devices and accessories"
The cost account ID
Example:
1
The sell account ID
Example:
1
The inventory account ID
Example:
1
The cost method
Example:
"FIFO"