API Commandes2026-11Aperçu

Envois

Un colis en route vers votre client. Son suivi retourne à la boutique d’origine de la commande : votre client a de vos nouvelles, pas des nôtres.

L’objet Shipment

idstring
Commence par shp_.
order, fulfillment_orderstring
Ce qu’il contient.
lanestring
saver ou fast.
carrier, tracking_number, tracking_urlstring
Le suivi, prêt pour votre client.
weight_ginteger
Le poids du colis à l’emballage.
shipping_chargedmoney
Expédition, frais de préparation et taxe du colis pesé, en CN¥ : ce que votre solde a payé.
pushed_to_channelboolean
Si la boutique d’origine de la commande a le suivi. Shopify l’envoie ensuite par e-mail à votre client.
statusstring
in_transit, out_for_delivery, delivered, ou exception (retenu, retourné, perdu).
shipped_at, delivered_atstring|null
Quand il nous a quittés, et quand le transporteur indique qu’il est arrivé.
shipment
{
  "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
}

Lister les envois

GET/v1/shipments

Les plus récents d’abord. Filtrez par statut pour trouver ceux qui vous attendent.

Scopeorders:read

Paramètres de requête

statusstring
Facultatif.
orderstring
Facultatif. Un identifiant de commande.
shipped_sincestring
Facultatif. Une date.
limit, cursor
Pagination
curl "https://www.ninjabuy.com/api/v1/shipments?status=exception" \
  -H "Authorization: Bearer $NINJABUY_API_KEY" \
  -H "NinjaBuy-Version: 2026-11"
Response 200
HTTP/2 200 OK

{
  "data": [
    {
      "id": "shp_5q1d",
      "order": "ord_3m2b",
      "tracking_number": "YT2630811190042",
      "status": "exception"
    }
  ],
  "has_more": false,
  "cursor": null
}

Récupérer un envoi

GET/v1/shipments/{id}

Un colis, avec son suivi.

Scopeorders:read

Paramètres de chemin

idstringobligatoire
L’identifiant de l’envoi.

Erreurs

StatutTypeQuand
404not-foundAucun envoi de ce type sur ce compte.
curl "https://www.ninjabuy.com/api/v1/shipments/shp_5r8w" \
  -H "Authorization: Bearer $NINJABUY_API_KEY" \
  -H "NinjaBuy-Version: 2026-11"
Response 200
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
}

Récupérer les événements de suivi

GET/v1/shipments/{id}/tracking

Les scans du transporteur, du plus ancien au plus récent, en anglais.

Scopeorders:read

Paramètres de chemin

idstringobligatoire
L’identifiant de l’envoi.

Erreurs

StatutTypeQuand
404not-foundAucun envoi de ce type sur ce compte.
curl "https://www.ninjabuy.com/api/v1/shipments/shp_5r8w/tracking" \
  -H "Authorization: Bearer $NINJABUY_API_KEY" \
  -H "NinjaBuy-Version: 2026-11"
Response 200
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"
    }
  ]
}