Authorization


Registration   Forgot password?

Adding a New Manufacturer or/and Editing an Existing One


If you wish to add a new product or/and edit an existing one please open the following file:

product_edit.php


Legend:
<element> – optional elements
param – required parameters
param – optional parameters

API Request:
POST /API/product_edit.php?api_id=id&api_key=key HTTP/1.1
Host: www.shopxml.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

id=product_id&categories=category_id&name=string&comment=string&description=string&price=decimal&...
(List of possible request parameters is below)

API Response:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8" ?> 
<id>product_id</id>


Request parameters (not essential to use unless specified):

id - product id can be transmitted only when editing an existent one. To create a new one -0- it should be transmitted (optional)
categories - categories are listed with commas (it is essential when adding a new product) which particular products have to be linked to. Can be also transmitted as an array (categories[]).
categories_delete - categories are listed with commas, where particular products must be unlinked. They can be also transmitted as an array (categories_delete[]).
name - name (it is essential when adding new product) up to 255 symbols.
active - activity flag. -0- or -1-. New products have 1 (default).
priority - priority runs from 0 to 255
time_available - time is reflected by UNIX_TIMESTAMP (indicated in seconds starting from 1970) designating product availability.
date_available - date in YYYY-MM-DD format, designating product availability
in_stock - availability. 0 or 1.
is_new - indicates, if the product is new. 0 or 1
price - product price (primary).
opt1 - minimal quantity for retail sales (0 indicates none)
price1 - retail product price
opt2 - minimal quantity for the whole sales (0 indicates none)
price2 - the whole sale product price
price_type - the product type. 0- indicates unavailability of primary product, 1- special product (discounted), 2 featured (seasonal products)
spec_time1 - it indicates the beginning time point in UNIX-TIMESTAMP, when certain product marked as featured. 0 indicates no limits
spec_date1 - the beginning time point in YYYY-MM-DD format, when particular product is featured. Analog of spec_time1.
spec_time2 - the highest time point reflected in UNIX-TIMESTAMP when particular product has certain feature. 0 indicates no limits.
spec_date2 - the highest time bound in YYYY-MM-DD format, when particular product has certain feature. Analog of spec_time2 or could be reflected in different format.
spec_price - the base price for the current period. 0- indicates equivalent of the primary price.
spec_price1 - the retail price for the current period. 0- indicates unavailability.
spec_price2 - the whole sale price for the current period. 0 indicates unavailability.
quantity - it shows the availability of the products at the warehouse. 1000000 indicates no limits.
num_choosed - the number of already purchased products.
mnfID - manufacturer ID. 0 indicates unidentified manufacturer.
upc_code - UPC product code (universal product code)
ean_code - EAN product code (European Article Number)
code - internal product code up to 16 symbols
model - product model up to 50 symbols.
url - web address of the primary product location up to 255 symbols.
weight - product weight
measure - units (e.g. kilograms, containers) up to 50 symbols.
dimensions - size up to 100 symbols
comment - brief description up to 255 symbols.
description - it is complete description up to 65K symbols.
meta_title - header for the TEXT tag in HTML format
meta_keywords - keywords to be inserted into the meta-tags
meta_description - the description to be inserted into the meta-tags
imageN - image file, transmitted by utilizing POST method analog of browser method (e.g. <input type=file name=image>), or string that contains image URL address. N symbol indicates image file number 1 though 6. 1,2,3 are small, medium and large image formats and 4,5,6 are additional. There are few image files which can be transmitted simultaneously e.g. image1=...&image2=...
documentN - an additional document file, transmitted utilizing POST method an analog of a browser method (e.g. <input type=file name=document1>) or a string that contains URL address of the particular file. N symbol represents the number of the file 1 though 3. These files can be transmitted as an array: document1=...&document2=...
document_nameN - the name of an additional document file up to 50 symbols, where N symbol represents number of the document 1 though 3. It can be transmitted simultaneously as an array: document_nam1=...&document_name2=...
additional_field[code] - additional product field among particular product defined in this product database. code it defines the code of particular additional field. e.g. additional_field[add_field_type] or additional_field[add_field_material]. The value depends on the field type directly. checkbox 0 or 1; string or text string; an ID of an option (integer) is for the select field and list of option ID arranged through commas is for the multiple field.

Factually, each product may contain unique attributes which customer indicates when ordering this particular product. Each attribute has its own unique options (values) are chosen by the customer, otherwise the attribute has a text field which should completed by the customer. Attributes have multilevel structure (please refer to the above description in the interface of product selection). For the convenience the amount of transmitted data is minimized by the usage of suffixesin the names, e.g. instead of attr[1][name] is transmitted as attr_name[1] e.t.c. These arrays are linked by the indexes, which shown in brackets, e.g. attr_code[1], attr_type[1] etc.

Please remember few more rules:
1. If you do not wish to change attributes in an existent product or if a newly added product does not have assigned attributes, below described data in not required.
2. However, if you transmit this data then the set of product attributes will be relinked considering this newly entered data.
3. If you wish to delete attributes of an existent product without adding a new one
you are not required to transmit all the parameters, instead you need only one parameter shown below:
drop_attrs=1

Set of essential parameters for attribute maneuvering:

attr_name[] - attribute name (e.g. Color or size). Essential. String fits up to 50 symbols.
attr_type[] - attribute type is an integer number that runs from 0 to 3. essential element. There are four types of attributes: -0- essential attribute (included by the customer); 1- optional attribute (non-essential); 2- multiple choice attribute; 3- text field completed by the customer during the product purchase.
attr_code[] - unique (within product limits) attribute code (e.g. color). String is up to 50 symbols. Field is not required. If it is not transmitted or not unique the system will assign automatically generated unique code.
attribute_description[] - attribute description. String is up to 255 symbols.
attr_min_length[] - is assigned to type 3 attribute, which a minimal text length. If is non-existent or equals to 0 then this attribute (text field) is not required to be completed by the customer.
attr_max_length[] - it is assigned to type 3 attribute and indicated maximal text length.

It is also required to transmit the set of options for the attributes type 0-2 (its possible values). This set of values is transmitted through two-level arrays where first array index (indicated in first brackets) shows the attribute index and second index (in the second set of brackets) shows option index. e.g. attr_option_name[color][red] or attr_option_name[1][1], etc. Values are linked by its indexes.

attr_option_name[][] - option name. Essential. String up to 50 symbols. e.g. Red Metallic
attr_oprion_code[][] - unique option code (within attribute limit) (e.g. red-metal). String up to 50 symbols. This field is optional. In the case it is not transmitted or not unique, the system will assign automatically generated unique code.
attr_option_price[][] - option price (non-existent equals 0) and is assumed in the product cost when chosen by the customer, in some cases might be negative or positive.
attr_option_weight[][] - option weight (non existent equals 0) and is assumed in the total weight of the product chosen by the customer, in some cases might appear as negative or positive.
attr_option_quantity[][] - available quantity of products with a particular option (unavailable = unlimited).

It is easy to define combination of product attributes if this particular product has already defined attribute, it sets the parameter of the product when certain attributes absorb certain values (when chosen by the customer). Combinations are similar to attributes - it is set by the similar key elements with suffixes contained in the name, for example attr_comb_definition[1] <=> attr_comb_price[1] et.c.

All attribute combinations have set of parameters as well as single attributes which are added to the primary data as price and weight, also product availability with the same attribute combination. Please note, if the product has specified combination attribute, this product is considered to be available only in this particular combination and will appear as unavailable in any other variations. If this combination and all its participating attributes have alike assigned parameters (e.g. additional weight) then the combination parameters are taken under consideration and the parameters of the single attributes are ignored.

Please remember the following rules:
1. If you do not wish to change the set of combinations of an existent product or add new one without assigned attribute combination, then there is no need to transmit the data described below.
2. However, if you transmit this data then the set of product attribute combinations will be assigned accordingly. Every time changing any attribute combination you should always transmit the full set of attribute combinations of a particular product.
3. If you wish to delete an existing attribute combination without adding new ones you should not transmit the parameters as described below. Instead you must use only the following one
drop_attr_comb=1.
4. If product parameters are deleted or edited then all of their attribute combinations will be automatically deleted and non-recoverable, so they will have to be recreated if essential.

Set of essential parameters for attribute maneuvering:

attr_comb_definition[] - attribute combination definition, arranged with a space between each pair e.g. attribute_code#option_code, those which set the attribute code (only type 0 or 1) and the code of its option separated by # symbol (all attributes with its options and matching codes are essential). e.g. color#gold size#xl.
attr_comb_price[] - price attribute combination (non-existent = 0) and assumed in the total price of the product when particular product is chosen by the customer, it might have positive or negative value.
attr_comb_weight[] - combination weight (non-existent = 0) and assumed in the total weight of the particular product when chosen by the customer, might have positive or negative value.
attr_comb_quantity[] - product availability in the particular combination (unavailable = unlimited).

Please remember, that not all the parameters are essential unless it is specified.


Response parameters:

If no error ocurrs, the answer field gives an ID of a new/existent product in XML format as following:

<id> - product ID, an integer number
Contact Us Legal and Policies Sitemap
© XMLShop.com 2004 – 2018