###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: [YOUR_API_KEY]
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 |
// Request
var request = require("request");
var options = { method: 'POST',
url: 'http://54.191.139.107/api/v2/shipping_rates',
headers: { 'content-type' : 'application/json' },
body:
{ 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' } },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
// Response
{
"rates": [
{
"currency": "MXN",
"service_name": "Express",
"service_code": "EExps",
"min_delivery_time": "2017-01-05T15:54:30.239-06:00",
"max_delivery_time": "2017-01-05T16:49:30.239-06:00",
"total_price": "67.91",
"vehicle_type": "scooter",
"starting_hour": "15:23",
"ending_hour": "16:34"
},
{
"currency": "MXN",
"service_name": "Express",
"service_code": "EExps",
"min_delivery_time": "2017-01-05T16:06:30.251-06:00",
"max_delivery_time": "2017-01-05T17:01:30.251-06:00",
"total_price": "142.30",
"vehicle_type": "car",
"starting_hour": "15:28",
"ending_hour": "17:01"
},
{
"currency": "MXN",
"service_name": "Mismo Día",
"service_code": "Hoy",
"min_delivery_time": "2017-01-05T22:00:00.000-06:00",
"max_delivery_time": "2017-01-05T22:00:00.000-06:00",
"total_price": "67.91",
"vehicle_type": "scooter",
"starting_hour": "10:00",
"ending_hour": "22:00"
},
{
"currency": "MXN",
"service_name": "Mismo Día",
"service_code": "Hoy",
"min_delivery_time": "2017-01-05T22:00:00.000-06:00",
"max_delivery_time": "2017-01-05T22:00:00.000-06:00",
"total_price": "109.46",
"vehicle_type": "car",
"starting_hour": "10:00",
"ending_hour": "22:00"
},
{
"currency": "MXN",
"service_name": "Siguiente día",
"service_code": "next_day",
"min_delivery_time": "2017-01-05T22:00:00.000-06:00",
"max_delivery_time": "2017-01-05T22:00:00.000-06:00",
"total_price": "67.91",
"vehicle_type": "scooter",
"starting_hour": "10:00",
"ending_hour": "22:00"
},
{
"currency": "MXN",
"service_name": "Siguiente día",
"service_code": "next_day",
"min_delivery_time": "2017-01-05T22:00:00.000-06:00",
"max_delivery_time": "2017-01-05T22:00:00.000-06:00",
"total_price": "109.46",
"vehicle_type": "car",
"starting_hour": "10:00",
"ending_hour": "22:00"
},
{
"currency": "MXN",
"service_name": "Siguiente día",
"service_code": "next_day",
"min_delivery_time": "2017-01-05T22:00:00.000-06:00",
"max_delivery_time": "2017-01-05T22:00:00.000-06:00",
"total_price": "899.00",
"vehicle_type": "truck",
"starting_hour": "10:00",
"ending_hour": "22:00"
}
]
}
// Request
var request = require("request");
var options = { method: 'POST',
url: 'http://54.191.139.107/api/v2/orders',
headers:{ 'content-type': 'application/json' },
body:
{ api_key: '[YOUR_API_KEY]',
delivery:
{ email: '[email protected]',
municipality: 'San Pedro Garza Garcia',
name: 'John Doe',
street_name_and_number: 'Rio rosas 101',
neighborhood: 'del valle',
telephone: '8114567891' },
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: '123456 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' } },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
// Response
{
"ticket": "S112321",
"tracking_url": "http://www.skydrop.com.mx/track/NjEwMTIxNDg0NzM=",
"schedule_date": "2016-08-25"
}
// Request
var request = require("request");
var options = { method: 'GET',
url: 'http://54.191.139.107/api/v2/orders',
qs: { api_key: '[YOUR_API_KEY]' }
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"orders": [
{
"id": 2321,
"number": "S112321",
"pickup_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
},
"courier": {
"vehicle_type": "Ultra Express",
"tracking_url": "http://www.skydrop.com.mx/track/NjEwMTIxNDg0NzM="
},
"estimations": {
"arrive_at_pick_up": "",
"arrive_at_delivery": ""
},
"events": {
"assigned_at": "",
"picked_up_at": "",
"delivered_at": ""
},
"created_at": "2017-01-05 15:33",
"updated_at": "2017-01-05 15:33",
"schedule_date": "2016-08-25",
"schedule_start_time": "16-00",
"schedule_end_time": "18-00"
}
]
}
// Request
var request = require("request");
var options = { method: 'GET',
url: 'http://54.191.139.107/api/v2/orders/1810',
qs: { api_key: '[YOUR_API_KEY]' }
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
// Response
{
"id": 1810,
"number": "S111810",
"pickup_address": "Rio Guadalquivir 422-A, del valle, San Pedro Garza Garcia",
"delivery_address": "Rio rosas 101, del valle, San Pedro Garza Garcia",
"status": "cancelled",
"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
},
"courier": {
"vehicle_type": "Ultra Express",
"tracking_url": "http://www.skydrop.com.mx/track/NjEwMTIxMDgyNjA="
},
"estimations": {
"arrive_at_pick_up": "",
"arrive_at_delivery": ""
},
"events": {
"assigned_at": "",
"picked_up_at": "",
"delivered_at": ""
},
"created_at": "2016-08-25 12:03",
"updated_at": "2016-08-25 12:03",
"schedule_date": "2016-08-25",
"schedule_start_time": "16-00",
"schedule_end_time": "18-00"
}