NAV
bash javascript php python

Overview

Welcome to the BIG SMART API documentation a series of notes and instructions that outline the BIG SMART API and let you tap into BIG SMART platform features as you integrate them with your resources.

The BIG SMART API exposes business functionalities to help developers build integrations with BIG SMART. It provides a simple, predictable, standardised, resource-oriented, RESTful interface with JSON-formatted responses that make it easy to search, filter and use our data.

In order to help developers consume our services we develop language bindings in Shell, Javascript, Php, and Python. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

BIG SMART API base url currently is https://api.bigsmart.mx/ for all resources.

Authentication

APIs for user authentication

Login

Once you have had registered your account, you will be able to get YOUR_AUTH_TOKEN doing a login request through the platform.

Example request:

curl -X POST \
    "http://big.api.test/api/auth/login" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"[email protected]","password":"YXyu2T~,-N(dtS~T"}'
const url = new URL(
    "http://big.api.test/api/auth/login"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "[email protected]",
    "password": "YXyu2T~,-N(dtS~T"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://big.api.test/api/auth/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '[email protected]',
            'password' => 'YXyu2T~,-N(dtS~T',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://big.api.test/api/auth/login'
payload = {
    "email": "[email protected]",
    "password": "YXyu2T~,-N(dtS~T"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJlODhmMjQ5MDlmMzYwM2E5NzI4ZWQ4YzhjN2MyZGY1OWZmZmYwNjAyMjc4MzcyNDRjMjg3YjBlYWYzN2M1MjkwMjUxYWI5Y2FiZTI1MGM5In0.eyJhdWQiOiIxIiwianRpIjoiMmU4OGYyNDkwOWYzNjAzYTk3MjhlZDhjOGM3YzJkZjU5ZmZmZjA2MDIyNzgzNzI0NGMyODdiMGVhZjM3YzUyOTAyNTFhYjljYWJlMjUwYzkiLCJpYXQiOjE1ODAyMzk4MDIsIm5iZiI6MTU4MDIzOTgwMiwiZXhwIjoxNjExODYyMjAyLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.rFVY03HHi9kpqByHILCLUWiJAjn6kw8xzNKvKpTaOOiI67LTNBfgoDbUMfsND_nF7dJHlMTkszZcubz6dGCabexCkBtnEBMqaFxrWZDK1sqC8tJTA6Guqk_Eownh3iEyZTeLH4ZZCaW7DD2Adn5guqBcA98Wx1i2H184hOAU4HJFk47JPq8-4UtWjw6ioyY9qrACmMMM8xoll1PhouR0mpG9JYJh7FtGuWDkcEA9j5sAHGeDM5HnyQUEnArnXE-Xo2DwX7rDVSBkZYuNBj3tpFcOXSOuzwOEluMX1JYkLgSOYnEHYYdC29qJOXqtE5gUstfy7isk82bsOu8TFkoum6xcb0a9jI6oHWSQ8WDn_DZZwteDbmh8tXQUesSEPsBZzisXdLknRe_b5WOZcARMKDz9PDP-jzl5KqpmZXKXbubDITJ7Yt3DWzYrHHYp41GlDpFfrQW_4_MN6ZVhvAvbnawuAY-CsSwogrVUEmXpL_fZwBCTOeAOVDSQ_X4F_7EgQVaiDhjV1wcV_vPu4TDeQthUVP-7aJ25efyBy-fyZKA965axuuPmmGnOjZfq4qoP85YblKJar7EUFbd5xvlT-LjszbbGxPNImbqe-SLnaWWb7pgcleqI14mQRK_3p-MjvU9REX5cEeBd1V1b1i47EOKF3gY81onHhVqkW0VHsbY",
    "token_type": "Bearer",
    "expires_at": "2021-01-28 13:30:02"
}

HTTP Request

POST api/auth/login

Body Parameters

Parameter Type Status Description
email string required Account's email
password string required Account's password

Order management

APIs for managing orders

Create an order


Requires authentication

Example request:

curl -X POST \
    "http://big.api.test/api/orders-external" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
    -d '{"carrier":"BIG","primary_client":"Palacio de Hierro","shipping_method":"car","shipping_option":"next_day","customer_first_name":"Adam","customer_last_name":"Quest","customer_mobile_number":"+525512345678","customer_email":"[email protected]","customer_street":"Orizaba","customer_settlement":"Napoles","customer_external_number":"4155","customer_postcode":"48548","customer_delivery_start_date":"2020-01-10","customer_delivery_end_date":"2020-01-11","purchase_order_number":"8348454192","cod_amount":845,"weight":3.45,"volumetric_dimension":27.12,"cargo_manifest":"CDMX-CLU1","clave_sat": "25173900","descripcion_sat": "Componentes eléctricos","peligroso": "0","clave_material_peligroso": ""}'
const url = new URL(
    "http://big.api.test/api/orders-external"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
};

let body = {
    "carrier": "BIG",
    "primary_client": "Palacio de Hierro",
    "shipping_method": "car",
    "shipping_option": "next_day",
    "customer_first_name": "Adam",
    "customer_last_name": "Quest",
    "customer_mobile_number": "+525512345678",
    "customer_email": "[email protected]",
    "customer_street": "Orizaba",
    "customer_settlement": "Napoles",
    "customer_external_number": "4155",
    "customer_postcode": "48548",
    "customer_delivery_start_date": "2020-01-10",
    "customer_delivery_end_date": "2020-01-11",
    "purchase_order_number": "8348454192",
    "cod_amount": 845,
    "weight": 3.45,
    "volumetric_dimension": 27.12,
    "cargo_manifest": "CDMX-CLU1",
    "clave_sat": "25173900",
    "descripcion_sat": "Componentes eléctricos",
    "peligroso": 0,
    "clave_material_peligroso": ""
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://big.api.test/api/orders-external',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        ],
        'json' => [
            'carrier' => 'BIG',
            'primary_client' => 'Palacio de Hierro',
            'shipping_method' => 'car',
            'shipping_option' => 'next_day',
            'customer_first_name' => 'Adam',
            'customer_last_name' => 'Quest',
            'customer_mobile_number' => '+525512345678',
            'customer_email' => '[email protected]',
            'customer_street' => 'Orizaba',
            'customer_settlement' => 'Napoles',
            'customer_external_number' => '4155',
            'customer_postcode' => '48548',
            'customer_delivery_start_date' => '2020-01-10',
            'customer_delivery_end_date' => '2020-01-11',
            'purchase_order_number' => '8348454192',
            'cod_amount' => 845,
            'weight' => 3.45,
            'volumetric_dimension' => 27.12,
            'cargo_manifest' => 'CDMX-CLU1',
            'clave_sat' => '25173900',
            'descripcion_sat' => 'Componentes eléctricos',
            'peligroso' => 0,
            'clave_material_peligroso' => ''
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://big.api.test/api/orders-external'
payload = {
    "carrier": "BIG",
    "primary_client": "Palacio de Hierro",
    "shipping_method": "car",
    "shipping_option": "next_day",
    "customer_first_name": "Adam",
    "customer_last_name": "Quest",
    "customer_mobile_number": "+525512345678",
    "customer_email": "[email protected]",
    "customer_street": "Orizaba",
    "customer_settlement": "Napoles",
    "customer_external_number": "4155",
    "customer_postcode": "48548",
    "customer_delivery_start_date": "2020-01-10",
    "customer_delivery_end_date": "2020-01-11",
    "purchase_order_number": "8348454192",
    "cod_amount": 845,
    "weight": 3.45,
    "volumetric_dimension": 27.12,
    "cargo_manifest": "CDMX-CLU1",
    "clave_sat": "25173900",
    "descripcion_sat": "Componentes eléctricos",
    "peligroso": 0,
    "clave_material_peligroso": ""
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {YOUR_AUTH_TOKEN}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "data": {
        "id": null,
        "carrier_id": 1,
        "primary_client_id": 1,
        "shipping_method_id": 4,
        "shipping_option_id": 5,
        "current_facility_id": null,
        "current_status_code_id": null,
        "last_mile_facility_id": null,
        "last_mile_cluster_id": null,
        "customer_first_name": "Guido",
        "customer_last_name": "Cole",
        "customer_phone_number": null,
        "customer_mobile_number": "960-807-7875",
        "customer_email": "[email protected]",
        "customer_street": "Isaias Springs",
        "customer_settlement": "Larissa Lock",
        "customer_external_number": "53024",
        "customer_internal_number": null,
        "customer_postcode_id": null,
        "customer_postcode": null,
        "customer_municipality": "furt",
        "customer_city": "South Gerhard",
        "customer_country": "Slovenia",
        "customer_state": "Utah",
        "customer_address_reference": null,
        "latitude": -88.535692,
        "longitude": -11.526903,
        "tracking_number": "94951534-c212-37d3-a43f-1ad7c2921421",
        "alternative_tracking_number": null,
        "purchase_order_number": 3,
        "cod_amount": null,
        "weight": 40.55,
        "volumetric_dimension": 40.24,
        "estimated_delivery_date": "2004-02-21",
        "delivery_deadline_date": null,
        "customer_delivery_start_date": null,
        "customer_delivery_end_date": null,
        "cargo_manifest_id": null,
        "clave_sat": "25173900",
        "descripcion_sat": "Componentes eléctricos",
        "peligroso": "0",
        "clave_material_peligroso": null,
        "delivery_range": null,
        "created_at": null,
        "updated_at": null,
        "deleted_at": null,
        "created_by": null,
        "updated_by": null,
        "deleted_by": null
    }
}

HTTP Request

POST api/orders-external

Body Parameters

Parameter Type Status Description
carrier string required Enity name who will deliver the order
primary_client string required Entity name who register the order
shipping_method string required Method name which will be used to deliver the order
shipping_option string required Option name which will be used to identify the period of time that deliver will long
customer_first_name string required Customer first name
customer_last_name string required Customer last name
customer_mobile_number string required Customer mobile number
customer_email string required Customer email
customer_street string required Customer street name location
customer_settlement string optional Customer settlement name location
customer_external_number string required Customer external number location
customer_postcode string required Customer postcode location
customer_delivery_start_date datetime required Customer delivery start date which will be estimated according to the time period of the shipping option
customer_delivery_end_date datetime optional Customer delivery end date which will be estimated according to the time period of the shipping option
purchase_order_number string required Purchase order number/sequence
cod_amount integer optional Amount of money package recipient have to deliver
weight float optional Package weight
volumetric_dimension float optional Package volumetric dimensions
cargo_manifest string optional Cargo manifest name in case the order is part of one
clave_sat string required SAT keys separated by comma of the articles included in the package
descripcion_sat string required SAT descriptions separated by comma of the articles included in the package
peligroso integer required Value that indicates if the package contains some dangerous article or not. 0 for no dangerous, 1 for dangerous.
clave_material_peligroso string optional SAT keys separated by comma of the dangerous articles included in the package