# Use webhooks and tracking updates
URL: https://support.starshipit.com/articles/14700000001008-use-webhooks-and-tracking-updates
Canonical: https://support.starshipit.com/articles/14700000001008-use-webhooks-and-tracking-updates
Markdown: https://support.starshipit.com/articles/14700000001008-use-webhooks-and-tracking-updates.md
Updated: 2026-11-20

> For the complete documentation index, see [llms.txt](https://support.starshipit.com/llms.txt).

> Use Starshipit webhooks and tracking lookups to keep another system updated after labels are created.

Use webhooks to pass shipment and tracking updates to another system. Use tracking lookups to reconcile orders or to get updates when your system cannot accept callbacks.

## Choose webhook or polling

| Approach | Use when | Trade-off |
| --- | --- | --- |
| Webhooks | Your system can receive inbound HTTP requests | Faster updates, but you need reliable receiving, retries, and deduplication. |
| Polling | Your system cannot receive webhooks or needs scheduled reconciliation | Simpler infrastructure, but updates are less immediate and request volume is higher. |
| Hybrid | You want real-time updates plus a safety net | Webhooks handle normal updates and polling catches missed events. |

## Recommended webhook workflow

1. Set up your receiver to accept JSON requests and return `200 OK` promptly after acceptance.
2. Follow [Send tracking updates with webhooks](/articles/360000376436-send-tracking-updates-with-webhooks#set-up-the-notification-endpoint) to save the receiver URL and, if required, a shared secret.
3. Leave **Send in the background** selected for normal delivery. In UI 2.0, choose **Send before returning the label** only if your workflow needs the outbound `Printed` event sooner.
4. Create an outbound label for a test order and confirm the receiver records the correct order number, tracking number and status.

Use a public HTTP or HTTPS URL. Starshipit checks the destination when you save or test the endpoint and when it sends an event. Use the final URL because redirects are unavailable. The response limit is 64 KiB. Background delivery has a five-second timeout. The print-time attempt has a two-second timeout.

If the print-time attempt fails or times out, Starshipit returns the label and tries the `Printed` update in the background. Use the receiving system's event record to confirm receipt before triggering a dependent workflow.

## Supported webhook data

Starshipit webhooks are tracking and shipment notification events. Payloads include order, carrier, tracking, and status fields.

| Field | Type | Description |
| --- | --- | --- |
| `order_number` | string | The order number from the source ecommerce platform or integration. |
| `order_reference` | string | The reference saved on the order, when present. |
| `carrier_name` | string | The courier used for the shipment. |
| `carrier_service` | string | The courier service used for the shipment. |
| `shipment_date` | datetime | The local date when the label was generated. |
| `tracking_number` | string | The courier tracking number. |
| `tracking_status` | string | The latest tracking status from Starshipit or the courier. |
| `last_updated_date` | datetime | The latest tracking update timestamp. |

Supported tracking statuses include `Printed`, `Dispatched`, `InTransit`, `OutForDelivery`, `Delivered`, `PickupInStore`, `AttemptedDelivery`, `Exception`, `AwaitingCollection`, `Cancelled`, `Manifested`, `ReturnPickupPrinted`, `ReturnDropoffPrinted`, `DroppedOff`, `ReturnLink`, and `ReturnLabel`.

## Recommended polling workflow

1. Store the Starshipit order ID or order number when you create or import the order.
2. Query the relevant order or tracking endpoint on a schedule.
3. Update only records that changed since your last successful sync.
4. Back off when you receive rate-limit responses.
5. Run a periodic reconciliation job for recently shipped orders.

## Endpoint map

[Open the Starshipit API reference](/developers/api-reference/starshipit#tracking) for tracking request fields and response models.

| Step | Endpoint | Use it to |
| --- | --- | --- |
| Receive webhooks | `POST /callback/` | Accept tracking updates from Starshipit at your configured endpoint. |
| Poll tracking | [GET /api/track](/developers/api-reference/starshipit#endpoint-tracking-get-api-track-tracking) | Reconcile tracking status when webhooks are unavailable or missed. |
| List printed shipments | [GET /api/orders/shipments?status=recently_printed](/developers/api-reference/starshipit#endpoint-orders-get-api-orders-shipments-status-recently-printed-list-orders-printed-or-unmanifested) | Find recently printed or unmanifested shipments. |
| List shipped orders | [GET /api/orders/shipped](/developers/api-reference/starshipit#endpoint-orders-get-api-orders-shipped-list-orders-shipped) | Reconcile source-system shipment status. |

## Expected receiver behaviour

1. Read the raw request body.
2. If you configured a secret, validate the `X-Starshipit-Signature` header against the raw body. See [signature verification examples](/articles/360000376436-send-tracking-updates-with-webhooks#optional-securing-webhooks).
3. Parse the JSON and check the payload shape and required identifiers.
4. Store the raw event or a normalised event record.
5. Return `200` as soon as the event is accepted for processing.
6. Process long-running source-system updates outside the request path.
7. Ignore duplicate events that have already been processed.

## Example payload

```json
{
  "order_number": "API-TEST-1001",
  "carrier_name": "Australia Post",
  "carrier_service": "7B05",
  "shipment_date": "2026-06-18T09:30:00Z",
  "tracking_number": "TESTTRACK123",
  "tracking_status": "Dispatched",
  "last_updated_date": "2026-06-18T09:35:00Z"
}
```

## Design for retries and duplicates

A receiver can process a request before Starshipit receives its response. Treat a second delivery of the same event as a retry so you avoid duplicate fulfilment updates, emails and order notes.

For both webhooks and polling, log:

- Event or request timestamp.
- Source order number.
- Starshipit order ID, if available.
- Tracking number.
- Carrier and service.
- Processing result.

Good idempotency keys include:

- A stored event ID if your receiver creates one.
- `order_number`, `tracking_number`, `tracking_status`, and `last_updated_date`.
- The source order ID plus the final tracking status your system stores.

## Failure handling

| Failure | Recommended handling |
| --- | --- |
| Receiver cannot parse JSON | Return a non-success response and log the raw body safely. |
| Source order cannot be found | Store the event for manual matching or scheduled reconciliation. |
| Source system is unavailable | Queue the event and retry from your own job processor. |
| Duplicate event | Return success and do not repeat downstream side effects. |

## Verify tracking updates

Create a test order, generate a label, and confirm the source system receives the tracking number and status you expect. Then resend or replay the same event to confirm duplicate handling works.

## Related guides

- [Send tracking updates with webhooks](/articles/360000376436-send-tracking-updates-with-webhooks)
- [Starshipit API fundamentals](/articles/developer-center/starshipit-api/api-fundamentals)
- [Testing guidance](/articles/developer-center/getting-started/testing-guidance)
- [Starshipit API reference](/developers/api-reference/starshipit#tracking)
