curl --request POST \
--url https://api.retrac.co/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sku": "FITEM",
"description": "<string>",
"cost": 123,
"sellPrice": 0,
"supplierId": "<string>",
"tagId": "<string>",
"tagIds": "<string>",
"tagNames": "<string>"
}
'import requests
url = "https://api.retrac.co/items"
payload = {
"sku": "FITEM",
"description": "<string>",
"cost": 123,
"sellPrice": 0,
"supplierId": "<string>",
"tagId": "<string>",
"tagIds": "<string>",
"tagNames": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sku: 'FITEM',
description: '<string>',
cost: 123,
sellPrice: 0,
supplierId: '<string>',
tagId: '<string>',
tagIds: '<string>',
tagNames: '<string>'
})
};
fetch('https://api.retrac.co/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.retrac.co/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([
'sku' => 'FITEM',
'description' => '<string>',
'cost' => 123,
'sellPrice' => 0,
'supplierId' => '<string>',
'tagId' => '<string>',
'tagIds' => '<string>',
'tagNames' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retrac.co/items"
payload := strings.NewReader("{\n \"sku\": \"FITEM\",\n \"description\": \"<string>\",\n \"cost\": 123,\n \"sellPrice\": 0,\n \"supplierId\": \"<string>\",\n \"tagId\": \"<string>\",\n \"tagIds\": \"<string>\",\n \"tagNames\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.retrac.co/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sku\": \"FITEM\",\n \"description\": \"<string>\",\n \"cost\": 123,\n \"sellPrice\": 0,\n \"supplierId\": \"<string>\",\n \"tagId\": \"<string>\",\n \"tagIds\": \"<string>\",\n \"tagNames\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retrac.co/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sku\": \"FITEM\",\n \"description\": \"<string>\",\n \"cost\": 123,\n \"sellPrice\": 0,\n \"supplierId\": \"<string>\",\n \"tagId\": \"<string>\",\n \"tagIds\": \"<string>\",\n \"tagNames\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"sku": "<string>",
"description": "<string>",
"supplierId": "<string>",
"cost": 123,
"sellPrice": 123,
"tagId": "<string>",
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"userId": "<string>",
"workspaceId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"projectId": "<string>",
"supplier": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"phone": "<string>"
}
}{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#internal-server_error"
}
}Create a new item
Create a new item for the authenticated workspace.
curl --request POST \
--url https://api.retrac.co/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sku": "FITEM",
"description": "<string>",
"cost": 123,
"sellPrice": 0,
"supplierId": "<string>",
"tagId": "<string>",
"tagIds": "<string>",
"tagNames": "<string>"
}
'import requests
url = "https://api.retrac.co/items"
payload = {
"sku": "FITEM",
"description": "<string>",
"cost": 123,
"sellPrice": 0,
"supplierId": "<string>",
"tagId": "<string>",
"tagIds": "<string>",
"tagNames": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sku: 'FITEM',
description: '<string>',
cost: 123,
sellPrice: 0,
supplierId: '<string>',
tagId: '<string>',
tagIds: '<string>',
tagNames: '<string>'
})
};
fetch('https://api.retrac.co/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.retrac.co/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([
'sku' => 'FITEM',
'description' => '<string>',
'cost' => 123,
'sellPrice' => 0,
'supplierId' => '<string>',
'tagId' => '<string>',
'tagIds' => '<string>',
'tagNames' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retrac.co/items"
payload := strings.NewReader("{\n \"sku\": \"FITEM\",\n \"description\": \"<string>\",\n \"cost\": 123,\n \"sellPrice\": 0,\n \"supplierId\": \"<string>\",\n \"tagId\": \"<string>\",\n \"tagIds\": \"<string>\",\n \"tagNames\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.retrac.co/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sku\": \"FITEM\",\n \"description\": \"<string>\",\n \"cost\": 123,\n \"sellPrice\": 0,\n \"supplierId\": \"<string>\",\n \"tagId\": \"<string>\",\n \"tagIds\": \"<string>\",\n \"tagNames\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retrac.co/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sku\": \"FITEM\",\n \"description\": \"<string>\",\n \"cost\": 123,\n \"sellPrice\": 0,\n \"supplierId\": \"<string>\",\n \"tagId\": \"<string>\",\n \"tagIds\": \"<string>\",\n \"tagNames\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"sku": "<string>",
"description": "<string>",
"supplierId": "<string>",
"cost": 123,
"sellPrice": 123,
"tagId": "<string>",
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"userId": "<string>",
"workspaceId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"projectId": "<string>",
"supplier": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"phone": "<string>"
}
}{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.retrac.co/api-reference/errors#internal-server_error"
}
}Authorizations
Bearer API key from Settings → API Keys. Use restricted keys (prefix retrac_) with the minimum scopes required.
Query Parameters
The ID of the workspace.
"ws_cluuwcv0r..."
The slug of the project. This field is deprecated – use workspaceId instead.
Body
The SKU of the item.
"FITEM"
The item description.
The cost of the item.
The default sell price of the item.
x >= 0The supplier ID of the item.
[DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short item.
The unique IDs of the tags assigned to the short item.
The unique name of the tags assigned to the item (case insensitive).
Response
The created item
The unique ID of the short item.
The SKU of the item.
The item description.
The supplier ID of the item.
The item cost.
The default sell price of the item.
[DEPRECATED] (use tags instead): The unique ID of the tag assigned to the short item.
The tags assigned to the short item.
Show child attributes
Show child attributes
The user ID of the creator of the short item.
The workspace ID of the short item.
The date and time when the short item was created.
The date and time when the short item was last updated.
[DEPRECATED] (use workspaceId instead): The project ID of the short item.
The linked supplier record.
Show child attributes
Show child attributes
Was this page helpful?