CreateNewProduct

Function to create a new product

POST https://rest.crmango.com/api/CreateNewProduct

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

20 Sent in the request body
product_name varchar

Product name

cost_price integer

Product cost price

product_code varchar

Product code

measure_unit integer

Measure unit id

cost_type integer

Cost type id

currency varchar

Currency

service varchar

Service

product_code_is varchar

Product code in information service

list_price integer|float

List price

price_type integer

Price type

vat_value integer

VAT value

analytics varchar

Accounting Analytics

ean varchar

EAN

categories array

Product categories

in_stock integer

Count products in stock

in_stock_partner integer

Count products in stock (partner)

min_price integer|float

Minimum price

card_type integer

Product card type

product_files array

Files associated with this products

img_url varchar

Product image (URL)

Response

3 HTTP 201

Function to create a new product

code integer

Return code

message varchar

Info message

created_id integer

Id of the created resource

Example request

curl --request POST \
  --url 'https://rest.crmango.com/api/CreateNewProduct' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    {
      "product_name": "PC HP2",
      "cost_price": 100,
      "product_code": 1,
      "measure_unit": 0,
      "cost_type": 0,
      "currency": 202,
      "service": 8,
      "product_code_is": "PC-1234",
      "list_price": 400,
      "price_type": 0,
      "vat_value": 0,
      "analytics": "Test Input",
      "ean": "pc1234",
      "categories": [
        "Computers",
        "HP"
      ],
      "in_stock": 25,
      "in_stock_partner": 30,
      "min_price": 300,
      "card_type": 0
    }
  }'
{
    "code": 201,
    "message": "New product has been created",
    "created_id": 21
}