###Tipos de vehículos:
Código | Descripción |
---|---|
scooter | Cualquier tipo de motocicleta |
car | Autos tipo sedan |
van | Camionetas tipo estaquita |
###Tipos de servicios: cada tipo de servicio se combina con cada tipo de vehículo.
Ej. Exps CAR, EExps VAN, Hoy Scooter
Código | Servicio | Descripción |
---|---|---|
EExps | Ultra Express | Envio instantaneo de punto a punto |
Exps | Express | Envio rápido compartido con otros paquetes |
Hoy | Mismo Día | El envio se puede realizar entre las 10 am y 10 pm |
Con el url y el api key del usuario de pruebas se puede realizar todas las transacciones de la misma forma que se harían en el servidor de producción.
URL: http://54.191.139.107/api/v2/
API key: abcdefghijk
Endpoints Disponibles skydrop.com.mx/api_doc
Resource | Description |
---|---|
GET /api/v2/orders | Returns all the orders related to a given customer |
GET /api/v2/orders/:id | Returns a specific order details |
POST /api/v2/orders | Creates an order |
Resource | Description |
---|---|
POST /api/v2/shipping_rates | Available shipping rates at the moment |
<?php
// Request
$request = new HttpRequest();
$request->setUrl('http://54.191.139.107/api/v2/shipping_rates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'postman-token' => 'ac729396-b027-ad7d-782c-e3b833fc7c04',
'cache-control' => 'no-cache',
'content-type' => 'application/json'
));
$request->setBody('{
"rate": {
"origin": {
"country": "MX",
"postal_code": "64650",
"province": "NL",
"city": "Monterrey",
"name": null,
"address1": "Av. Rogelio Cantú Gómez 372",
"address2": "",
"address3": null,
"phone": null,
"fax": null,
"address_type": null,
"company_name": null,
"lat": null,
"lng": null
},
"destination": {
"country": "MX",
"postal_code": "66231",
"province": "NL",
"city": "San Pedro Garza García",
"name": "Jason Normore",
"address1": "Rio guadalquivir 422A",
"address2": "del valle",
"address3": null,
"phone": "7097433959",
"fax": null,
"address_type": null,
"company_name": null
},
"items": [
{
"name": "My Product 3",
"sku": null,
"quantity": 1,
"grams": 1000,
"price": 2000,
"vendor": "TestVendor",
"requires_shipping": true,
"taxable": true,
"fulfillment_service": "manual"
}
],
"currency": "MXN"
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
// Response
{
"rates": [
{
"starting_hour": "12:00",
"ending_hour": "12:34",
"total_price": "72.73",
"service_name": "Ultra Express Motorcycle",
"service_code": "EExps",
"vehicle_type": "scooter",
"currency": "MXN",
"subtotal": "62.70"
},
{
"starting_hour": "21:00",
"ending_hour": "21:39",
"total_price": "79.82",
"service_name": "Express CAR",
"service_code": "Exps",
"vehicle_type": "car",
"currency": "MXN",
"subtotal": "68.81"
},
{
"starting_hour": "15:00",
"ending_hour": "20:00",
"total_price": "1042.84",
"service_name": "Express VAN",
"service_code": "Exps",
"vehicle_type": "van",
"currency": "MXN",
"subtotal": "899.00"
}
]
}
// Request
<?php
$request = new HttpRequest();
$request->setUrl('http://54.191.139.107/api/v2/orders');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'postman-token' => '49f17714-18a4-c9c4-2e0a-8e093b109fe8',
'cache-control' => 'no-cache',
'content-type' => 'application/json'
));
$request->setBody('{
"api_key":"abcdefghijk",
"delivery":{
"email":"[email protected]",
"municipality":"San Pedro Garza Garcia",
"name":"Arturo Gomez",
"street_name_and_number":"Rio rosas 101",
"neighborhood":"del valle",
"telephone":"8114689871"
},
"pickup":{
"email":"[email protected]",
"municipality":"San Pedro Garza Garcia",
"name":"skydrop tienda online",
"street_name_and_number":"Rio Guadalquivir 422-A",
"neighborhood":"del valle",
"telephone":"814040 5222"
},
"service":{
"ending_hour":"18:00",
"schedule_date":"2016-08-25",
"service_code":"EExps",
"starting_hour":"16:00",
"vehicle_type":"car"
},
"package":{
"cash_on_delivery":"true",
"cod_amount":"120.40"
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
// Response
{
"ticket": "S111810",
"tracking_url": "http://www.skydrop.com.mx/track/NjEwMTIxMDgyNjA=\n"
}
<?php
// Request
$request = new HttpRequest();
$request->setUrl('http://54.191.139.107/api/v2/orders');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'api_key' => 'abcdefghijk'
));
$request->setHeaders(array(
'postman-token' => 'de845097-fe17-cd5e-6986-90799146ab21',
'cache-control' => 'no-cache',
'content-type' => 'application/json'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
{
"orders": [
{
"id": 1810,
"number": "S111810",
"pick_up_address": "Rio Guadalquivir 422-A, del valle, San Pedro Garza Garcia",
"delivery_address": "Rio rosas 101, del valle, San Pedro Garza Garcia",
"status": "pending",
"reference_number": null,
"reference_type": null,
"service_type": "Ultra Express",
"service_cost": {
"total": 55.5396,
"insurance_comission": 0,
"cod_comission": 0,
"subtotal": 47.879
},
"package": {
"description": "",
"declared_value": 0,
"has_insurance": false,
"cash_on_delivery": true,
"cod_amount": 120.4
},
"estimations": {
"arrive_at_pick_up": null,
"arrive_at_delivery": null
},
"events": {
"assigned_at": null,
"picked_up_at": null,
"delivered_at": null
},
"created_at": "2016-08-25T12:03:00.000-05:00",
"updated_at": "2016-08-25T12:03:00.000-05:00",
"schedule_date": "2016-08-25",
"schedule_start_time": "16-00",
"schedule_end_time": "18-00",
"payment": {
"method": "credit",
"status": "done"
}
}
]
}
<?php
// Request
$request = new HttpRequest();
$request->setUrl('http://54.191.139.107/api/v2/orders/1810');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'api_key' => 'abcdefghijk'
));
$request->setHeaders(array(
'postman-token' => '1c7f4568-6c74-c1b5-e5c3-598dfae31eca',
'cache-control' => 'no-cache',
'content-type' => 'application/json'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
// Response
{
"id": 1810,
"number": "S111810",
"pick_up_address": "Rio Guadalquivir 422-A, del valle, San Pedro Garza Garcia",
"delivery_address": "Rio rosas 101, del valle, San Pedro Garza Garcia",
"status": "pending",
"reference_number": null,
"reference_type": null,
"service_type": "Ultra Express",
"service_cost": {
"total": 55.5396,
"insurance_comission": 0,
"cod_comission": 0,
"subtotal": 47.879
},
"package": {
"description": "",
"declared_value": 0,
"has_insurance": false,
"cash_on_delivery": true,
"cod_amount": 120.4
},
"estimations": {
"arrive_at_pick_up": null,
"arrive_at_delivery": null
},
"events": {
"assigned_at": null,
"picked_up_at": null,
"delivered_at": null
},
"created_at": "2016-08-25T12:03:00.000-05:00",
"updated_at": "2016-08-25T12:03:00.000-05:00",
"schedule_date": "2016-08-25",
"schedule_start_time": "16-00",
"schedule_end_time": "18-00",
"payment": {
"method": "credit",
"status": "done"
}
}