MENU navbar-image

Introducción

Para aprovechar todos los beneficios que la API te ofrece, así como para una correcta funcionalidad de la misma, es necesario contar con ciertos requisitos, los cuales son indispensables para realizar solicitudes y respuestas en cualquier punto de venta, aplicaciones móviles o cualquier otro sistema.

Para poder tener acceso a la API y a sus funcionalidades es necesario:

Autenticación

Las credenciales de autenticación son utilizadas para acreditación de todas las llamadas al servidor por medio de la autenticación basada en Bearer token. Para autenticar las solicitudes, incluya un encabezado Authorization con el valor "Bearer {YOUR_AUTH_KEY}".

Genera tu token

POST Login

Se requiere solicitar integración a un representante para poder generar un token valido y vigente.

Example request:
curl --request POST \
    "https://api.expercom.mx/v1/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"[email protected]\",
    \"password\": \"^81fas\"
}"
const url = new URL(
    "https://api.expercom.mx/v1/login"
);

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

let body = {
    "email": "[email protected]",
    "password": "^81fas"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.expercom.mx/v1/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '[email protected]',
            'password' => '^81fas',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.expercom.mx/v1/login'
payload = {
    "email": "[email protected]",
    "password": "^81fas"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request   

POST v1/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

the email of the user. Example: [email protected]

password   string   

the password of the user. Example: ^81fas

Orden de compra

Servicio para la petición o consulta de pedido.

POST Solicitar Pedido

requires authentication

Servicio para la petición de solicitud de un pedido, para la solicitud de pedido es necesario consultar previamente la existencia y precios de los productos con el apoyo de los servicios de productos.

Example request:
curl --request POST \
    "https://api.expercom.mx/v1/order" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"warehouse_id\": 44,
    \"rfc\": \"magnam\",
    \"number_order\": \"consequatur\",
    \"shipping\": {
        \"contact_name\": \"consequatur\",
        \"phone\": \"odit\",
        \"street\": \"illum\",
        \"num_ext\": \"quas\",
        \"num_int\": \"sequi\",
        \"neighborhood\": \"animi\",
        \"city\": \"voluptas\",
        \"state\": \"vel\",
        \"zipcode\": \"esse\"
    },
    \"products\": [
        {
            \"product_id\": \"culpa\",
            \"qty\": 2210659.086953,
            \"price\": 0.883746
        }
    ]
}"
const url = new URL(
    "https://api.expercom.mx/v1/order"
);

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

let body = {
    "warehouse_id": 44,
    "rfc": "magnam",
    "number_order": "consequatur",
    "shipping": {
        "contact_name": "consequatur",
        "phone": "odit",
        "street": "illum",
        "num_ext": "quas",
        "num_int": "sequi",
        "neighborhood": "animi",
        "city": "voluptas",
        "state": "vel",
        "zipcode": "esse"
    },
    "products": [
        {
            "product_id": "culpa",
            "qty": 2210659.086953,
            "price": 0.883746
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.expercom.mx/v1/order',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'warehouse_id' => 44.0,
            'rfc' => 'magnam',
            'number_order' => 'consequatur',
            'shipping' => [
                'contact_name' => 'consequatur',
                'phone' => 'odit',
                'street' => 'illum',
                'num_ext' => 'quas',
                'num_int' => 'sequi',
                'neighborhood' => 'animi',
                'city' => 'voluptas',
                'state' => 'vel',
                'zipcode' => 'esse',
            ],
            'products' => [
                [
                    'product_id' => 'culpa',
                    'qty' => 2210659.086953,
                    'price' => 0.883746,
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.expercom.mx/v1/order'
payload = {
    "warehouse_id": 44,
    "rfc": "magnam",
    "number_order": "consequatur",
    "shipping": {
        "contact_name": "consequatur",
        "phone": "odit",
        "street": "illum",
        "num_ext": "quas",
        "num_int": "sequi",
        "neighborhood": "animi",
        "city": "voluptas",
        "state": "vel",
        "zipcode": "esse"
    },
    "products": [
        {
            "product_id": "culpa",
            "qty": 2210659.086953,
            "price": 0.883746
        }
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request   

POST v1/order

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

warehouse_id   number   

Example: 44

rfc   string   

Example: magnam

number_order   string   

Example: consequatur

shipping   object  optional  
contact_name   string   

Example: consequatur

phone   string   

Example: odit

street   string   

Example: illum

num_ext   string   

Example: quas

num_int   string  optional  

Example: sequi

neighborhood   string   

Example: animi

city   string   

Example: voluptas

state   string   

Example: vel

zipcode   string   

Example: esse

products   object[]  optional  
product_id   string   

Example: culpa

qty   number   

Example: 2210659.086953

price   number   

Example: 0.883746

Productos

Servicios de consulta de información de productos.

GET Productos

requires authentication

Listado completo de productos para la verificacion de existencia y precio.

Example request:
curl --request GET \
    --get "https://api.expercom.mx/v1/products" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.expercom.mx/v1/products"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.expercom.mx/v1/products',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.expercom.mx/v1/products'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 

{
    "message": "Unauthenticated."
}
 

Request   

GET v1/products

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET Producto

requires authentication

Obtener el detalle de un producto

Example request:
curl --request GET \
    --get "https://api.expercom.mx/v1/product/6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.expercom.mx/v1/product/6"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.expercom.mx/v1/product/6',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.expercom.mx/v1/product/6'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 

{
    "message": "Unauthenticated."
}
 

Request   

GET v1/product/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product.* Example: 6