Skip to content

ffl_woo_sync.woocommerce.condition_backfill

Source: apps/ffl_woo_sync/ffl_woo_sync/woocommerce/condition_backfill.py · 1 endpoint(s)

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

backfill_condition_attributes

POST /api/method/ffl_woo_sync.woocommerce.condition_backfill.backfill_condition_attributes

Auth (derived from code): Roles: System Manager

Re-push ONLY the attributes to existing retail Woo firearm products.

The attributes are Caliber / Condition / Manufacturer / Model.

Fixes stale pa_condition terms after a grade / is_used correction in POS: lean machine pushes never carry attributes, so they never get there on their own. The payload is exactly {"attributes": [...]} per product — name, description, images, price, stock and meta are never sent, and no POS record is written. Products on the shop that were hidden (woo_delisted) or never listed are skipped.

Attributes are authoritative on a PUT: any attribute on the product other than those four is removed. Run with dry_run=1 first. A big run is best done with bench execute rather than over HTTP (it is synchronous).

arg type required default description
serials — no None Serial No names (list, JSON list or comma-separated). Per-serial firearms only; a serial of a uniform-price Item is skipped (name the Item instead).
item_codes — no None Item codes. A uniform-price firearm Item pushes its own product; a per-serial firearm Item expands to its live serials.
dry_run — no 0 1 builds every payload and reports what WOULD be sent, without sending (still reads the store's attribute ids).

Returns: {"pushed": n, "skipped": n, "errors": n, "dry_run": bool, "would_push": n, "skipped_by_reason": {...}, "error_details": [...]} — pushed is products the store accepted; with dry_run it is 0 and would_push counts the products that would be sent.

apps/ffl_woo_sync/ffl_woo_sync/woocommerce/condition_backfill.py:153