Get Quotation
The shipping quotation endpoint allows you to get a shipping quote for an order. You need to provide the following information:
- Your Rayo JWT Token
- the customer's identification information
- the customer's shipping address
- the items to be included in the order,
- the shipping service to be used (national, scheduled or express). OPTIONAL
Parameter | Description |
---|---|
productos (Array) - Required |
product Array from shopping cart |
cantidad (integer) - Required |
amount of products for indicated “identificador” |
identificador (String) - Required |
identifier to each product (SKU or UPC) |
consumidor_destino (Object) - Required |
consumer shipping information |
calle (String) - Required |
street name |
codigo_postal (String) - Required |
postal code / zip-code |
no_exterior (String) - Required |
house number |
no_interior (String) - Required |
internal number / references |
estado (String) - Required |
State / Province |
ciudad (String) - Required |
City / Municipality |
nombre (String) - Required |
customer name |
telefono (String) - Required |
customer phone number (WhatsApp enabled) |
servicio_rayo (String) - Optional |
quoted service to be used NACIONAL, EXPRESS or PROGRAMADO |
Headers
-
content-type string
POST /api/rest/services
curl \
-X POST cerebro.techrayo.com/api/rest/services \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "content-type: application/json" \
-d '{"productos":[{"cantidad":1,"identificador":"Balon"}],"consumidor_destino":{"calle":"Homero","codigo_postal":"11550","colonia":"Polanco","no_exterior":"930","no_interior":"PB","estado":"CDMX","ciudad":"Miguel Hidalgo","nombre":"Juan Perez","telefono":"3141640364"}}'
Request example
# Headers
content-type: application/json
# Payload
{
"productos": [
{
"cantidad": 1,
"identificador": "Balon"
}
],
"consumidor_destino": {
"calle": "Homero",
"codigo_postal": "11550",
"colonia": "Polanco",
"no_exterior": "930",
"no_interior": "PB",
"estado": "CDMX",
"ciudad": "Miguel Hidalgo",
"nombre": "Juan Perez",
"telefono": "3141640364"
}
}
Request examples
# Headers
content-type: application/json
# Payload
{
"productos": [
{
"cantidad": 1,
"identificador": "Balon"
}
],
"consumidor_destino": {
"calle": "Homero",
"ciudad": "Miguel Hidalgo",
"estado": "CDMX",
"nombre": "Juan Perez",
"colonia": "Polanco",
"telefono": "3141640364",
"no_exterior": "930",
"no_interior": "PB",
"codigo_postal": "11550"
}
}
Response examples (200)
# Headers
Date: Mon, 30 May 2022 15:23:01 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
x-request-id: 02c69365142f7109ae6311103a665f8c
Content-Encoding: gzip
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Server: cloudflare
CF-RAY: 713877ae7e57821a-IAD
# Payload
{
"rayoServiceAvailability": {
"products": [
{
"identifier": "zap-02",
"inStock": 8
}
],
"services": [
{
"days": 5,
"service": "NACIONAL",
"totalPricing": "123.00",
"description": "🚚 Estandar. Entrega estimada de 2 a 5 días hábiles. (Notificaciones por WhatsApp).",
"provider": "ESTAFETA"
}
]
}
}
Response examples (200)
# Headers
Date: Mon, 30 May 2022 15:23:01 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
x-request-id: 02c69365142f7109ae6311103a665f8c
Content-Encoding: gzip
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Server: cloudflare
CF-RAY: 713877ae7e57821a-IAD
# Payload
{}
Response examples (409)
Product not yet created or missing details
# Headers
Date: Mon, 30 May 2022 15:34:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Server: cloudflare
CF-RAY: 713888bf58715d85-IAD
# Payload
{
"path": "$",
"error": "Producto zap-02-2 no tiene dimension, no se puede cotizar",
"code": "ConflictError"
}
# Headers
Date: Mon, 30 May 2022 15:34:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Server: cloudflare
CF-RAY: 713888bf58715d85-IAD
# Payload
{
"path": "$",
"error": "Los integradores de paquetería no pueden proveer servicio al destino deseado.Errors:[{\"name\":\"RAYO BUSINESS ERROR\",\"code\":\"SHP-003\"}] ",
"code": "ConflictError"
}
# Headers
Date: Mon, 30 May 2022 15:34:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Server: cloudflare
CF-RAY: 713888bf58715d85-IAD
# Payload
{
"path": "$",
"error": "No hay stock suficiente del producto <test003> en nuestros almacenes, se requiere solicitar recepción de inventario.",
"code": "ConflictError"
}
Response examples (409)
# Headers
Date: Mon, 30 May 2022 15:34:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Server: cloudflare
CF-RAY: 713888bf58715d85-IAD
# Payload
{}