User Tools

Site Tools


en:api_solutions:api_search_products

API-Interface #7: Product search

API-client interface to send XML-requests and receiving XML/JSON response from the server API with a list of items found


XML-request (example)

Request URL
https://axefile.com/api/search_goods/
Method POST
Request
<?xml version="1.0" encoding="UTF-8"?>
<request api_version="1.0">
    <merchant_data>
        <merchant>120</merchant>
        <signature>J6NDWTCOPZ2GLD3GGODXIYJESHBUGT13</signature>
    </merchant_data>
    <data>
       <search_query>Search query...</search_query>
        <page>0</page>
        <rows>25</rows>
        <currency>usd</currency>
        <language>en</language>
        <order>ratingDESC</order>
        <format>xml</format>
    </data>
</request>

Request parameters

Name Status Description Data Type
merchantrequiredThe unique identifier of the seller (agent), received at registration (you can view My Office) (integer)
signaturerequiredThe signature request is calculated as follows (PHP):
$sign=sha1(md5($merchant.$shop_hash))

where
$merchant - the unique identifier of the seller (agent)
$shop_hash - secret key, which can be obtained here: https://axefile.com/en/partner/referal

(string)
search_queryrequiredThe string search query (one or more words, separated by a space). The string length of 3 to 150 characters. (string{3,150})
pageoptionalThe page number at which to start output results. По умолчанию: 0 (integer)
rowsoptionalThe number of entries per page. Default: 25 (integer)
currencyoptionalIn what currency to deduce the value of the goods. Available Currency: uah,usd,rub,eur. Default: usd (string)
languageoptionalIn what language to display the product name (ru - Russian, en - English). Default: en (string). The result will be displayed only if there have goods in the name of the requested language. For example, if you set the requested value of “ru”, and product name in Russian is not available, and the name in English is present, the result is absent and vice versa. (string)
orderoptionalThe sort of results:
dateASC - by date - Old to New
dateDESC - by date - New to Old
titleASC - by title A - Z
titleDESC - by title Z - A
priceASC - by price - ASC
priceDESC - by price - DESC
ratingASC - rated Seller - ASC
ratingDESC - rated Seller - DESC
Default: rated Seller - ratingDESC
If not specified, the list is sorted by the seller
Values ​​are case sensitive.
(string)
formatoptionalThe format of the response to the request (xml/json). Default: xml (string)

XML response to the request (Example)

<?xml version="1.0" encoding="UTF-8"?>
<response api_version="1.0">
  <goods cnt="3">
    <good id="0">
      <id>1227</id>
      <title>The archive file (universal)</title>
      <price>1.00</price>
      <currency>usd</currency>
      <type>0</type>
      <unique>0</unique>
      <good_num>1</good_num>
      <size_file>5443</size_file>
      <mime>zip</mime>
      <hash_md5>b38eab095622f18c8a2369c4bcb60b51</hash_md5>
      <sales>0</sales>
      <seller>145</seller>
      <agent>10</agent>
      <gift>0</gift>
      <return>0</return>
      <moneyback>0</moneyback>
      <date_create>1435666078</date_create>
      <seller_rating>101.00364067</seller_rating>
      <cnt_reviews_negative>0</cnt_reviews_negative>
      <cnt_reviews_positive>0</cnt_reviews_positive>
      <username>Andrew Akishin</username>
      <shop>Fortuna</shop>
    </good>
    <good id="1">
      <id>1231</id>
      <title>Arbitrary code on a single line (universal)</title>
      <price>5.00</price>
      <currency>usd</currency>
      <type>2</type>
      <unique>1</unique>
      <good_num>3</good_num>
      <size_file>0</size_file>
      <mime/>
      <hash_md5/>
      <sales>0</sales>
      <seller>145</seller>
      <agent>10</agent>
      <gift>0</gift>
      <return>0</return>
      <moneyback>0</moneyback>
      <date_create>1435673082</date_create>
      <seller_rating>101.00364067</seller_rating>
      <cnt_reviews_negative>0</cnt_reviews_negative>
      <cnt_reviews_positive>0</cnt_reviews_positive>
      <username>Andrew Akishin</username>
      <shop>Fortuna</shop>
    </good>
  </goods>
  <search_query>universal</search_query>
  <cnt_goods>3</cnt_goods>
  <status status_descr="Successful sending a response from the API-server">success</status>
</response>

JSON response to the request (Example)

//The answer comes to JSON format, but we have to render its conclusions in the form of a data array (PHP):
print_r(json_decode($json_data, TRUE);)
Array
(
    [goods] => Array
        (
            [0] => Array
                (
                    [id] => 1227
                    [title] => The archive file (universal)
                    [price] => 1.00
                    [currency] => usd
                    [type] => 0
                    [unique] => 0
                    [good_num] => 1
                    [size_file] => 5443
                    [mime] => zip
                    [hash_md5] => b38eab095622f18c8a2369c4bcb60b51
                    [sales] => 0
                    [seller] => 145
                    [agent] => 10
                    [gift] => 0
                    [return] => 0
                    [moneyback] => 0
                    [date_create] => 1435666078
                    [seller_rating] => 101.00364067
                    [cnt_reviews_negative] => 0
                    [cnt_reviews_positive] => 0
                    [username] => Andrew Akishin
                    [shop] => Fortuna
                )
 
            [1] => Array
                (
                    [id] => 1231
                    [title] => Arbitrary code on a single line (universal)
                    [price] => 5.00
                    [currency] => usd
                    [type] => 2
                    [unique] => 1
                    [good_num] => 3
                    [size_file] => 0
                    [mime] =>
                    [hash_md5] =>
                    [sales] => 0
                    [seller] => 145
                    [agent] => 10
                    [gift] => 0
                    [return] => 0
                    [moneyback] => 0
                    [date_create] => 1435673082
                    [seller_rating] => 101.00364067
                    [cnt_reviews_negative] => 0
                    [cnt_reviews_positive] => 0
                    [username] => Andrew Akishin
                    [shop] => Fortuna
                )
 
        )
 
    [cnt_goods] => 3
    [search_query] => universal
    [status] => success
    [status_descr] => Successful sending a response from the API-server
)

Response parameters (XML/JSON)

Name Description Date Type
goods/ Goods of the Seller. Attribute cnt - the total number of goods
goods/good/ Item ID seller outputted cycle. Attribute id - serial number
goods/good/idProduct ID(integer)
goods/good/titleProduct Name. It may be displayed in one of the languages (ru - Russian, en - English) that was specified in request parameter language. (string)
goods/good/priceThe cost of goods in the currency, which has been specified in the request (example: 250.00) (decimal(12,2))
goods/good/currencyCurrencies of commodity, which has been specified in the request. Possible values​​: uah,usd,rub,eur (string)
goods/good/typeProduct Type: 0 - archive file, 1 - the text of an arbitrary, 2 - arbitrary code on a single line, 3 - 16-digit code (integer)
goods/good/uniqueThe uniqueness of the product (single sale). 0 - sold unlimited times, 1 - only sold once (integer)
goods/good/good_numThe number of units available for sale (integer)
goods/good/size_fileSize of file in bytes. If the parameter is displayed type == 0 (архивный файл), for other values output: 0 (integer)
goods/good/mimeMIME-type of the digital product (more.... Displayed only when the parameters of the goods type == 0 (archive file), the remaining values ​​output: null (string)
goods/good/hash_md5The calculation of the checksum file MD5 algorithm. Displayed only when the parameters of the goods type == 0 (archive file), the remaining values ​​output: null (string)
goods/good/salesThe number of sales of goods (integer)
goods/good/sellerSeller ID (integer)
goods/good/agentPartner remuneration to the agent for the sale of this item is displayed as a percentage (%). (integer)
goods/good/giftBonus buyer a percentage (%) of the value of goods for the positive feedback on this product (integer)
goods/good/returnThe number of product returns (integer)
goods/good/moneybackMoneyback - is number of days period to return the funds paid by the buyer (integer)
goods/good/date_createDate Product format *unix time stamp (integer)
goods/good/seller_ratingSeller Rating (example: 101.00364067) (decimal(12,8))
goods/good/cnt_reviews_negativeNegative feedbacks Product (integer)
goods/good/cnt_reviews_positivePositive feedbacks Product (integer)
goods/good/usernameFirst and Last Name of Seller (string)
goods/good/shopName of shop (string)
search_querySearch Query (string{150})
cnt_goodsNumber of products in the category (integer)
status (XML)The status of the response from the API server: success - successfully completed, error - error. For a more complete understanding of the tag is transferred XML-Attribute @status_descr - status description (string)
status (JSON)The status of the response from the API server: success - successfully completed, error - error. (string)
status_descr (JSON)Description of the status of the response from the API server. (string)

To obtain and use API-solutions you need to log in using the login form for partners / sellers to get seretny key. If you are not registered as a partner, you can do it right now: go to the registration.

en/api_solutions/api_search_products.txt · Last modified: 2015/09/26 10:45 (external edit)