# Create product
You can create a product.
POST
/products/
Attributes | Type | Required | Description |
---|---|---|---|
custom_id | string | yes | A unique identifier for the product which is provided by the client. Usually related to the product’s SKU. |
brand_name | string | no | A brand name. |
categories | integer(list) | no | A list of categories' ids. |
city | string | no | An origin city of a product. |
country | string | no | An origin country of a product. |
created_at | datetime | no | A creation date of a product. |
image_url | string | no | A URL of a product image. |
name | string | no | A product name. |
product_url | string | no | A URL of a product. |
tags | string | no | A list of tags. |
target_group | string | no | A name of a target |
updated_at | datetime | no | A date of last product update. |
# Request
- CURL
- JavaScript
- PHP
- Python
curl -X POST
"https://<your_app_subdomain>.user.com/api/public/products/"
-H 'authorization: Token <your_64_char_api_key>'
-H 'content-type: application/json'
-H "Accept: */*; version=2"
-d '{
"name": "my product",
"custom_id": "my_product_id",
"product_url": "https://myshop.com/products/my_product/",
"image_url": "https://myshop.com/media/products/myproduct.jpg"
}'
# Response
{
"id": 50,
"name": "my product",
"custom_id": "my_product_id",
"created_at": "2018-03-02T14:14:05.608704Z",
"updated_at": "2018-03-02T14:14:05.608742Z",
"product_url": "https://myshop.com/products/my_product/",
"image_url": "https://myshop.com/media/products/myproduct.jpg",
"attributes": [],
"categories": []
}