POST/ products-by-id/
Create product
You can create a product.
Attributes
Optional unless marked required
- custom_id
- A unique identifier for the product provided by the client.
- brand_name
- A brand name.
- categories
- A list of categories' ids.
- city
- An origin city of a product.
- country
- An origin country of a product.
- created_at
- A creation date of a product.
- image_url
- A URL of a product image.
- name
- A product name.
- product_url
- A URL of a product.
- tags
- A list of tags.
- target_group
- A name of a target
- updated_at
- A date of last product update.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X POST "https://<your_app_subdomain>.user.com/api/public/products-by-id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"custom_id": "rain-jacket",
"name": "Rain jacket",
"product_url": "https://example.com/products/rain-jacket",
"image_url": "https://example.com/images/rain-jacket.jpg",
"brand_name": "Northpeak"
}'
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/products-by-id/",
{
method: "POST",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
"Content-Type": "application/json",
},
body: JSON.stringify({
custom_id: "rain-jacket",
name: "Rain jacket",
product_url: "https://example.com/products/rain-jacket",
image_url: "https://example.com/images/rain-jacket.jpg",
brand_name: "Northpeak",
}),
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/products-by-id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"custom_id" => "rain-jacket",
"name" => "Rain jacket",
"product_url" => "https://example.com/products/rain-jacket",
"image_url" => "https://example.com/images/rain-jacket.jpg",
"brand_name" => "Northpeak",
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.post(
"https://<your_app_subdomain>.user.com/api/public/products-by-id/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
json={
"custom_id": "rain-jacket",
"name": "Rain jacket",
"product_url": "https://example.com/products/rain-jacket",
"image_url": "https://example.com/images/rain-jacket.jpg",
"brand_name": "Northpeak",
},
)
print(response.json())
Response examples
- 201 Created
{"id": 117,"name": "Rain jacket","custom_id": "rain-jacket","created_at": "2026-11-10T09:33:42.480312Z","updated_at": "2026-11-10T09:33:42.480324Z","product_url": "https://example.com/products/rain-jacket","image_url": "https://example.com/images/rain-jacket.jpg","attributes": [],"tags": [],"target_group": null,"brand_name": "Northpeak","city": null,"country": null,"qty": null,"description": null,"special_price": 0,"categories": []}Response fields
Fields returned in the 201 Created response body.
- id
- ID of the product.
- name
- A product name.
- custom_id
- A unique identifier for the product which is provided by the client. Usually related to the product’s SKU.
- created_at
- A creation date of a product.
- updated_at
- A date of last product update.
- product_url
- A URL of a product.
- image_url
- A URL of a product image.
- attributes
- Custom product attributes that have a value, each with
name,name_std,value,descriptionandvalue_type. - tags
- A list of tags.
- target_group
- A name of a target
- brand_name
- A brand name.
- city
- An origin city of a product.
- country
- An origin country of a product.
- qty
- Quantity of the product, or
nullif not set. - description
- Description of the product, or
null. - special_price
- Special price of the product, as a whole number;
0if not set. - categories
- A list of categories' ids.
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.