curl --request POST \
--url https://api.example.com/api/items \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"name": "Ergonomic Office Chair Model X-2000",
"type": "inventory",
"code": "CHAIR-X2000",
"purchasable": true,
"costPrice": 299.99,
"costAccountId": 1001,
"sellable": true,
"sellPrice": 399.99,
"sellAccountId": 2001,
"inventoryAccountId": 3001,
"sellDescription": "Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back",
"purchaseDescription": "Ergonomic office chair - Model X-2000 with standard features",
"sellTaxRateId": 1,
"purchaseTaxRateId": 1,
"categoryId": 5,
"note": "Available in black, gray, and navy colors. 5-year warranty included.",
"active": true,
"mediaIds": [
1,
2,
3
]
}
'import requests
url = "https://api.example.com/api/items"
payload = {
"name": "Ergonomic Office Chair Model X-2000",
"type": "inventory",
"code": "CHAIR-X2000",
"purchasable": True,
"costPrice": 299.99,
"costAccountId": 1001,
"sellable": True,
"sellPrice": 399.99,
"sellAccountId": 2001,
"inventoryAccountId": 3001,
"sellDescription": "Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back",
"purchaseDescription": "Ergonomic office chair - Model X-2000 with standard features",
"sellTaxRateId": 1,
"purchaseTaxRateId": 1,
"categoryId": 5,
"note": "Available in black, gray, and navy colors. 5-year warranty included.",
"active": True,
"mediaIds": [1, 2, 3]
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Ergonomic Office Chair Model X-2000',
type: 'inventory',
code: 'CHAIR-X2000',
purchasable: true,
costPrice: 299.99,
costAccountId: 1001,
sellable: true,
sellPrice: 399.99,
sellAccountId: 2001,
inventoryAccountId: 3001,
sellDescription: 'Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back',
purchaseDescription: 'Ergonomic office chair - Model X-2000 with standard features',
sellTaxRateId: 1,
purchaseTaxRateId: 1,
categoryId: 5,
note: 'Available in black, gray, and navy colors. 5-year warranty included.',
active: true,
mediaIds: [1, 2, 3]
})
};
fetch('https://api.example.com/api/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Ergonomic Office Chair Model X-2000',
'type' => 'inventory',
'code' => 'CHAIR-X2000',
'purchasable' => true,
'costPrice' => 299.99,
'costAccountId' => 1001,
'sellable' => true,
'sellPrice' => 399.99,
'sellAccountId' => 2001,
'inventoryAccountId' => 3001,
'sellDescription' => 'Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back',
'purchaseDescription' => 'Ergonomic office chair - Model X-2000 with standard features',
'sellTaxRateId' => 1,
'purchaseTaxRateId' => 1,
'categoryId' => 5,
'note' => 'Available in black, gray, and navy colors. 5-year warranty included.',
'active' => true,
'mediaIds' => [
1,
2,
3
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/items"
payload := strings.NewReader("{\n \"name\": \"Ergonomic Office Chair Model X-2000\",\n \"type\": \"inventory\",\n \"code\": \"CHAIR-X2000\",\n \"purchasable\": true,\n \"costPrice\": 299.99,\n \"costAccountId\": 1001,\n \"sellable\": true,\n \"sellPrice\": 399.99,\n \"sellAccountId\": 2001,\n \"inventoryAccountId\": 3001,\n \"sellDescription\": \"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back\",\n \"purchaseDescription\": \"Ergonomic office chair - Model X-2000 with standard features\",\n \"sellTaxRateId\": 1,\n \"purchaseTaxRateId\": 1,\n \"categoryId\": 5,\n \"note\": \"Available in black, gray, and navy colors. 5-year warranty included.\",\n \"active\": true,\n \"mediaIds\": [\n 1,\n 2,\n 3\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/items")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ergonomic Office Chair Model X-2000\",\n \"type\": \"inventory\",\n \"code\": \"CHAIR-X2000\",\n \"purchasable\": true,\n \"costPrice\": 299.99,\n \"costAccountId\": 1001,\n \"sellable\": true,\n \"sellPrice\": 399.99,\n \"sellAccountId\": 2001,\n \"inventoryAccountId\": 3001,\n \"sellDescription\": \"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back\",\n \"purchaseDescription\": \"Ergonomic office chair - Model X-2000 with standard features\",\n \"sellTaxRateId\": 1,\n \"purchaseTaxRateId\": 1,\n \"categoryId\": 5,\n \"note\": \"Available in black, gray, and navy colors. 5-year warranty included.\",\n \"active\": true,\n \"mediaIds\": [\n 1,\n 2,\n 3\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Ergonomic Office Chair Model X-2000\",\n \"type\": \"inventory\",\n \"code\": \"CHAIR-X2000\",\n \"purchasable\": true,\n \"costPrice\": 299.99,\n \"costAccountId\": 1001,\n \"sellable\": true,\n \"sellPrice\": 399.99,\n \"sellAccountId\": 2001,\n \"inventoryAccountId\": 3001,\n \"sellDescription\": \"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back\",\n \"purchaseDescription\": \"Ergonomic office chair - Model X-2000 with standard features\",\n \"sellTaxRateId\": 1,\n \"purchaseTaxRateId\": 1,\n \"categoryId\": 5,\n \"note\": \"Available in black, gray, and navy colors. 5-year warranty included.\",\n \"active\": true,\n \"mediaIds\": [\n 1,\n 2,\n 3\n ]\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"statusCode": 400,
"type": "ITEM_NAME_EXISTS",
"message": "The item name is already exist.",
"payload": {}
}
]
}Create a new item (product or service).
curl --request POST \
--url https://api.example.com/api/items \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"name": "Ergonomic Office Chair Model X-2000",
"type": "inventory",
"code": "CHAIR-X2000",
"purchasable": true,
"costPrice": 299.99,
"costAccountId": 1001,
"sellable": true,
"sellPrice": 399.99,
"sellAccountId": 2001,
"inventoryAccountId": 3001,
"sellDescription": "Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back",
"purchaseDescription": "Ergonomic office chair - Model X-2000 with standard features",
"sellTaxRateId": 1,
"purchaseTaxRateId": 1,
"categoryId": 5,
"note": "Available in black, gray, and navy colors. 5-year warranty included.",
"active": true,
"mediaIds": [
1,
2,
3
]
}
'import requests
url = "https://api.example.com/api/items"
payload = {
"name": "Ergonomic Office Chair Model X-2000",
"type": "inventory",
"code": "CHAIR-X2000",
"purchasable": True,
"costPrice": 299.99,
"costAccountId": 1001,
"sellable": True,
"sellPrice": 399.99,
"sellAccountId": 2001,
"inventoryAccountId": 3001,
"sellDescription": "Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back",
"purchaseDescription": "Ergonomic office chair - Model X-2000 with standard features",
"sellTaxRateId": 1,
"purchaseTaxRateId": 1,
"categoryId": 5,
"note": "Available in black, gray, and navy colors. 5-year warranty included.",
"active": True,
"mediaIds": [1, 2, 3]
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Ergonomic Office Chair Model X-2000',
type: 'inventory',
code: 'CHAIR-X2000',
purchasable: true,
costPrice: 299.99,
costAccountId: 1001,
sellable: true,
sellPrice: 399.99,
sellAccountId: 2001,
inventoryAccountId: 3001,
sellDescription: 'Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back',
purchaseDescription: 'Ergonomic office chair - Model X-2000 with standard features',
sellTaxRateId: 1,
purchaseTaxRateId: 1,
categoryId: 5,
note: 'Available in black, gray, and navy colors. 5-year warranty included.',
active: true,
mediaIds: [1, 2, 3]
})
};
fetch('https://api.example.com/api/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Ergonomic Office Chair Model X-2000',
'type' => 'inventory',
'code' => 'CHAIR-X2000',
'purchasable' => true,
'costPrice' => 299.99,
'costAccountId' => 1001,
'sellable' => true,
'sellPrice' => 399.99,
'sellAccountId' => 2001,
'inventoryAccountId' => 3001,
'sellDescription' => 'Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back',
'purchaseDescription' => 'Ergonomic office chair - Model X-2000 with standard features',
'sellTaxRateId' => 1,
'purchaseTaxRateId' => 1,
'categoryId' => 5,
'note' => 'Available in black, gray, and navy colors. 5-year warranty included.',
'active' => true,
'mediaIds' => [
1,
2,
3
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/items"
payload := strings.NewReader("{\n \"name\": \"Ergonomic Office Chair Model X-2000\",\n \"type\": \"inventory\",\n \"code\": \"CHAIR-X2000\",\n \"purchasable\": true,\n \"costPrice\": 299.99,\n \"costAccountId\": 1001,\n \"sellable\": true,\n \"sellPrice\": 399.99,\n \"sellAccountId\": 2001,\n \"inventoryAccountId\": 3001,\n \"sellDescription\": \"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back\",\n \"purchaseDescription\": \"Ergonomic office chair - Model X-2000 with standard features\",\n \"sellTaxRateId\": 1,\n \"purchaseTaxRateId\": 1,\n \"categoryId\": 5,\n \"note\": \"Available in black, gray, and navy colors. 5-year warranty included.\",\n \"active\": true,\n \"mediaIds\": [\n 1,\n 2,\n 3\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/items")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ergonomic Office Chair Model X-2000\",\n \"type\": \"inventory\",\n \"code\": \"CHAIR-X2000\",\n \"purchasable\": true,\n \"costPrice\": 299.99,\n \"costAccountId\": 1001,\n \"sellable\": true,\n \"sellPrice\": 399.99,\n \"sellAccountId\": 2001,\n \"inventoryAccountId\": 3001,\n \"sellDescription\": \"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back\",\n \"purchaseDescription\": \"Ergonomic office chair - Model X-2000 with standard features\",\n \"sellTaxRateId\": 1,\n \"purchaseTaxRateId\": 1,\n \"categoryId\": 5,\n \"note\": \"Available in black, gray, and navy colors. 5-year warranty included.\",\n \"active\": true,\n \"mediaIds\": [\n 1,\n 2,\n 3\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Ergonomic Office Chair Model X-2000\",\n \"type\": \"inventory\",\n \"code\": \"CHAIR-X2000\",\n \"purchasable\": true,\n \"costPrice\": 299.99,\n \"costAccountId\": 1001,\n \"sellable\": true,\n \"sellPrice\": 399.99,\n \"sellAccountId\": 2001,\n \"inventoryAccountId\": 3001,\n \"sellDescription\": \"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back\",\n \"purchaseDescription\": \"Ergonomic office chair - Model X-2000 with standard features\",\n \"sellTaxRateId\": 1,\n \"purchaseTaxRateId\": 1,\n \"categoryId\": 5,\n \"note\": \"Available in black, gray, and navy colors. 5-year warranty included.\",\n \"active\": true,\n \"mediaIds\": [\n 1,\n 2,\n 3\n ]\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"statusCode": 400,
"type": "ITEM_NAME_EXISTS",
"message": "The item name is already exist.",
"payload": {}
}
]
}Headers
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Body
Item name
"Ergonomic Office Chair Model X-2000"
Item type
service, non-inventory, inventory "inventory"
Item code/SKU
"CHAIR-X2000"
Whether the item can be purchased
true
Cost price of the item
x >= 0299.99
ID of the cost account
x >= 01001
Whether the item can be sold
true
Selling price of the item
x >= 0399.99
ID of the sell account
x >= 02001
ID of the inventory account (required for inventory items)
x >= 03001
Description shown on sales documents
"Premium ergonomic office chair with adjustable height, lumbar support, and breathable mesh back"
Description shown on purchase documents
"Ergonomic office chair - Model X-2000 with standard features"
ID of the tax rate applied to sales
1
ID of the tax rate applied to purchases
1
ID of the item category
x >= 05
Additional notes about the item
"Available in black, gray, and navy colors. 5-year warranty included."
Whether the item is active
true
IDs of media files associated with the item
[1, 2, 3]
Response
The item has been successfully created.