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:
<element> optional elements
param required parameters
param optional parameters
POST /API/product_edit.php?api_id=id&api_key=key HTTP/1.1
(List of possible request parameters is below)
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8" ?>
(not essential to use unless specified):
- product id can be transmitted only when editing an existent one. To create a new one -0- it should be transmitted (optional)
- 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 are listed with commas, where particular products must be unlinked. They can be also transmitted as an array (categories_delete).
- name (it is essential when adding new product) up to 255 symbols.
- activity flag. -0- or -1-. New products have 1 (default).
- priority runs from 0 to 255
- time is reflected by UNIX_TIMESTAMP (indicated in seconds starting from 1970) designating product availability.
- date in YYYY-MM-DD format, designating product availability
- availability. 0 or 1.
- indicates, if the product is new. 0 or 1
- product price (primary).
- minimal quantity for retail sales (0 indicates none)
- retail product price
- minimal quantity for the whole sales (0 indicates none)
- the whole sale product price
- the product type. 0- indicates unavailability of primary product, 1- special product (discounted), 2 – featured (seasonal products)
- it indicates the beginning time point in UNIX-TIMESTAMP, when certain product marked as featured. 0 – indicates no limits
- the beginning time point in YYYY-MM-DD format, when particular product is featured. Analog of spec_time1.
- the highest time point reflected in UNIX-TIMESTAMP when particular product has certain feature. 0 – indicates no limits.
- 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.
- the base price for the current period. 0- indicates equivalent of the primary price.
- the retail price for the current period. 0- indicates unavailability.
- the whole sale price for the current period. 0 – indicates unavailability.
- it shows the availability of the products at the warehouse. 1000000 indicates no limits.
- the number of already purchased products.
- manufacturer ID. 0 – indicates unidentified manufacturer.
- UPC product code (universal product code)
- EAN product code (European Article Number)
- internal product code up to 16 symbols
- product model up to 50 symbols.
- web address of the primary product location up to 255 symbols.
- product weight
- units (e.g. kilograms, containers) up to 50 symbols.
- size up to 100 symbols
- brief description up to 255 symbols.
- it is complete description up to 65K symbols.
- header for the TEXT tag in HTML format
- keywords to be inserted into the meta-tags
- the description to be inserted into the meta-tags
- 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.
- 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:
- 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:
- additional product field among particular product defined in this product database.
– it defines the code of particular additional field. e.g.
. The value depends on the field type directly.
– 0 or 1;
– string; an ID of an option (integer)
is for the
field and list of option ID arranged through commas is for the
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
is transmitted as
e.t.c. These arrays are linked by the indexes, which shown in brackets,
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:
Set of essential parameters for attribute maneuvering:
- attribute name (e.g. Color or size). Essential. String fits up to 50 symbols.
- 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.
- 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. String is up to 255 symbols.
- 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.
- 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.
Values are linked by its indexes.
- option name. Essential. String up to 50 symbols. e.g.
- unique option code (within attribute limit) (e.g.
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.
- 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.
- 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.
- 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,
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
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:
- attribute combination definition, arranged with a space between each pair e.g.
, 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).
- 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.
- 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.
- product availability in the particular combination (unavailable = unlimited).
Please remember, that not all the parameters are essential unless it is specified.
If no error ocurrs, the answer field gives an ID of a new/existent product in XML format as following:
- product ID, an integer number