Qlekta API Documentation
v2
v2
All API requests use versioned URL structure. Users should use appropriate version for requests.
Current API version is v2
<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
Authorization: Bearer <API token>
Accept: application/json
All request data should be sent in JSON format.
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"}]
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."}
Fields with “*” are required.
Use 1 for boolean types if true or parse an empty value in false case.
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.
//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.