API de pedidos2026-11Vista previa
Envíos
Un paquete en camino a tu cliente. Su seguimiento vuelve a la tienda de la que vino el pedido, así que tu cliente sabe de ti, no de nosotros.
order.shipped se dispara cuando se crea un envío, con su seguimiento.
El objeto Shipment
idstring- Empieza por shp_.
order, fulfillment_orderstring- Lo que lleva.
lanestring- saver o fast.
carrier, tracking_number, tracking_urlstring- Seguimiento, listo para tu cliente.
weight_ginteger- Lo que pesó el paquete cuando lo empacamos.
shipping_chargedmoney- Envío, tarifa de manipulación e impuesto del paquete pesado, en CN¥: lo que pagó tu saldo.
pushed_to_channelboolean- Si la tienda de la que vino el pedido tiene el seguimiento. Luego Shopify se lo envía por correo a tu cliente.
statusstring- in_transit, out_for_delivery, delivered, o exception (retenido, devuelto, perdido).
shipped_at, delivered_atstring|null- Cuándo salió de nuestras manos, y cuándo indica el transportista que llegó.
{
"id": "shp_5r8w",
"order": "ord_3n7q",
"fulfillment_order": "fo_7k2m",
"lane": "saver",
"carrier": "YunExpress",
"tracking_number": "YT2630812345678",
"tracking_url": "https://t.17track.net/en#nums=YT2630812345678",
"weight_g": 176,
"shipping_charged": { "amount": "134.52", "currency": "CNY" },
"pushed_to_channel": true,
"status": "in_transit",
"shipped_at": "2026-11-03T06:00:00Z",
"delivered_at": null
}Listar envíos
GET/v1/shipments
Lo más reciente primero. Filtra por estado para encontrar los que requieren tu acción.
Alcanceorders:read
Parámetros de consulta
statusstring- Opcional.
orderstring- Opcional. Un id de pedido.
shipped_sincestring- Opcional. Una hora.
limit, cursor- Pagination
curl "https://www.ninjabuy.com/api/v1/shipments?status=exception" \
-H "Authorization: Bearer $NINJABUY_API_KEY" \
-H "NinjaBuy-Version: 2026-11"HTTP/2 200 OK
{
"data": [
{
"id": "shp_5q1d",
"order": "ord_3m2b",
"tracking_number": "YT2630811190042",
"status": "exception"
}
],
"has_more": false,
"cursor": null
}Obtener un envío
GET/v1/shipments/{id}
Un paquete, con su seguimiento.
Alcanceorders:read
Parámetros de ruta
idstringobligatorio- El id del envío.
Errores
| Estado | Tipo | Cuándo |
|---|---|---|
| 404 | not-found | No existe ese envío en esta cuenta. |
curl "https://www.ninjabuy.com/api/v1/shipments/shp_5r8w" \
-H "Authorization: Bearer $NINJABUY_API_KEY" \
-H "NinjaBuy-Version: 2026-11"HTTP/2 200 OK
{
"id": "shp_5r8w",
"order": "ord_3n7q",
"fulfillment_order": "fo_7k2m",
"lane": "saver",
"carrier": "YunExpress",
"tracking_number": "YT2630812345678",
"tracking_url": "https://t.17track.net/en#nums=YT2630812345678",
"weight_g": 176,
"shipping_charged": { "amount": "134.52", "currency": "CNY" },
"pushed_to_channel": true,
"status": "in_transit",
"shipped_at": "2026-11-03T06:00:00Z",
"delivered_at": null
}Obtener los eventos de seguimiento
GET/v1/shipments/{id}/tracking
Los escaneos del transportista, del más antiguo al más reciente, en inglés.
Alcanceorders:read
Parámetros de ruta
idstringobligatorio- El id del envío.
Errores
| Estado | Tipo | Cuándo |
|---|---|---|
| 404 | not-found | No existe ese envío en esta cuenta. |
curl "https://www.ninjabuy.com/api/v1/shipments/shp_5r8w/tracking" \
-H "Authorization: Bearer $NINJABUY_API_KEY" \
-H "NinjaBuy-Version: 2026-11"HTTP/2 200 OK
{
"shipment": "shp_5r8w",
"status": "in_transit",
"events": [
{
"at": "2026-11-03T06:00:00Z",
"where": "Shenzhen, CN",
"status": "in_transit",
"description": "Left the NinjaBuy warehouse"
},
{
"at": "2026-11-05T22:10:00Z",
"where": "Shenzhen, CN",
"status": "in_transit",
"description": "Departed the origin country"
},
{
"at": "2026-11-09T19:40:00Z",
"where": "Los Angeles, US",
"status": "in_transit",
"description": "Arrived in the destination country"
}
]
}