<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/cost';
$data = array (
'params' => array(
'method' => 'qwair', // 'ecopost' for Eco Post / 'qwair' for Qwintry Air
'weight' => 5, // in lb
'hub_code' => 'DE1',
'addr_country' => 'RU',
'addr_zip' => '443000',
'addr_line1' => 'Стара Загора, 37',
'addr_line2' => 'подъезд 3',
'addr_city' => 'Самара',
'addr_state' => 'Самарская область',
'insurance' => false,
'items_value' => 44, // declaration items total cost in USD
'retail_pricing' => 0 // retail / wholesale pricing?
),
);
$data_string = http_build_query($data);
var_dump($data_string);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
//curl_setopt($ch, CURLOPT_HEADER, 1);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/cost';
$data = array (
'params' => array(
'weight' => 5, // in lb
'delivery_pickup' => 'msk_1', // full list of pickup points can be retrieved from /api/locations-list
'insurance' => true,
'items_value' => 500, // declaration items total cost in USD
'retail_pricing' => true // retail / wholesale pricing?
),
);
$data_string = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/countries-list'; // append '?country=RU' to download only info for specific country
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($response));
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/locations-list';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($response));
↑ go to methods list
A store needs to send its packages to one of Qwintry pickup hubs in destination country (so, US based store sends its packages to pickup hubs located in US) and packages are further dispatched by Qwintry. Right now Qwintry has pickup hubs in United States, China, and Germany. This methods returns a list of pickups hubs. Filtering by origin country is available. DE1 (Delaware, US) is a default hub in most of methods, like /cost.
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/hubs-list?country=cn';
$data = [];
$data_string = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/package-create';
$data = array (
'Shipment' => array (
'test' => true, // set to false when ready for production mode!
'delivery_type' => 'courier', // can also be 'pickup', than 'delivery_pickup' value is required to select pickup point
//'delivery_pickup' => 'msk_1',
'addr_line1' => 'Стара Загора 27',
'addr_line2' => 'кв. 76, домофон 234',
'addr_zip' => '443000',
'addr_state' => 'Самарская область',
'addr_city' => 'Самара',
'addr_country' => 'RU',
'first_name' => 'Василий',
'last_name' => 'Пупкин',
'patronymic' => 'Евгеньевич',
'birthday_date' => '14.12.1996',
'phone' => '+79176023899',
'email' => 'recipient-email@email.com',
'passport_number' => '44344444',
'passport_issue_date' => '14.12.2005',
'passport_issue_info' => 'выдан Заволжским УВД г.Самары',
'passport_address' => 'ул. Стара Загора, 27, кв.76', // address in passport
'inn' => '5995910237', // Inn number
'customer_notes' => 'Примечания по доставке',
'weight' => '6.27', // weight of package in lb
'dimensions' => '14x10x5', // shipment size in inches
'insurance' => true,
'external_id' => 'your-internal-order-id' . rand(0, 100000),
'hub_code' => 'DE1', // Qwintry pickup hub that receives the package (DE1 for Delaware/OR1 for Oregon)
'is_contains_batteries' => 1,
),
'items' => array(
0 => array(
'descr' => 'jeans, shop:amazon.com, asin:AS324244',
'descr_ru' => 'джинсы мужские',
'count' => 2,
'line_value' => '70.8', // line value in USD
// 'line_value_eur' => '59.5', // line value in Euro (optional)
'line_weight' => 3, // weight in lb
'link' => 'http://www.amazon.com/product-page',
),
1 => array(
'descr' => 'iphone 5s, black, 16GB, shop:apple.com',
'descr_ru' => 'телефон',
'count' => 1,
'line_value' => '620', // line value in USD
// 'line_value_eur' => '521', // line value in Euro (optional)
'line_weight' => 2, // weight in lb
'link' => 'http://www.ebay.com/product-page',
),
),
'invoices' => array(
0 => array(
'base64_data' => base64_encode(file_get_contents(__DIR__ . '/example_invoice.png')),
'base64_extension' => 'png', // png,gif,jpg,pdf are allowed
),
1 => array(
'base64_data' => base64_encode(file_get_contents(__DIR__ . '/example_invoice2.pdf')),
'base64_extension' => 'pdf',
),
),
'passport_scans' => array(
0 => array(
'base64_data' => base64_encode(file_get_contents(__DIR__ . '/passport_scan1.png')),
'base64_extension' => 'png', // png,gif,jpg,pdf are allowed
)
)
);
$data_string = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/package-create';
$data = array (
'Shipment' => array (
'method' => 'ecopost', // or 'ecopost_ems' for Qwintry EMS
'test' => true, // set to false when ready for production mode!
'addr_line1' => 'Стара Загора 27',
'addr_line2' => 'кв. 76, домофон 234',
'addr_zip' => '05000',
'addr_state' => 'Самарская область',
'addr_city' => 'Самара',
'addr_country' => 'RU',
'first_name' => 'Василий',
'last_name' => 'Пупкин',
'patronymic' => 'Евгеньевич',
'phone' => '+79176023899',
'email' => 'recipient-email@email.com',
'customer_notes' => 'Примечания по доставке',
'weight' => '1.3', // weight of package in lb
'dimensions' => '14x10x5', // shipment size in inches
'insurance' => true,
'external_id' => 'fffd1er-id23441',
'hub_code' => 'DE1', // Qwintry pickup hub that receives the package (DE1 for Delaware)
),
'items' => array(
0 => array(
'descr' => 'men jeans',
'count' => 2,
'line_value' => 70.8, // line value in USD
'line_weight' => 3.2 // weight in LB
),
1 => array(
'descr' => 'phone',
'count' => 1,
'line_value' => 620, // line value in USD
'line_weight' => 2.2 // weight in LB
),
),
);
$data_string = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/package-update';
// Right now package-update method can only be used to add invoices and passport scans to existing shipment.
// All new files are appended to the shipment, old files that were attached to shipment prior to this api call
// are not deleted! If you want to delete some file - please use browser ui.
$data = array (
'Shipment' => array (
'tracking' => 'QR13214985'
),
'invoices' => array(
0 => array(
'base64_data' => base64_encode(file_get_contents(__DIR__ . '/example_invoice.png')),
'base64_extension' => 'png', // png,gif,jpg,pdf are allowed
),
1 => array(
'base64_data' => base64_encode(file_get_contents(__DIR__ . '/example_invoice2.pdf')),
'base64_extension' => 'pdf',
),
),
'passport_scans' => array(
0 => array(
'base64_data' => base64_encode(file_get_contents(__DIR__ . '/passport_scan1.png')),
'base64_extension' => 'png', // png,gif,jpg,pdf are allowed
)
)
);
$data_string = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response); // response is {"success":true} that can be json_decoded to ['success' => true]
// or something like: {"errorCode":3,"errorMessage":"Passport scan #0 validation error:base64_extension:Base64 Extension is invalid.","success":false}
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/package-delete';
// only test or unpaid items can be deleted!
$data = array (
'Shipment' => array (
'tracking' => 'QR21350825'
)
);
$data_string = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$tracking = 'QR15696052';
$url = 'http://'. SITE_URL .'/api/package-label?tracking=' . $tracking ;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
//curl_setopt($ch, CURLOPT_HEADER, 1);
$response = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);
if ($http_status == 200) {
// single labels are pdf, multiple labels are zip
if ($content_type == 'application/pdf') {
$ext = 'pdf';
} elseif ($content_type == 'application/zip') {
$ext = 'zip';
} else {
throw new \Exception("Unknown file extension!");
}
header("Content-type:$content_type");
header('Content-Disposition: attachment; filename="'. $tracking .'.'. $ext .'"');
echo($response);
exit();
} else {
// some errors happened
var_dump($response);
}
↑ go to methods list
This method is used only for Qwintry Eco Post shipments. If you want request pdf file pass "pdf=1" parameter (Its only works for Ecopost Small Packets now)
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
// all Qwintry Eco Post packages must have 3 copies of CN23 and 1 copy of CP71 printed and attached to the package.
$tracking = 'CD008856575RU';
$url = 'http://'. SITE_URL .'/api/package-cn23?tracking=' . $tracking .'&pdf=0';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);
// the excel file contains 3 copies of cn23 and 1 copy of cp71.
if ($content_type == 'application/vnd.ms-excel' && $http_status == 200) {
// everything is perfect. we may save label somewhere, or just put it to output of browser
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="cn23example.xls"');
echo($response);
exit();
} else {
//some errors happened
var_dump($response);
}
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$tracking = 'QR22200153'; // provide tracking number assigned to your shipment
$url = 'http://'. SITE_URL .'/api/track?tracking=' . $tracking;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
print_r($response);
{
"success": true,
"current": {
"create_time": "1435824910",
"status": "arrival_scan",
"status_ru": "груз прибыл",
"message": "Planned delivery date - 2015-07-07. Arrival scan: Алматы [ALA]",
"message_ru": "Planned delivery date - 2015-07-07. Arrival scan: Алматы [ALA]"
},
"history": [
{
"status": "info_received",
"create_time": "1435250227",
"message": "Electronic info received",
"status_ru": "информация получена",
"message_ru": "Данные о посылке получены"
},
{
"status": "departure_scan",
"create_time": "1435265647",
"message": "Departure scan: Newark, Delaware, US",
"status_ru": "груз выехал",
"message_ru": "Груз выехал из Ньюарка, Делавэр"
},
{
"status": "arrival_scan",
"create_time": "1435338714",
"message": "Arrival scan: JFK airport",
"status_ru": "груз прибыл",
"message_ru": "Груз прибыл в аэропорт Нью-Йорка (JFK)"
},
{
"status": "departure_scan",
"create_time": "1435428743",
"message": "Departure scan: JFK airport",
"status_ru": "груз выехал",
"message_ru": "Груз вылетел из аэропорта Нью-Йорка (JFK)"
},
{
"status": "notification_sent",
"create_time": "1435478847",
"message": "Delivery notification sent to recipient",
"status_ru": "сообщение отправлено",
"message_ru": "Сообщение о доставке отправлено получателю"
},
{
"status": "arrival_scan",
"create_time": "1435480222",
"message": "Arrival scan: VKO airport, Moscow",
"status_ru": "груз прибыл",
"message_ru": "Груз прибыл в аэропорт Внуково (Москва)"
},
{
"status": "departure_scan",
"create_time": "1435514467",
"message": "Departure scan: VKO airport, Moscow",
"status_ru": "груз выехал",
"message_ru": "Груз выехал из аэропорта Внуково (Москва)"
},
{
"status": "arrival_scan",
"create_time": "1435695980",
"message": "Planned delivery date - 2015-07-07. Arrival scan: Москва [MON]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2015-07-07. Arrival scan: Москва [MON]"
},
{
"status": "departure_scan",
"create_time": "1435714429",
"message": "Planned delivery date - 2015-07-07. Departure scan: Москва [MON]",
"status_ru": "груз выехал",
"message_ru": "Planned delivery date - 2015-07-07. Departure scan: Москва [MON]"
},
{
"status": "arrival_scan",
"create_time": "1435740036",
"message": "Planned delivery date - 2015-07-07. Arrival scan: Москва [SVO]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2015-07-07. Arrival scan: Москва [SVO]"
},
{
"status": "departure_scan",
"create_time": "1435740204",
"message": "Planned delivery date - 2015-07-07. Departure scan: Москва [SVO]",
"status_ru": "груз выехал",
"message_ru": "Planned delivery date - 2015-07-07. Departure scan: Москва [SVO]"
},
{
"status": "arrival_scan",
"create_time": "1435824910",
"message": "Planned delivery date - 2015-07-07. Arrival scan: Алматы [ALA]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2015-07-07. Arrival scan: Алматы [ALA]"
},
],
"export_id": "1095221962",
"local_track_url": "http://www.edostavka.ru/track.html?order_id=1095221962",
"carrier": "CDEK",
}
{
"success": false,
"errorMessage": "shipment not found"
}
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
// tracking numbers assigned to your shipment
// incorrect tracking will be silently ignored and would not appear in resulting array
$trackings = ['QR22635319', 'QR12421080', 'inexistent-tracking'];
$url = 'http://'. SITE_URL .'/api/track-multiple?';
foreach ($trackings as $tracking) {
$url .= 'tracking[]=' . $tracking . '&';
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
print_r($response);
curl_close($ch);
print_r(json_decode($response));
{
"success": true,
"results": {
"QR12421080": {
"tracking": "QR12421080",
"current": {
"create_time": "1419685203",
"status": "delivered",
"status_ru": "доставлено",
"message": "Shipment delivered",
"message_ru": "Отправление доставлено"
},
"history": [
{
"status": "info_received",
"create_time": "1418228493",
"message": "Electronic info received",
"status_ru": "информация получена",
"message_ru": "Данные о посылке получены"
},
{
"status": "departure_scan",
"create_time": "1418331597",
"message": "Departure scan: Tualatin, Oregon, US",
"status_ru": "груз выехал",
"message_ru": "Departure scan: Tualatin, Oregon, US"
},
{
"status": "arrival_scan",
"create_time": "1418823772",
"message": "Arrival scan: JFK airport",
"status_ru": "груз прибыл",
"message_ru": "Груз прибыл в аэропорт Нью-Йорка (JFK)"
},
{
"status": "departure_scan",
"create_time": "1418921847",
"message": "Departure scan: JFK airport",
"status_ru": "груз выехал",
"message_ru": "Груз вылетел из аэропорта Нью-Йорка (JFK)"
},
{
"status": "arrival_scan",
"create_time": "1418967991",
"message": "Arrival scan: SVO airport, Moscow",
"status_ru": "груз прибыл",
"message_ru": "Груз прибыл в аэропорт Шереметьево (Москва)"
},
{
"status": "notification_sent",
"create_time": "1419420017",
"message": "Closest delivery on 26.12.2014, notification sent to recipient",
"status_ru": "сообщение отправлено",
"message_ru": "Closest delivery on 26.12.2014, notification sent to recipient"
},
{
"status": "departure_scan",
"create_time": "1419451959",
"message": "Departure scan: SVO airport, Moscow",
"status_ru": "груз выехал",
"message_ru": "Груз выехал из аэропорта Шереметьево (Москва)"
},
{
"status": "delivery",
"create_time": "1419577203",
"message": "Shipment passed to delivery",
"status_ru": "передано в доставку",
"message_ru": "Отправление передано в доставку в курьерскую службу"
},
{
"status": "delivered",
"create_time": "1419685203",
"message": "Shipment delivered",
"status_ru": "доставлено",
"message_ru": "Отправление доставлено"
}
],
"export_id": "30516052312",
"local_track_url": "https://status.iml.ru",
"carrier": "IML",
},
"QR22635319": {
"tracking": "QR22635319",
"current": {
"create_time": "1418217300",
"status": "delivered",
"status_ru": "доставлено",
"message": "Planned delivery date - 2014-12-11. Delivered: Брест [BQT]",
"message_ru": "Planned delivery date - 2014-12-11. Delivered: Брест [BQT]"
},
"history": [
{
"status": "departure_scan",
"create_time": "1417079049",
"message": "Departure scan: Newark, Delaware, US",
"status_ru": "груз выехал",
"message_ru": "Груз выехал из Ньюарка, Делавэр"
},
{
"status": "info_received",
"create_time": "1417451382",
"message": "Electronic info received",
"status_ru": "информация получена",
"message_ru": "Данные о посылке получены"
},
{
"status": "arrival_scan",
"create_time": "1417646905",
"message": "Arrival scan: JFK airport",
"status_ru": "груз прибыл",
"message_ru": "Груз прибыл в аэропорт Нью-Йорка (JFK)"
},
{
"status": "departure_scan",
"create_time": "1417689553",
"message": "Departure scan: JFK airport",
"status_ru": "груз выехал",
"message_ru": "Груз вылетел из аэропорта Нью-Йорка (JFK)"
},
{
"status": "arrival_scan",
"create_time": "1417736485",
"message": "Arrival scan: SVO airport, Moscow",
"status_ru": "груз прибыл",
"message_ru": "Груз прибыл в аэропорт Шереметьево (Москва)"
},
{
"status": "departure_scan",
"create_time": "1417775104",
"message": "Departure scan: SVO airport, Moscow",
"status_ru": "груз выехал",
"message_ru": "Груз выехал из аэропорта Шереметьево (Москва)"
},
{
"status": "notification_sent",
"create_time": "1417785857",
"message": "Delivery notification sent to recipient",
"status_ru": "сообщение отправлено",
"message_ru": "Сообщение о доставке отправлено получателю"
},
{
"status": "arrival_scan",
"create_time": "1417885054",
"message": "Planned delivery date - 2014-12-11. Arrival scan: Москва [M14]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2014-12-11. Arrival scan: Москва [M14]"
},
{
"status": "departure_scan",
"create_time": "1417965422",
"message": "Planned delivery date - 2014-12-11. Departure scan: Москва [M14]",
"status_ru": "груз выехал",
"message_ru": "Planned delivery date - 2014-12-11. Departure scan: Москва [M14]"
},
{
"status": "arrival_scan",
"create_time": "1417976614",
"message": "Planned delivery date - 2014-12-11. Arrival scan: Москва [MOS]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2014-12-11. Arrival scan: Москва [MOS]"
},
{
"status": "departure_scan",
"create_time": "1418068962",
"message": "Planned delivery date - 2014-12-11. Departure scan: Москва [MOS]",
"status_ru": "груз выехал",
"message_ru": "Planned delivery date - 2014-12-11. Departure scan: Москва [MOS]"
},
{
"status": "arrival_scan",
"create_time": "1418114536",
"message": "Planned delivery date - 2014-12-11. Arrival scan: Минск [MSQ]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2014-12-11. Arrival scan: Минск [MSQ]"
},
{
"status": "departure_scan",
"create_time": "1418179728",
"message": "Planned delivery date - 2014-12-11. Departure scan: Минск [MSQ]",
"status_ru": "груз выехал",
"message_ru": "Planned delivery date - 2014-12-11. Departure scan: Минск [MSQ]"
},
{
"status": "arrival_scan",
"create_time": "1418202477",
"message": "Planned delivery date - 2014-12-11. Arrival scan: Брест [BQT]",
"status_ru": "груз прибыл",
"message_ru": "Planned delivery date - 2014-12-11. Arrival scan: Брест [BQT]"
},
{
"status": "delivering",
"create_time": "1418207667",
"message": "Planned delivery date - 2014-12-11. Delivering: Брест [BQT]",
"status_ru": "доставка",
"message_ru": "Planned delivery date - 2014-12-11. Delivering: Брест [BQT]"
},
{
"status": "delivered",
"create_time": "1418217300",
"message": "Planned delivery date - 2014-12-11. Delivered: Брест [BQT]",
"status_ru": "доставлено",
"message_ru": "Planned delivery date - 2014-12-11. Delivered: Брест [BQT]"
}
],
"export_id": "1095221962",
"local_track_url": "http://www.edostavka.ru/track.html?order_id=1095221962",
"carrier": "CDEK",
}
}
}
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/balance';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
↑ go to methods list
<?php
define('SITE_URL', 'logistics.qwintry.com');
define('API_KEY', 'YOUR_API_KEY'); //don't forget to set your key!
$url = 'http://'. SITE_URL .'/api/profile';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. API_KEY));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
{
"status": "success",
"data": {
"username": "Ivan Ivanov #1",
"email": "iiva@example.com",
"website_domain": null,
"phone": "",
"company_name": "Microsoft",
"weight_measurement": "lb",
"shipping_country": "USA"
},
"message": ""
}
This method provides data for Yandex maps in Russia.
You can see about Yandex api method 'LoadingObjectManager' there:
https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/reference/LoadingObjectManager-docpage
<div id="map" style="width: 900px; height: 700px"></div>
<script src="http://api-maps.yandex.ru/2.1/?load=package.full&lang=ru-RU" type="text/javascript"></script>
<script>
ymaps.ready(function () {
pvzMap = new ymaps.Map('map', {
center: [51.7098570, 36.1458180], // You can change coordinates for another city
zoom: 12
});
var api_key = 'ttTESTYe0DWScBwMfkBxbXPJL7TEST'; // //don't forget to set your key!
var balloonMaxWidth = window.innerWidth-100 > 400 ? 400: window.innerWidth-100;
objectManager = new ymaps.LoadingObjectManager(
'http://logistics.qwintry.com/api/pvz-list-ymaps?bbox=%b&access-token=' + api_key + '&balloonMaxWidth=' + balloonMaxWidth, {
clusterize: true,
// Cluster options
clusterHasBalloon: true,
minClusterSize: 5,
// GeoObject options
geoObjectOpenBalloonOnClick: true,
});
objectManager.clusters.options.set({
preset: 'islands#orangeClusterIcons',
});
pvzMap.geoObjects.add(objectManager);
});
</script>
This method send such request:
http://logistics.qwintry.com/api/pvz-list-ymaps?callback=id_3423hdsf&bbox=55.6582,37.4414,55.8564,37.8809&balloonMaxWidth=400&access-token=ttTESTYe0DWScBwMfkBxbXPJL7TEST
↑ go to methods list
Strategic
partner
Strategic
partner
TSA Approved Known Shipper
Partner
Partner