Integra toda tu logística con la API de Shipit

Una poderosa API para automatizar y mejorar la operación de tu eCommerce.

Empieza Ahora    

Suggest Edits

Sobre la API

 

En esta sección podrás entender cómo implementar la API de Shipit, para automatizar y mejorar la logística de tu eCommerce.

Todo consiste en simplificar la operación del día a día aprovechando la tecnología desarrollada por Shipit, para usar multi-couriers, hacer seguimiento de tus envíos y gestionar tu bodega con sólo unos clicks.

La documentación se divide en las siguientes categorías:

  • Envíos: Crear pedidos y consultar información sobre el estado de estos.
  • Cotizador: Consultar precios de envío según sus dimensiones y destino.
  • Inventario: Consultar sobre el stock actual de tu tienda. Sólo para clientes que cuenten con el servicio de Fullfilment de Shipit.
  • Cobertura: Localidades a las cuales Shipit puede despachar.
  • Webhooks: Información para la implementación de webhooks a través de la API de Shipit.
Suggest Edits

Autenticación

Cómo consumir la API de Shipit

 

Para consumir nuestra API es necesario tener:

  • Una cuenta Shipit
  • El correo asociado a la cuenta (X-Shipit-Email)
  • El Token de Acceso obtenido en el módulo de la API en tu cuenta (X-Shipit-Access-Token)

Esta información deberá ser enviada a través del los headers HTTP, para hacer request a los Endpoints de la API.

Content-Type: application/json
X-Shipit-Email: cliente@dominio.cl
X-Shipit-Access-Token: XXXXXXXXXXX
Accept: application/vnd.shipit.v2
Suggest Edits

Respuestas de la API

Posibles respuestas de la API de Shipit.

 
Código
Nombre
Descripción

200

OK

¡Todo funciona con éxito!

201

Creando

Cuando esté creando un nuevo objeto, éste se devolverá con éxito.

400

Solicitud incorrecta

No se pudo realizar la operación.

403

Prohibido

No pudimos autenticarte, o no tienes acceso a este objeto.

Suggest Edits

Crear nuevo envío

Crear uno o varios envíos desde tu tienda.

 
posthttps://api.shipit.cl/v/packages/mass_create
{
  "packages": [
    {
      "reference": "test-api30",
      "full_name": "Dimitri Nock",
      "email": "hola@shipit.cl",
      "items_count": 12,
      "cellphone": "+56990503182",
      "is_payable": false,
      "packing": "Sin empaque",
      "shipping_type": "Sábado",
      "destiny": "Domicilio",
      "courier_for_client": null,
      "approx_size": "Mediano (30x30x30cm)",
      "address_attributes": {
        "commune_id": 12,
        "street": "Nuestra señora de los Ángeles",
        "number": "185",
        "complement": "Oficina E"
      },
      "with_purchase_insurance": true,
      "purchase": {
        "detail": "Ropa",
        "ticket_number": 111111111111,
        "amount": 50000,
        "extra_insurance": true
      },
      
      //Solo si es fulfillment
      "inventory_activity": {
        "inventory_activity_orders_attributes": [
          {"sku_id": 4061, "amount": 1}
        ]
      }
    }
  ]
}
A binary file was returned

You couldn't be authenticated

{
  "packages": [
    {
      "reference": "test-api30",
      "full_name": "Dimitri Nock",
      "email": "hola@shipit.cl",
      "items_count": 12,
      "cellphone": "+56990503182",
      "is_payable": false,
      "packing": "Sin empaque",
      "shipping_type": "Sábado",
      "destiny": "Domicilio",
      "courier_for_client": null,
      "approx_size": "Mediano (30x30x30cm)",
      "address_attributes": {
        "commune_id": 12,
        "street": "Nuestra señora de los Ángeles",
        "number": "185",
        "complement": "Oficina E"
      },
      "with_purchase_insurance": true,
      "purchase": {
        "detail": "Ropa",
        "ticket_number": 111111111111,
        "amount": 50000,
        "extra_insurance": true
      },
      
      //Solo si es fulfillment
      "inventory_activity": {
        "inventory_activity_orders_attributes": [
          {"sku_id": 4061, "amount": 1}
        ]
      }
    }
  ]
}

Body Params

reference
string

ID identificador del pedido

full_name
string

Nombre del destinatario

email
string

Email del destinatario

approx_size
string

Tamaño aproximado del pedido, opciones: - Pequeño (10x10x10cm) - Mediano (30x30x30cm) - Grande (50x50x50cm) - Muy Grande (>60x60x60cm)

packing
string

Empaque que deseas, opciones: - Sin empaque - Caja de Cartón - Film Plástico - Caja + Burbuja - Papel Kraft

items_count
int32

Número de bultos del pedido

cellphone
string

Teléfono del destinatario

courier_for_client
string

Si se desea un Courier de preferencia para el package, se debe especificar aquí, opciones: - Chilexpress - Starken

shipping_type
string

Tipo de envío, opciones: - Normal

destiny
string

Destino del envío, opciones: - Domicilio - Sucursal Chilexpress - Sucursal Starken-Turbus

address_attributes
object
 
is_payable
boolean
with_purchase_insurance
boolean

Activar Seguro

purchase
object
 

Headers

Content-Type
string

application/json

X-Shipit-Email
string

Correo asociado a la cuenta

X-Shipit-Access-Token
string

TOKEN asociado a la cuenta

Accept
string

application/vnd.shipit.v2

 
Suggest Edits

Historial de envíos

Retorna todos los envíos de tu tienda.

 
gethttps://api.shipit.cl/v/packages?year=year&month=month
require 'httparty'
url = 'http://api.shipit.cl/v/packages?year=2017&month=05'
headers = { 'Content-Type': 'application/json', 'Accept': 'application/vnd.shipit.v2', 'X-Shipit-Access-Token': 'TOKEN_API', 'X-Shipit-Email': 'YOUR_EMAIL_API' }

response = HTTParty.get(url, headers: headers )
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

year
string
required

Año del los pedidos (Obligatorio)

month
string
required

Mes de los pedidos (Obligatorio)

 
Suggest Edits

Consultar un envío

Retorna la información de un envío

 
gethttps://api.shipit.cl/v/packages/id
require 'httparty'
url = 'http://api.shipit.cl/v/packages/307829'
headers = { 'Content-Type': 'application/json', 'Accept': 'application/vnd.shipit.v2', 'X-Shipit-Access-Token': 'TOKEN_API', 'X-Shipit-Email': 'YOUR_EMAIL_API' }

response = HTTParty.get(url, headers: headers )
A binary file was returned

You couldn't be authenticated

{
  "packages": [
    {
      "reference": "test-api30",
      "full_name": "Dimitri Nock",
      "email": "hola@shipit.cl",
      "items_count": 12,
      "cellphone": "+56990503182",
      "is_payable": false,
      "packing": "Sin empaque",
      "shipping_type": "Sábado",
      "destiny": "Domicilio",
      "courier_for_client": null,
      "approx_size": "Mediano (30x30x30cm)",
      "address_attributes": {
        "commune_id": 12,
        "street": "Nuestra señora de los Ángeles",
        "number": "185",
        "complement": "Oficina E"
      },
      //Solo si es fulfillment
      "inventory_activity": {
          "inventory_activity_orders_attributes": [
              {"sku_id": 4061, "amount": 1}
          ]
       }
    }
  ]
}

Path Params

id
int32
required

ID del pedido

 
Suggest Edits

Couriers

Retorna todos los couriers disponibles en Shipit

 
gethttps://api.shipit.cl/v/couriers
curl --request GET \
  --url https://api.shipit.cl/v/couriers
var request = require("request");

var options = { method: 'GET', url: 'https://api.shipit.cl/v/couriers' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.shipit.cl/v/couriers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.shipit.cl/v/couriers");

xhr.send(data);
import requests

url = "https://api.shipit.cl/v/couriers"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Consultar precio (Deprecado)

Obtiene todos los precios de referencia de los Couriers. (Este endpoint será deprecado)

 
posthttps://api.shipit.cl/v/shippings/prices
require 'httparty'
url = 'http://api.shipit.cl/v/shippings/prices'
headers = { "Content-Type" => "application/json", "Accept" => "application/vnd.shipit.v2", "X-Shipit-Access-Token" => "YOUR_TOKEN", "X-Shipit-Email" => "YOUR_EMAIL" }
package = {"package":{ "length": "10", "width": "10", "height": "10", "weight": "1", "destiny": "Domicilio", "is_payable": "true", "address_attributes": { "commune_id": 316 }}}



response = HTTParty.post(url, body: package.to_json, headers: headers )


A binary file was returned

You couldn't be authenticated

{"shipments"=>[{"total"=>2552, "courier"=>"correos", "delivery_time"=>"1", "interval"=>"1","pv"=>1.0},{"total"=>2960, "courier"=>"chilexpress", "delivery_time"=>"1", "interval"=>"0..1.5","pv"=>1.0},{"total"=>3271, "courier"=>"starken", "delivery_time"=>"1", "interval"=>"1", "pv"=>1.0}]}

Body Params

height
string
width
string
length
string
weight
string
address_attributes
object
 
 
Suggest Edits

Consultar precio (v3 Estable)

Obtiene todos los precios de referencia de los Couriers. Hemos estado mejorando el API y ésta será la versión a la que estaremos dando soporte.

 
posthttps://api.shipit.cl/v/prices
require 'httparty'
url = 'http://api.shipit.cl/v/prices'

headers = { "Content-Type" => "application/json", "Accept" => "application/vnd.shipit.v3", "X-Shipit-Access-Token" => "YOUR_TOKEN", "X-Shipit-Email" => "YOUR_EMAIL" }

package = {"package":{ "length": "10", "width": "10", "height": "10", "weight": "1", "destiny": "Domicilio", "to_commune_id": "308" }



response = HTTParty.post(url, body: package.to_json, headers: headers )


A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

json
 
Suggest Edits

Consultar SKUs

Consultar cantidad de productos en inventario por SKU.

 
gethttps://api.shipit.cl/v/skus
curl --request GET \
  --url https://api.shipit.cl/v/skus
var request = require("request");

var options = { method: 'GET', url: 'https://api.shipit.cl/v/skus' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.shipit.cl/v/skus")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.shipit.cl/v/skus");

xhr.send(data);
import requests

url = "https://api.shipit.cl/v/skus"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Headers

Content-Type
string
X-Shipit-Email
string
X-Shipit-Access-Token
string
Accept
string
 
Suggest Edits

Consultar SKU

Consultar SKU específico

 
gethttps://api.shipit.cl/v/skus/sku_id
curl --request GET \
  --url https://api.shipit.cl/v/skus/9946
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.shipit.cl/v/skus/9946' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.shipit.cl/v/skus/9946")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.shipit.cl/v/skus/9946");

xhr.send(data);
import requests

url = "https://api.shipit.cl/v/skus/9946"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

sku_id
int32
required

ID del sku en la plataforma shipit

Headers

Content-Type
string
X-Shipit-Email
string
X-Shipit-Access-Token
string
Accept
string
 
Suggest Edits

Consultar SKU por nombre

 
gethttp://api.shipit.cl/v/skus/by_name
curl --request GET \
  --url http://api.shipit.cl/v/skus/by_name
var request = require("request");

var options = { method: 'GET', url: 'http://api.shipit.cl/v/skus/by_name' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://api.shipit.cl/v/skus/by_name")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://api.shipit.cl/v/skus/by_name");

xhr.send(data);
import requests

url = "http://api.shipit.cl/v/skus/by_name"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
   "id": 9265,
   "name": "BOB1",
   "company_id": 1,
   "position": null,
   "description": "SKU de prueba",
   "created_at": "2018-03-15T11:01:37.739-03:00",
   "updated_at": "2018-03-15T11:01:37.739-03:00",
   "warehouse_id": 1,
   "width": 10,
   "length": 10,
   "height": 30,
   "weight": 1,
   "ws_amount": 0,
   "ws_updated_at": null,
   "amount": 36,
   "min_amount": 1,
   "stock": {
       "id": 1832,
       "received": 0,
       "commited": 0,
       "waste": 0,
       "canceled": 0,
       "available": 36,
       "created_at": "2018-05-11T19:54:36.060-03:00",
       "updated_at": "2018-05-11T19:54:36.060-03:00",
       "sku_id": 9265,
       "min_available": 1
   }
}

Query Params

name
string

Headers

Content-Type
string
X-Shipit-Email
string
X-Shipit-Access-Token
string
Accept
string
 

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});
Suggest Edits

Crear nuevas sucursales

 
gethttp://api.shipit.cl/v/branch_offices
{
 "branch_office":
   {
      "name": "Test API BO",
      "contact_name": "Jon Doe",
      "phone": "555-2233312",
      "address": {
        "street": "Asturias",
        "number": "103",
        "complement": "Casa D",
        "commune_id": 318
      },
      "account": {
        "email": "testapibo@shipit.cl",
        "password": "deuxjon",
        "password_confirmation": "deuxjon",
        "person": {
          "first_name": "Jon",
          "last_name": "Doe"
        }
      }
    }
}
A binary file was returned

You couldn't be authenticated

{
   "id": 1666,
   "name": "Test API BO2",
   "run": null,
   "website": null,
   "commercial_business": null,
   "phone": "555-2233312",
   "about": null,
   "email_contact": null,
   "is_active": true,
   "is_default": false,
   "created_at": "2018-06-11T16:02:02.452-04:00",
   "updated_at": "2018-06-11T16:02:02.452-04:00",
   "address_id": 373671,
   "email_notification": null,
   "email_commercial": null,
   "contact_name": "Jon Doe",
   "billing_address_id": null,
   "company_id": 1,
   "google_sheet_link": null,
   "parking_fee": 0,
   "pickup_hope": null,
   "parking_isreachable": null,
   "get_to_parking": null,
   "pickup_price": 2000
}

Headers

Content-Type
string
X-Shipit-Email
string
X-Shipit-Access-Token
string
Accept
string
 
Suggest Edits

Comunas

Retorna todas las comunas de Chile disponibles para enviar

 
gethttps://api.shipit.cl/v/communes
curl --request GET \
  --url https://api.shipit.cl/v/communes
var request = require("request");

var options = { method: 'GET', url: 'https://api.shipit.cl/v/communes' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.shipit.cl/v/communes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.shipit.cl/v/communes");

xhr.send(data);
import requests

url = "https://api.shipit.cl/v/communes"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Headers

Content-Type
string

application/json

X-Shipit-Email
string

Correo asociado a la cuenta

X-Shipit-Access-Token
string

Token asociado a la cuenta

Accept
string

application/vnd.shipit.v2

 
Suggest Edits

Regiones

Retorna todas las regiones de Chile

 
gethttps://api.shipit.cl/v/regions
curl --request GET \
  --url https://api.shipit.cl/v/regions
var request = require("request");

var options = { method: 'GET', url: 'https://api.shipit.cl/v/regions' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.shipit.cl/v/regions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.shipit.cl/v/regions");

xhr.send(data);
import requests

url = "https://api.shipit.cl/v/regions"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Headers

Content-Type
string
X-Shipit-Email
string

Correo asociado a la cuenta

X-Shipit-Access-Token
string

Token asociado a la cuenta

Accept
string

application/vnd.shipit.v2

 
 

Para poder implementar nuestro webhook necesitas indicar una URL en donde recibirás la información. Esto lo podrás encontrar iniciando sesión en tu cuenta y luego ingresando al módulo de la API debes ir abajo a la sección Webhooks.

Nuestro webhook te entregará dos resultados:

  • POST: Cuando creas un pedido, el webhook responderá con POST y la información del package creado.

  • PUT: Cuando se actualiza la información del package. Por ejemplo: se asigna un número de seguimiento a tu envío o se actualizó el estado de pedido.

Suggest Edits

Flujo API Shipit

Caso de uso de implementación de nuestra API

 

A continuación te damos un ejemplo de como utilizar nuestra API para la implementación de una tienda ECommerce