Skip to content

ffl_woo_sync.woocommerce.fulfillment

Source: apps/ffl_woo_sync/ffl_woo_sync/woocommerce/fulfillment.py · 4 endpoint(s)

Generated by make api-docs — do not edit by hand.

dispose_web_order

POST /api/method/ffl_woo_sync.woocommerce.fulfillment.dispose_web_order

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Dispose the firearms on a paid Woo Online Order (web Dispose action).

No ShipStation push here: the store's own ShipStation WooCommerce plugin creates the shipment. Books one submitted "FFL Transfer" disposition per not-yet-disposed firearm serial; each disposition's own on_submit issues the stock-out and enqueues the FastBound push. No Sales Invoice is created. Idempotent via the {serial, woo_online_order} guard.

Refuses an in-store pickup — an order whose receiving FFL is this store's own licence (FFL Settings.own_ffl_license). There is no far-end dealer to transfer to; the buyer collects at the counter under a retail 4473, and booking it here would write a disposition to ourselves into the bound book.

arg type required default description
woo_online_order string yes — Woo Online Order name (must be Pending Fulfillment).
cr_details — no None Staff verification captured in the dispose dialog for a Type 03 (Curio & Relic) order — see cr_transfer.py. Defaults to None and is only consulted for a C&R order. Dict from Python or JSON string from the browser.
locations — no None Optional {woo_line_id: Storage Location} — where in the store staff took each loose-stock line from (see get_dispose_stock_lines). The units leave that location with the order's delivery; a line left out goes to the "to confirm" list on the Storage Locations page.

Returns: {ok, dispositions: [names], disposed_count, sales_invoice, invoice_status, ...}.

Permissions: Counter roles.

apps/ffl_woo_sync/ffl_woo_sync/woocommerce/fulfillment.py:636

get_dispose_stock_lines

POST /api/method/ffl_woo_sync.woocommerce.fulfillment.get_dispose_stock_lines

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

The loose-stock lines of a web order and where in the store each can be taken

from, for the "where did these come from?" step of Dispose.

arg type required default description
woo_online_order string yes — Woo Online Order name.

Returns: [{line, item_code, item_name, qty, locations: [{location, label, qty}], unassigned, chosen}] -- one per line that ships from the shelf as loose stock. chosen is the location already recorded for the line, or the sole place the item can only have come from (exactly one holds it, none is unassigned).

apps/ffl_woo_sync/ffl_woo_sync/woocommerce/fulfillment.py:589

list_pending_web_orders

POST /api/method/ffl_woo_sync.woocommerce.fulfillment.list_pending_web_orders

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Rows for the Pending Order page: paid Woo Online Orders still awaiting

fulfillment. Shaped to match ffl_core.api.manual_order.list_pending_dispositions so the page renders both sources uniformly (these carry source="woo").

An order POS cannot act on is omitted — no firearm serial row, no procure-to-store leg, nothing left to order from a distributor, and positive proof that no line is a regulated firearm (see the guard in the loop). An order that merely LOOKS actionless because we failed to recognise its firearm line stays listed and is logged.

Returns: Pending-order cards (source="woo"), shaped like list_pending_dispositions rows.

Permissions: Counter roles.

apps/ffl_woo_sync/ffl_woo_sync/woocommerce/fulfillment.py:304

reserved_web_serials

POST /api/method/ffl_woo_sync.woocommerce.fulfillment.reserved_web_serials

Auth (derived from code): Role-filtered: callers without Roles Sales User / Sales Manager / Stock Manager / System Manager receive an EMPTY result instead of an error.

Web-order hold registry for one Item's in-stock serials.

Serials held by a Woo Online Order still in 'Pending Fulfillment': confirmed_serial (kind="woo_assigned") and stock_hold_serial (kind="woo_held"). Drives the 'Pending' pill on the Item form Serial Numbers tab.

arg type required default description
item_code string yes — Item whose in-stock serials to check.

Returns: {serial: {source, ref, kind, tooltip, url}} — only held serials appear.

Permissions: Canonical shipping roles (passive read, same gate as reserved_counter_serials). A caller WITHOUT the role gets an empty {} back silently — no error is raised — so an empty result is not proof of "no holds".

apps/ffl_woo_sync/ffl_woo_sync/woocommerce/fulfillment.py:1022