# Outbound — future compatibility

This document sets expectations for **invoicing**, **shipping**, **WMS**, **distributed fulfillment**, **returns**, and **backorders** without weakening integrity rules in sibling sales docs.

---

## Invoicing

- **Invoice** is a **commercial / AR** artifact; it must **reference** fulfilled quantities and shipment ids, not invent stock effects.
- **Expectation:** invoice generation reads **fulfillment + stock facts**; mismatches go to **reconciliation**, not silent invoice edits.

---

## Shipping integrations

- Carrier label purchase and tracking are **async-safe** **after** commit of stock + reservation facts, or behind explicit **pending_shipment** state with repair jobs.
- **Never** mark `fulfilled` on order solely from carrier webhook without local stock/reservation consistency checks.

---

## Pick–pack–ship workflows

- **Pick** may reserve or confirm pick slots per WMS rules; **ship** is the **commit** point for consume + stock_out in strict models.
- Partial picks create **partial reservations** or **partial shipments** with explicit remaining states.

---

## Distributed fulfillment

- Multi-warehouse ship lines: **each** line has its own projection lock and reservation scope; orchestration orders locks **ascending** `(warehouse_id, item_id)` across lines in one transaction when same DB.

---

## Returns

- **Returns** are **inbound** to stock (stock_in or RMA movement) with **reference** to original shipment / order line; they must **not** silently delete outbound movements.
- Reservation **release** may accompany cancel-of-shipment under policy.

---

## Backorders

- **Backorder** = confirmed order line with **zero or partial** reservation until supply; must not show as **allocated** until reservation facts exist.
- When supply arrives, **allocate** uses same idempotency and lock rules as normal outbound.

---

## Critical stance

**Compatibility means composing new features with existing invariants**, not bypassing locks “for integration speed.”
