API Ordini2026-11Anteprima

Spedizioni

Un pacco in viaggio verso il tuo cliente. Il tracciamento torna al negozio da cui è arrivato l’ordine, così il tuo cliente ha notizie da te, non da noi.

L’oggetto Shipment

idstring
Inizia con shp_.
order, fulfillment_orderstring
Cosa contiene.
lanestring
saver o fast.
carrier, tracking_number, tracking_urlstring
Il tracciamento, pronto per il tuo cliente.
weight_ginteger
Quanto pesava il pacco quando lo abbiamo imballato.
shipping_chargedmoney
Spedizione, commissione di gestione e tassa del pacco pesato, in CN¥: ciò che ha pagato il tuo saldo.
pushed_to_channelboolean
Se il negozio da cui è arrivato l’ordine ha il tracciamento. Shopify poi lo invia via email al tuo cliente.
statusstring
in_transit, out_for_delivery, delivered, o exception (trattenuto, restituito, perso).
shipped_at, delivered_atstring|null
Quando è partito da noi, e quando il corriere dice che è arrivato.
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
}

Elenca le spedizioni

GET/v1/shipments

Dal più recente. Filtra per stato per trovare quelli che richiedono la tua azione.

Scopeorders:read

Parametri di query

statusstring
Facoltativo.
orderstring
Facoltativo. Un ID ordine.
shipped_sincestring
Facoltativo. Una data.
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
}

Recupera una spedizione

GET/v1/shipments/{id}

Un pacco, con il suo tracciamento.

Scopeorders:read

Parametri di percorso

idstringobbligatorio
L’ID della spedizione.

Errori

StatoTipoQuando
404not-foundNessuna spedizione simile su questo account.
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
}

Recupera gli eventi di tracciamento

GET/v1/shipments/{id}/tracking

Le scansioni del corriere, dalla più vecchia, in inglese.

Scopeorders:read

Parametri di percorso

idstringobbligatorio
L’ID della spedizione.

Errori

StatoTipoQuando
404not-foundNessuna spedizione simile su questo account.
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"
    }
  ]
}