curl --request POST \
--url https://api.exowpee.com/v1/catalog/categories \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/categories"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/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.exowpee.com/v1/catalog/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.exowpee.com/v1/catalog/categories"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/catalog/categories")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"handle": "<string>",
"title": "<string>",
"image_url": "<string>",
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"vat_rate_id": "<string>",
"vat_rate": {},
"taxes": "<array>",
"is_taxable": true
}{
"message": "<string>",
"errors": {}
}Create a category
Adds a product category with a title, order and optional image.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/categories \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/categories"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/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.exowpee.com/v1/catalog/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.exowpee.com/v1/catalog/categories"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/catalog/categories")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"handle": "<string>",
"title": "<string>",
"image_url": "<string>",
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"vat_rate_id": "<string>",
"vat_rate": {},
"taxes": "<array>",
"is_taxable": true
}{
"message": "<string>",
"errors": {}
}categories.create
Conditions
- When is_taxable or vat_rate_id is sent, the caller also needs the category_taxes.update permission. tax_ids is not accepted here and is ignored; additional taxes are set with the category taxes action.
- The handle must be unique within the organization; when omitted it is generated from the title.
- The vat_rate_id must be an active VAT rate of the organization matching the company’s country and fiscal status.
- The title and sort_order are required on creation; the image must be an image file (jpeg, png, jpg, gif or svg) of at most 2048 kilobytes.
- Stores the uploaded image publicly when one is sent.
- Always writes a tax configuration for the company’s current fiscal profile (country and fiscal status): is_taxable defaults to false and vat_rate_id to null when not sent.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: vat_rate_id, is_taxable, id, handle, title, image_url, sort_order, created_at, updated_at, organization_id.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: vat_rate, taxes.
Response
Resource (only with response=resource).
Identifier of the category (27-character KSUID string).
URL-friendly identifier of the category, unique within the organization. Generated from the title (with a numeric suffix on conflict) when not sent at creation.
Display name of the category.
Public URL of the category image; null when the category has no image.
Display position of the category; lower values come first.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Identifier of the organization the record belongs to.
Identifier of the VAT rate set on the category for the company's current fiscal profile; null when none is set or no configuration exists.
VAT rate object (id, country_code, fiscal_status, name, code, rate, treatment, is_default, is_active). Only returned when selected with ?include=vat_rate.
Additional taxes applied to items of this category, in the order they are applied. Only returned when selected with ?include=taxes.
Whether items of this category are taxed in the company's current fiscal profile. null when no tax configuration exists yet for that profile (items are then treated as untaxed and unconfigured).