# Shipping Label Provider — overview

Path: `/label-provider/overview`
Summary: The end-to-end label provider integration flow

This track is for an **external label or carrier provider** integrating label generation
into Pulpo's packing flow. When an external system generates shipping labels (a carrier API
or a label service), Pulpo emits packing events, waits for your label, and attaches it to
the box.

> **NOTE: Who this is for**
>
> The main guide targets the *fulfiller*. This track targets the *label provider*:
> you receive packing webhooks, generate a label, and push it back to Pulpo via the
> shipment-tracking and attach endpoints.

## The end-to-end flow

**Flow: From sales order to attached label to return. Click a stage for the call it maps to.**

1. **Sales Orders** — Orders are created in bulk (POST /sales/bulk/orders). Endpoint: `POST /sales/bulk/orders`

2. **Order Update** — Webhooks: sales_order_created, sales_order_finished, sales_order_cancelled.

3. **Picking** — Items are picked.

4. **Packing** — Boxes are closed. Webhook: packing_order_finished AND turbo_label_packing_created (or packing_box_closed AND turbo_label_packing_created).

5. **Shipment tracking** — Set status pulpowms_label_generation_started, generate the label, then attach it. Endpoint: `PUT /packing/orders/{packing_order_id}/boxes/{box_id}/shipment_tracking/{tracking_id}`

6. **Attach label** — Upload the label PDF to the box. Endpoint: `POST /packing/orders/{packing_order_id}/boxes/{box_id}/attach`

7. **Tracking updated** — Set status pulpowms_label_generated; webhook shipment_tracking_updated fires.

8. **Return** — Returns via POST /reception/bulk/purchase_orders (type return). Endpoint: `POST /reception/bulk/purchase_orders`

## The label lifecycle, step by step

1. **Subscribe** to `packing_box_closed` (or `packing_order_finished`) **and**
   `turbo_label_packing_created`.
2. **Receive** the packing webhook → extract `packing_order_id`, `box_id`,
   `shipment_tracking.id`.
3. **`PUT …/shipment_tracking/{tracking_id}`** → set status
   `pulpowms_label_generation_started`.
4. **Generate** the label in your system using the order / box data.
5. **`POST …/boxes/{box_id}/attach`** → upload the label PDF.
6. **`PUT …/shipment_tracking/{tracking_id}`** → set status `pulpowms_label_generated`
   with `tracking_code`, `tracking_url`, `carrier_code`.
7. **Webhook `shipment_tracking_updated`** fires, confirming the label is attached — use it
   to notify the end customer (SMS, email, push…).

> **WARNING: You have \~2 minutes**
>
> The `turbo_label_packing_created` webhook is what signals Pulpo expects an external label.
> Without it, the packing events are informational only. After a box closes, the Pulpo app
> waits **up to 2 minutes** for the label; if none arrives, the packer must wait
> or skip.

Continue to the [packing webhooks](/label-provider/webhooks) for the exact payloads, then
the [shipment tracking & labels](/label-provider/shipment-tracking) endpoints.

---

Website version: https://connect.pulpo.co/label-provider/overview
Whole guide in one file: https://connect.pulpo.co/llms-full.txt
Index of all pages: https://connect.pulpo.co/llms.txt
