Qlekta API Documentation

v2

Introduction

All API requests use versioned URL structure. Users should use appropriate version for requests.

 

Current API version is v2

URL Structure:
<REQUEST METHOD> https://qlekta.com/api/<version>/<method>

For each API user a unique authorization token will be provided. This token should be sent using headers for every API call

API call request example:
Authorization: Bearer <API token>
Accept: application/json

All request data should be sent in JSON format.

Methods

Get options

GET / options

This method returns all the values for requested property from Qlekta website. The name field should be used to specify the property value for requests.

Available names: category, brand, model, case_material, movement, bracelet_material, condition, target_gender, currency.

Data:
{"name":"category"}

Response (HTTP 200 OK):
[{"id":1,"name":"Watches"},{"id":4,"name":"Pocket watches"}]

Storing adverts

POST / adverts

Request is sent as batch request with all active adverts. If the advert with corresponding partner_advert_id is found in a database, it is updated, otherwise a new advert is created with provided parameters.

If errors have occurred during the import, response will contain all the error messages together with corresponding partner_advert_id.

All other adverts from given partner that are not included in the import data will be deleted.

Advert import is an asynchronous operation and will process in the background after json data is received and processed.

Data:
 
{
    "adverts": [
        {
            "partner_advert_id": "1-1600756815",
            "locale": "en",
            "category_id": 1,
            "description": "A great watch, it has soft edges and good style",
            "contact_email": "[email protected]",
            "store_address": "Tallinas 22b, Riga, Latvia",
            "store_coordinates": {
                "lat": "56.9562629",
                "lng": "24.1743926"
            },
            "images": [
                {
                    "url": "https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg"
                },
                {
                    "url": "https://images.pexels.com/photos/949587/pexels-photo-949587.jpeg",
                    "is_primary": 1
                }
            ],
            "price_only_on_request": 0,
            "currency": "RUB",
            "properties": {
                "brand": "rolex",
                "model": "Daytona Meteorite Romanl",
                "price": 400,
                "location": "ru",
                "reference_number": 234234,
                "case_material": "bronze",
                "bracelet_material": "rubber",
                "movement": "manual-winding",
                "case_size": 2,
                "year": 2020,
                "caliber": 5,
                "condition": "unworn",
                "has_documents": 1,
                "has_case": 1,
                "target_gender": "unisex",
                "has_gem_stones": 1,
                "has_chainlet": 1
            }
        },
        {
            "partner_advert_id": "1-1600756815",
             ...
        }
    ]
}

Response (HTTP 200 OK):
{"message": "Advert import started."}

 

Advert fields

Name
Data type
Example
Name
partner_advert_id*
Data type
string / integer
Example
5
Name
category_id
Data type
integer
Example
1
Name
locale*
Data type
string
Example
en
Name
description*
Data type
text
Example
The best watch of …
Name
contact_email*
Data type
string
Example
Name
store_address
Data type
string
Example
Laivu iela 53b, Riga, Latvia
Name
store_coordinates
Data type
Point {lat, lng}
Example
Name
store_coordinates.lat
Data type
float
Example
56.9562629
Name
store_coordinates.lng
Data type
float
Example
24.1743926
Name
images*
Data type
Array <{url, is_primary}>
Example
Name
images.*.url*
Data type
string
Example
https://mysite.com/photo2343.jpeg
Name
images.*.is_primary
Data type
boolean
Example
1
Name
price_only_on_request
Data type
boolean
Example
1
Name
currency
Data type
string
Example
EUR
  • Fields with “*” are required.

  • Use 1 for boolean types if true or parse an empty value in false case.

Advert fields

Name
Data type
Name
brand*
Data type
string
Name
model*
Data type
string
Name
price*
Data type
decimal
Name
location
Data type
string / iso 3166-1 country code
Name
reference_number
Data type
string / number
Name
case_material
Data type
string
Name
bracelet_material
Data type
string
Name
movement
Data type
string
Name
case_size
Data type
string / number
Name
year
Data type
integer
Name
caliber
Data type
string / number
Name
condition
Data type
string
Name
has_documents
Data type
boolean
Name
has_case
Data type
boolean
Name
target_gender
Data type
string
Name
has_gem_stones
Data type
boolean
Name
has_chainlet
Data type
boolean
  • Fields with “*” are required.

  • Use 1 for boolean types if true or parse an empty value in false case.

  • The code field from options should be used to specify reference_number, case_material, model and other field values where options are available.

Example Usage - PHP

//Init http client
$client = new GuzzleHttp\Client([
   "http_errors" => false,
   "verify" => false,
   "allow_redirects" => false,
   'headers' => [
       'Authorization' => 'Bearer 123',
       'Accept' => 'application/json',
   ]
]);

//Store/Update an advert
$response = $client->request('POST', 'https://qlekta.com/api/v2/advert',['json' =>[
   'adverts' => [
[
       'partner_advert_id' => 8, //your ID
       'locale' => 'en',
       'description' => 'A great watch, it has soft edges and good style',
       'store_address' => 'Tallinas 22b, Riga, Latvia',
       'contact_email' => '[email protected]',
       'images' => [
           [
               'url' => 'https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg'
           ],
           [
               'url' => 'https://images.pexels.com/photos/949587/pexels-photo-949587.jpeg',
               'is_primary' => 1
           ]
       ],
       'properties' => [
           'brand' => 'rolex',
           'model' => 'daytona-cerachrom-245',
           'price' => 400,
           'case_size' => 2,
           'reference_number' => 234234,
           'bracelet_material' => 'rubber',
       ]
   ]
]
]]));

To find out details, possible causes and solutions please visit My Listings - Unsuccessful in your profile.