# Happy path: incoming process

Path: `/guide/incoming`

Incoming goods are based on **Purchase Orders** (`type = purchase_order`) or deliveries.
It is possible to record an unplanned `incoming_goods` receipt without a PO — via the
warehouse app or the API (`document_type: none`) — but the general expectation is to
have a Purchase Order first.

**Requirements:** [Products](/guide/products) and Third Parties (suppliers) already exist
in Pulpo WMS.

**Flow: Incoming: PO → goods receipt → replenishment into storage.**

1. **PO** — Create the purchase order in bulk. Endpoint: `POST /reception/bulk/purchase_orders`

2. **Incoming Orders** — Goods arrive and are received against the PO in the warehouse app.

3. **Replenishment** — Received stock is moved from reception to storage.

4. **GR** — Goods Receipt complete — stock is available. Signalled by purchase_order_finished.

## Endpoints to consume

These are the supplier and order endpoints, created in sequence. They are bulk endpoints,
so you can create multiple elements in one call. See [Products](/guide/products) for
loading master data first.

**Endpoint: Create third parties in bulk** — `POST /iam/bulk/third_parties` (operationId: bulkCreateThirdParties)Create the suppliers (`type = S`) that deliver the goods.

**Endpoint: Create purchase orders in bulk** — `POST /reception/bulk/purchase_orders` (operationId: bulkCreatePurchaseOrders)

Create the purchase order (`type = purchase_order`).

(3PL fulfillers: Requires a Merchant; the Merchant of the product and of the supplier must match the PO. / single merchants: Your single default Merchant is used automatically — no matching to worry about.)

**Endpoint: List purchase orders** — `GET /reception/purchase_orders` (operationId: listPurchaseOrders)

Look up purchase orders by `id`, `order_num`, `warehouse_id`, `state`, `product_sku`, and
more.

**Endpoint: Record a receiving event** — `POST /reception/incoming_goods` (operationId: createIncomingGood)

Normally the warehouse app records receiving against the PO, but this lets you do it
via API instead — including unplanned receipts with `document_type: none` and no PO.

**Endpoint: List incoming-goods (receiving) records** — `GET /reception/incoming_goods` (operationId: listIncomingGoods)

Look up what's actually been booked in at the warehouse — one record per receiving
event, filterable by `purchase_order_id`, `warehouse_id`, `document_type`, and more.

## Events you can subscribe to

**Webhook event:&#x20;**`purchase_order_updated`

Fired whenever a field on the PO changes — a note, delivery date, an item, etc. `state`
reflects whatever it was at the time; this alone doesn't mean anything was received.

Sample payload:

```json
{
  "data": {
    "id": 282362,
    "type": "purchase_order",
    "state": "queue",
    "order_num": "test_delivery_009",
    "warehouse_id": 2236,
    "merchant_id": 1053,
    "merchant_channel_id": null,
    "delivery_date": "2026-09-17T12:13:13",
    "notes": "this is a test note",
    "number_finished_early_events": null,
    "third_party": {
      "id": 3733699,
      "name": "supplier 1",
      "third_type": "S",
      "identifier_number": "43740000_supplier_1",
      "identifier_type": "DNI",
      "merchant_id": 1053,
      "merchant_channel_id": 1068
    },
    "items": [
      {
        "id": 104526,
        "state": "pending",
        "product_id": 9169276,
        "requested_quantity": 133,
        "checked_quantity": 0,
        "product": {
          "id": 9169276,
          "sku": "NP0001",
          "name": "T-Shirt 1",
          "management_type": "none"
        }
      },
      {
        "id": 104528,
        "state": "pending",
        "product_id": 9169280,
        "requested_quantity": 146,
        "checked_quantity": 0,
        "product": {
          "id": 9169280,
          "sku": "LP0002",
          "name": "Drink 2",
          "management_type": "lot"
        }
      }
    ]
  },
  "id": "6b2dcc50-dddd-4f69-8cb9-c1316eb74ba4",
  "status": "triggered",
  "type": "purchase_order_updated",
  "retry": false,
  "inserted_at": "2026-09-17T12:14:40",
  "updated_at": "2026-09-17T12:14:40",
  "warehouse_id": 2236,
  "merchant_id": 1053,
  "merchant_channel_id": 1068,
  "webhook_id": null,
  "merchant_channel_name": "default",
  "merchant_name": "default",
  "warehouse_name": "simon_warehouse_1"
}
```

**Webhook event:&#x20;**`incoming_good_created`

Fired when the warehouse checks items in at the dock against the PO. Each item gets its
own `state` — `accepted` or `rejected` — and rejected items carry `reason_codes` and
often a photo attachment.

Sample payload:

```json
{
  "data": {
    "id": 18559,
    "document_type": "purchase_order",
    "sequence_number": "IG-0000017",
    "warehouse_id": 2236,
    "start_date": "2026-09-17T13:12:18",
    "end_date": "2026-09-17T13:14:47",
    "owner": {
      "id": 4625,
      "username": "simon_user1",
      "first_name": "Lilyan",
      "last_name": "Rogahn"
    },
    "purchase_order": {
      "id": 282447,
      "order_num": "test_delivery_0010",
      "state": "queue"
    },
    "items": [
      {
        "id": 66667,
        "state": "accepted",
        "product_id": 9169277,
        "quantity": 10,
        "destination_location_id": 987070,
        "batch": null,
        "notes": null,
        "product": {
          "id": 9169277,
          "sku": "NP0002",
          "name": "T-Shirt 2",
          "management_type": "none"
        }
      },
      {
        "id": 66668,
        "state": "rejected",
        "product_id": 9169277,
        "quantity": 3,
        "destination_location_id": 987072,
        "batch": null,
        "notes": "packaging_damaged",
        "attachments": [
          {
            "type": "photo",
            "url": "https://s3.eu-central-1.amazonaws.com/pulpo-wms-eu-show-attachments/uploads/2314ea75-15d1-4bf2-9c04-a0660583b86c.jpg"
          }
        ],
        "reason_codes": [
          {
            "id": 198,
            "code": "pulpo_0000001",
            "name": "return"
          }
        ],
        "product": {
          "id": 9169277,
          "sku": "NP0002",
          "name": "T-Shirt 2",
          "management_type": "none"
        }
      },
      {
        "id": 66669,
        "state": "accepted",
        "product_id": 9169281,
        "quantity": 21,
        "destination_location_id": 987070,
        "batch": {
          "id": 210521,
          "type": "lot",
          "number": "654654",
          "expiration_date": "2028-09-17"
        },
        "notes": null,
        "product": {
          "id": 9169281,
          "sku": "LP0003",
          "name": "Drink 3",
          "management_type": "lot"
        }
      }
    ]
  },
  "id": "62fdf462-e2a4-4aa0-a7c3-4fafc4bcfc0d",
  "status": "triggered",
  "type": "incoming_good_created",
  "retry": false,
  "inserted_at": "2026-09-17T13:14:46",
  "updated_at": "2026-09-17T13:14:46",
  "warehouse_id": 2236,
  "merchant_id": 1053,
  "merchant_channel_id": 1068,
  "webhook_id": null,
  "merchant_channel_name": "default",
  "merchant_name": "default",
  "warehouse_name": "simon_warehouse_1"
}
```

**Webhook event:&#x20;**`purchase_order_finished_early`

Fired when the warehouse closes the PO early, before every line is fully received —
`state: "finished_partially"`. Compare `checked_quantity` against `requested_quantity`
per item to see what's short.

Sample payload:

```json
{
  "data": {
    "id": 282362,
    "type": "purchase_order",
    "state": "finished_partially",
    "order_num": "test_delivery_009",
    "warehouse_id": 2236,
    "merchant_id": 1053,
    "merchant_channel_id": null,
    "delivery_date": "2026-09-17T12:13:13",
    "notes": "this is a test note",
    "number_finished_early_events": 1,
    "third_party": {
      "id": 3733699,
      "name": "supplier 1",
      "third_type": "S",
      "identifier_number": "43740000_supplier_1",
      "identifier_type": "DNI",
      "merchant_id": 1053,
      "merchant_channel_id": 1068
    },
    "items": [
      {
        "id": 104526,
        "state": "pending",
        "product_id": 9169276,
        "requested_quantity": 133,
        "checked_quantity": 34,
        "product": {
          "id": 9169276,
          "sku": "NP0001",
          "name": "T-Shirt 1",
          "management_type": "none"
        }
      },
      {
        "id": 104528,
        "state": "pending",
        "product_id": 9169280,
        "requested_quantity": 146,
        "checked_quantity": 36,
        "product": {
          "id": 9169280,
          "sku": "LP0002",
          "name": "Drink 2",
          "management_type": "lot"
        }
      }
    ]
  },
  "id": "4b6a63b0-e944-4347-bbfe-08ef8a5686d8",
  "status": "triggered",
  "type": "purchase_order_finished_early",
  "retry": false,
  "inserted_at": "2026-09-17T12:19:21",
  "updated_at": "2026-09-17T12:19:21",
  "warehouse_id": 2236,
  "merchant_id": 1053,
  "merchant_channel_id": 1068,
  "webhook_id": null,
  "merchant_channel_name": "default",
  "merchant_name": "default",
  "warehouse_name": "simon_warehouse_1"
}
```

**Webhook event:&#x20;**`purchase_order_finished`

Equivalent to a **Goods Receipt** — every item was fully received and `state` is `closed`.

Sample payload:

```json
{
  "data": {
    "id": 282362,
    "type": "purchase_order",
    "state": "closed",
    "order_num": "test_delivery_009",
    "warehouse_id": 2236,
    "merchant_id": 1053,
    "merchant_channel_id": null,
    "delivery_date": "2026-09-17T12:13:13",
    "notes": "this is a test note",
    "number_finished_early_events": 1,
    "third_party": {
      "id": 3733699,
      "name": "supplier 1",
      "third_type": "S",
      "identifier_number": "43740000_supplier_1",
      "identifier_type": "DNI",
      "merchant_id": 1053,
      "merchant_channel_id": 1068
    },
    "items": [
      {
        "id": 104526,
        "state": "received",
        "product_id": 9169276,
        "requested_quantity": 133,
        "checked_quantity": 133,
        "product": {
          "id": 9169276,
          "sku": "NP0001",
          "name": "T-Shirt 1",
          "management_type": "none"
        }
      },
      {
        "id": 104528,
        "state": "received",
        "product_id": 9169280,
        "requested_quantity": 146,
        "checked_quantity": 146,
        "product": {
          "id": 9169280,
          "sku": "LP0002",
          "name": "Drink 2",
          "management_type": "lot"
        }
      }
    ]
  },
  "id": "62294de8-760b-438c-ad6b-3b2b66bab917",
  "status": "triggered",
  "type": "purchase_order_finished",
  "retry": false,
  "inserted_at": "2026-09-17T12:21:32",
  "updated_at": "2026-09-17T12:21:32",
  "warehouse_id": 2236,
  "merchant_id": 1053,
  "merchant_channel_id": 1068,
  "webhook_id": null,
  "merchant_channel_name": "default",
  "merchant_name": "default",
  "warehouse_name": "simon_warehouse_1"
}
```

**Webhook event:&#x20;**`replenishment_order_created`

Fired when accepted stock starts moving from reception into storage. Each item shows the
origin and destination location; `confirmed_quantity` starts at `0`.

Sample payload:

```json
{
  "data": {
    "id": 47715,
    "type": "incoming_goods",
    "state": "queue",
    "sequence_number": "RE-0000024",
    "warehouse_id": 2236,
    "start_date": null,
    "end_date": null,
    "items": [
      {
        "id": 68073,
        "product_id": 9169277,
        "requested_quantity": 10,
        "confirmed_quantity": 0,
        "origin_location_id": 987070,
        "origin_location_type": {
          "name": "Reception Location Type"
        },
        "destination_location_id": 986963,
        "destination_location_type": {
          "name": "Storage Location Type"
        },
        "batches": [],
        "product": {
          "id": 9169277,
          "sku": "NP0002",
          "name": "T-Shirt 2",
          "management_type": "none"
        }
      },
      {
        "id": 68074,
        "product_id": 9169281,
        "requested_quantity": 121,
        "confirmed_quantity": 0,
        "origin_location_id": 987070,
        "origin_location_type": {
          "name": "Reception Location Type"
        },
        "destination_location_id": 986950,
        "destination_location_type": {
          "name": "Storage Location Type"
        },
        "batches": [],
        "product": {
          "id": 9169281,
          "sku": "LP0003",
          "name": "Drink 3",
          "management_type": "lot"
        }
      }
    ]
  },
  "id": "7a919633-5ce0-44b8-9498-f1c4ec40438d",
  "status": "triggered",
  "type": "replenishment_order_created",
  "retry": false,
  "inserted_at": "2026-09-17T13:14:46",
  "updated_at": "2026-09-17T13:14:46",
  "warehouse_id": 2236,
  "merchant_id": 1053,
  "merchant_channel_id": 1068,
  "webhook_id": null,
  "merchant_channel_name": "default",
  "merchant_name": "default",
  "warehouse_name": "simon_warehouse_1"
}
```

**Webhook event:&#x20;**`replenishment_order_finished`

Fired once the stock has landed in storage — `state: "ended"` and `confirmed_quantity`
matches `requested_quantity` on every item. Lot/serial items list which batch they went
into.

Sample payload:

```json
{
  "data": {
    "id": 47715,
    "type": "incoming_goods",
    "state": "ended",
    "sequence_number": "RE-0000024",
    "warehouse_id": 2236,
    "start_date": "2026-09-17T13:19:19",
    "end_date": "2026-09-17T13:21:05",
    "owner": {
      "id": 4625,
      "username": "simon_user1",
      "first_name": "Lilyan",
      "last_name": "Rogahn"
    },
    "items": [
      {
        "id": 68073,
        "product_id": 9169277,
        "requested_quantity": 10,
        "confirmed_quantity": 10,
        "origin_location_id": 987070,
        "origin_location_type": {
          "name": "Reception Location Type"
        },
        "destination_location_id": 986963,
        "destination_location_type": {
          "name": "Storage Location Type"
        },
        "batches": [
          {
            "id": 29067,
            "quantity": 10,
            "batch_id": null,
            "batch": null
          }
        ],
        "product": {
          "id": 9169277,
          "sku": "NP0002",
          "name": "T-Shirt 2",
          "management_type": "none"
        }
      },
      {
        "id": 68074,
        "product_id": 9169281,
        "requested_quantity": 121,
        "confirmed_quantity": 121,
        "origin_location_id": 987070,
        "origin_location_type": {
          "name": "Reception Location Type"
        },
        "destination_location_id": 986950,
        "destination_location_type": {
          "name": "Storage Location Type"
        },
        "batches": [
          {
            "id": 29065,
            "quantity": 100,
            "batch_id": 210522,
            "batch": {
              "id": 210522,
              "number": "6548960548",
              "expiration_date": "2028-09-17"
            }
          },
          {
            "id": 29066,
            "quantity": 21,
            "batch_id": 210521,
            "batch": {
              "id": 210521,
              "number": "654654",
              "expiration_date": "2028-09-17"
            }
          }
        ],
        "product": {
          "id": 9169281,
          "sku": "LP0003",
          "name": "Drink 3",
          "management_type": "lot"
        }
      }
    ]
  },
  "id": "ead08350-d502-4eae-b573-08b1e179256c",
  "status": "triggered",
  "type": "replenishment_order_finished",
  "retry": false,
  "inserted_at": "2026-09-17T13:21:05",
  "updated_at": "2026-09-17T13:21:05",
  "warehouse_id": 2236,
  "merchant_id": 1053,
  "merchant_channel_id": 1068,
  "webhook_id": null,
  "merchant_channel_name": "default",
  "merchant_name": "default",
  "warehouse_name": "simon_warehouse_1"
}
```

> **WARNING: Creating a PO ≠ receiving it**
>
> `POST /reception/bulk/purchase_orders` only *announces* incoming goods.
> The actual receipt happens in the warehouse; watch `purchase_order_finished` to
> know when stock has truly arrived.

---

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