curl --request POST \
--url https://api.exowpee.com/v1/catalog/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/products"
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/products', 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/products",
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/products"
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/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/products")
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>",
"status_counts": {},
"type": "<string>",
"tags": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"description": "<string>",
"is_tracked": true,
"uom_category_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": [
"<unknown>"
],
"variants": "<array>",
"images": "<array>",
"category": {},
"organization_id": "<string>"
}{
"message": "<string>",
"errors": {}
}Create a product
Adds a product with its variants and images to the catalog, in a chosen unit-of-measure category.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/products"
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/products', 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/products",
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/products"
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/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/products")
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>",
"status_counts": {},
"type": "<string>",
"tags": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"description": "<string>",
"is_tracked": true,
"uom_category_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": [
"<unknown>"
],
"variants": "<array>",
"images": "<array>",
"category": {},
"organization_id": "<string>"
}{
"message": "<string>",
"errors": {}
}products.create
Conditions
- The unit-of-measure category (uom_category_id) and the category, when sent, must exist in the organization.
- title, type, is_tracked, uom_category_id and variants are required; every variant needs at least one unit and each unit needs at least one price; options must be present (it may be an empty list).
- The handle must be unique among the organization’s products when sent; when omitted it is built from the title.
- Variant option combinations must be unique inside the request and against the product.
- SKUs and barcodes (blank values become null) must not repeat inside the payload and are unique per organization when set.
- A price is a decimal in major units with at most currency_exponent decimals and greater than zero.
- Weight, volume and maximum sellable quantity need their unit sent together with the value, and the unit must match the right kind of measure (weight, volume) or the product’s unit category.
- Custom tax configuration requires is_taxable; a VAT rate must be active and match the company’s country and fiscal status.
- Tags are cleaned: split on semicolons, trimmed, empty tags dropped.
- Images must be jpeg, png, jpg, gif or svg files of at most 2048 kilobytes.
- Creates the product with published_at left empty (not published) and description defaulting to an empty string.
- Creates one item per variant (status draft, purchase nature goods, tracking copied from the product) and, for tracked items, a stock record.
- Creates the options and option values, the variants, the units of sale with SKU and barcode, and the prices of each unit.
- Initializes the tax configuration of each item.
- Uploads the images to public storage.
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: id, handle, status_counts, type, tags, published_at, title, description, is_tracked, uom_category_id, created_at, updated_at, options, 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: variants, variants.vat_rate, variants.taxes, variants.image, variants.inventoryItem, variants.levels, variants.units, images, category, category.vat_rate, category.taxes.
Response
Resource (only with response=resource).
Identifier of the product (27-character KSUID).
Short text identifier of the product, unique within the organization. Built from the title when it was not sent at creation.
Number of variants of the product in each item status (active, draft, archived).
Kind of product: physical, digital or service.
Tags as one text separated by semicolons, or null when none.
Publication date and time in ISO 8601, or null while the product is not published. It is left empty at creation.
Display name of the product.
Free text description; an empty string when none was given.
Whether stock is tracked for the variants of this product. Changing it also changes the tracking of all its variants.
Identifier of the unit-of-measure category that defines the units the product's variants are sold and stocked in (27-character KSUID). It cannot be changed after creation.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Options of the product (for example size, colour; stored in lower case), each with its id, name and the list of values used by its variants. Present only when the product's option values are loaded.
Variants of the product. Present only when requested with include=variants.
Pictures of the product. Present only when requested with include=images.
Catalog category of the product, or null when it has none. Present only when requested with include=category.
Identifier of the organization the record belongs to.