Bỏ qua để đến nội dung

Price lists (Vendor)

Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.

Vendor price lists hold retail and wholesale unit prices per catalog SKU on a list. Each list has an type audience: 0 = retail and wholesale, 1 = retail only, 2 = wholesale only (replaces legacy code). POS and wholesale create-order pick lists filtered by sale_channel. Lines are stored in price_list_items with a variant_key so multiple JSON-defined variants (no item_variation_id) do not overwrite each other.

The vendor UI loads lines via GET /vendor/price-lists/:id/items and saves only changed rows with PATCH /vendor/price-lists/:id/items. List headers omit embedded items unless ?include_items=true.


RouteScreen
/dashboard/products/price-listsPrice list index
/dashboard/products/price-lists/:idList detail + items panel

Module product (write for create/edit/items).


Base path: /vendor/price-lists (JWT + VendorModuleGuard).

MethodPathPurpose
GET/:idList header + scopes. Items omitted unless ?include_items=true.
GET/:id/itemsPaginated lines (page, limit, search on product name).
PATCH/:id/itemsPartial upsert: body { items: [...] } — only sent rows are written.
POST/:id/itemsLegacy bulk upsert (avoid for single-product edits).
DELETE/:id/itemsRemove one line or all lines for a product (all_variants).

Each row is unique on:

(price_list_id, item_id, item_variation_id, variant_key)

  • item_variation_id: catalog variation row when present.
  • variant_key: required when item_variation_id is null (e.g. label from product JSON variants like 42@Large). Send on PATCH and DELETE (?variant_key=...).
  1. Load lines: GET .../items?limit=5000 (or paginate).
  2. Edit one product in the UI → PATCH .../items with only that product’s lines, each including variant_key when variation id is null.
  3. Remove a line → DELETE .../items?item_id=&item_variation_id= or ?item_id=&variant_key= for JSON variants.

Migration PriceListItemVariantKey1783531000000 adds variant_key, backfills duplicate legacy groups with legacy-{id}, and replaces unique index UQ_price_list_items_line with UQ_price_list_items_line_v2.

Run backend migrations on each environment before deploying API/UI that depend on variant_key.


  • Catalog and products — products, variations, and price history tabs.
  • POS — resolves cart prices from active lists.