How to add products via API?


POST: http://www.nomedoseusite.com.br/api_products_add.php

 

Header Parameter Format
Usuario1 base64_encode()
Senha1 base64_encode()

 

 

Parameter Format Description
products_status JSON

1 AVAILABLE or 0 = NOT AVAILABLE or 2 = PENDING
Only number is required
Format: tinyint(1)
* FIELD REQUIRED

products_model JSON Example: CK2587XL (Product identification code)
Format: varchar(255)
* FIELD REQUIRED
products_quantity JSON Example: 250
Only number is required
Format: int(4)
* FIELD REQUIRED
categoria JSON categories_id get from api api_categories.php
Only number is required
Format: int(11)
* FIELD REQUIRED
products_name_br JSON Example: Anel de Prata 925 com Pedras de Zirconia Borboleta (Recommended full product name) / Product Name in Portuguese only
Format: varchar(64)
* If the main language is portuguese it is FIELD REQUIRED
products_name_en JSON Example: Silver Ring with 925 Stones Zirconia Butterfly (Recommended full product name) / Product Name in English only
Format: varchar(64)
* If the main language is english it is FIELD REQUIRED
products_name_es JSON Example: Anillo de Plata 925 con Piedras de Zirconia Butterfly (Recommended full product name) / Product Name in Espanol only
Format: varchar(64)
* If the main language is espanol it is FIELD REQUIRED
products_name_jp JSON Example: Silver Ring with 925 Stones Zirconia Butterfly (Recommended full product name) / Product Name in Japanese only
Format: varchar(64)
* If the main language is japanese it is FIELD REQUIRED 
products_description_br JSON Product description in Portuguese
Format: text 
products_description_en JSON Product description in English
Format: text 
products_description_es JSON Product description in Espanol
Format: text 
products_description_jp JSON Product description in Japanese
Format: text 
meta_title_br JSON

Meta title in Portuguese
Format: text 

meta_title_en JSON Meta title in English
Format: text
meta_title_es JSON Meta title in Espanol
Format: text
meta_title_jp JSON Meta title in Japanese
Format: text
meta_description_br JSON Meta description in Portuguese
Format: text
meta_description_en JSON Meta description in English
Format: text
meta_description_es JSON Meta description in Espanol
Format: text
meta_description_jp JSON Meta description in Japanese
Format: text
meta_keywords_br JSON Meta keywords in Portuguese
Format: text
meta_keywords_en JSON Meta keywords in English
Format: text
meta_keywords_es JSON Meta keywords in Espanol
Format: text
meta_keywords_jp JSON Meta keywords in Japanese
Format: text
products_youtube JSON Incorporate video from YouTube, copy and paste the code to embed the video
Format: text
Example: <iframe width="420" height="315" src="https://www.youtube.com/embed/OTsN80a1OwQ" allowfullscreen></iframe>
products_image JSON Main picture of the full size product. Filename (Example:  nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
* FIELD REQUIRED
products_image1 JSON Picture of the full size product. Filename (Example: nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
products_image2 JSON Picture of the full size product. Filename (Example: nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
products_image3 JSON Picture of the full size product. Filename (Example: nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
products_image4 JSON Picture of the full size product. Filename (Example: nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
products_image5 JSON Picture of the full size product. Filename (Example: nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
products_image6 JSON Picture of the full size product. Filename (Example: nomedaimagem.jpg) or full url (Example: http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name)
Format: text
products_price JSON Example: 1542.56 (Do not use , "comma" only . "point" to indicate decimals)
Format: decimal(15,4)
* FIELD REQUIRED
products_date_available JSON Product availability date (Example: 2025-05-28) Enter exactly as example
Format: datetime
products_weight JSON Example: 0.150 (0.150 = 150 grams / Fill only with numbers and point)
Format: decimal(5,2)
* FIELD REQUIRED
manufacturers JSON Name of supplier or manufacturer of the product
Example: Apple
parcel_window JSON

Product portion (Ex: 1) (Legend: 1 = View Parcel or 0 = No See Portion) Enter exactly as example
Format: tinyint(1) 

products_stock_status JSON Stock status of the product (Ex: 0) (Legend: 1 = Immediate Delivery, 1 = Exhausted, 2 = Available in __ days or 3 = POA) Enter exactly as example
Format: tinyint(1)
products_stock_status_avaliable_in JSON When you enter option 2 in products_stock_status, enter the number of days (Example: 30) (Subtitle: 30 = 30 days). Type exactly as example
Format: varchar(64)
uv JSON Product sales unit
Example: 1 piece
view_price JSON View the price of the product (Example: 0) (Legend: 1 = No, client contacts for information or 0 = Yes) Enter exactly as example
Format: tinyint(1)
products_free_shipping JSON Free shipping product (Example: 0) (Caption: 0 = No or 1 = Yes) Enter exactly as example 
Format: tinyint(1)
ncm JSON NCM product (Example: 2) Enter exactly as example. Check the API to get the list of ncm.
Format: int(11)
cfop JSON CFOP product (Example: 2) Enter exactly as example. Check the API to get the list of cfop.
Format: int(11)
cst JSON CST product (Example: 2) Enter exactly as example. Check the API to get the list of cst.
Format: int(11)
order_minimum_qty JSON Minimum amount of purchase of the product
order_maximum_qty
Maximum amount of product purchase
Format: int(11)
origem JSON ORIGEM product (Example: 2) Enter exactly as example. Check the API to get the list of origem.
stock_location JSON Location Product in stock
Format: text
gtin_ean JSON GTIN/EAN Example: 1111111115896 (Field must have at least 13 digits - the product identification code on your system)
assinatura_recorrente JSON Recurring Payment (Ex: 1) (Legend: 1 = Yes or 0 = No) Enter exactly as example
periodo JSON Period (Number of days, week, month or year)
frequencia JSON day, week, month or year (Ex: day)
package JSON PACKAGE product (Example: 2) Enter exactly as example. Check the API to get the list of package. 
filter1 JSON FILTER1 product (Example: 2) Enter exactly as example. Check the API to get the list of filter1.
filter2 JSON FILTER2 product (Example: 2) Enter exactly as example. Check the API to get the list of filter2. 
filter3 JSON FILTER3 product (Example: 2) Enter exactly as example. Check the API to get the list of filter3. 
filter4 JSON FILTER4 product (Example: 2) Enter exactly as example. Check the API to get the list of filter4. 
suppliers_group_id1 JSON SUPPLIERS GROUP ID product (Example: 2) Enter exactly as example. Check the API to get the list of suppliers_group_id1. 
seller_country_shipping_id JSON COUTRY SHIPPING ID (Example: 30) Enter exactly as example. Check the API to get the list of countries.
seller_zone_shipping_id JSON ZONE SHIPPING ID (Example: 464) Enter exactly as example. Check the API to get the list of zones.

PHP Sample

	// sample add products
	
	$url = $domain_url . '/api_products_add.php;

	$data = array("products_status" => "1", // 1 = AVAILABLE or 0 = NOT AVAILABLE or 2 = PENDING (Only number is required) * FIELD REQUIRED
				  "products_model" => "CK2587XL", // Example: CK2587XL (Product identification code) * FIELD REQUIRED
				  "products_quantity" => "250", // Example: 250 (Only number is required) * FIELD REQUIRED
				  "categoria" => "162", // categorie_id get from api api_categories.php (Only number is required) * FIELD REQUIRED
				  "products_name_br" => "Anel de Prata 925 com Pedras de Zirconia Borboleta", // Example: Anel de Prata 925 com Pedras de Zirconia Borboleta (Recommended full product name) / Product Name in Portuguese only * FIELD REQUIRED
				  "products_name_en" => "Silver Ring with 925 Stones Zirconia Butterfly", // Example: Silver Ring with 925 Stones Zirconia Butterfly (Recommended full product name) / Product Name in English only
				  "products_name_es" => "Anillo de Plata 925 con Piedras de Zirconia Butterfly", // Example: Anillo de Plata 925 con Piedras de Zirconia Butterfly (Recommended full product name) / Product Name in Espanol only
				  "products_name_jp" => "Silver Ring with 925 Stones Zirconia Butterfly", // Example: Silver Ring with 925 Stones Zirconia Butterfly (Recommended full product name) / Product Name in Japanese only
				  "products_description_br" => "Descrição completa do produto em português", // Product description in Portuguese
				  "products_description_en" => "Product description in English", // Product description in English
				  "products_description_es" => "Descripción del producto en español", // Product description in Espanol
				  "products_description_jp" => "Product description in Japanese", // Product description in Japanese
				  "products_image" => "http://shop1.demoweb.ws/images/1061000_4Sm.jpg", // Main picture of the full size product. Filename (eg nomedaimagem.jpg) or full url (eg http://www.nomedosite.com.br/imagens/nomedaimagem.jpg). Filename must manually upload the images and full url is automatically captured the image file and saved on the server. Recommended size: 400x400 pixels ~ 800x800 pixels / File format: JPG / Correct Example: nome_do_arquivo_copia.jpg Wrong Example: File Name Cópia.jpg (Do not use special characters, space, semicolon at the images of the file name) * FIELD REQUIRED
				  "products_price" => "1542.56", // Example: 1542.56 (Do not use , "comma" only . "point" to indicate decimals) * FIELD REQUIRED
"seller_country_shipping_id" => 30, // Example: 30
"seller_zone_shipping_id" => 464, // Example: 464 "products_weight" => "0.150" // Example: 0.150 (0.150 = 150 grams / Fill only with numbers and point) * FIELD REQUIRED ); $data_string = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', "Cache-Control: no-cache", 'Usuario1: ' . base64_encode($usuario1), 'Senha1: ' . base64_encode($senha1), 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); curl_close($ch); print_r($result); // sample add products eof

 

Return Error:

code
message

Return Success:

code
products_model
products_id
message

2019-03-12 23:53 MFORMULA {writeRevision}
Average rating: 0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

{debugMessages}