Price Lists
Price lists (tarifas): base cards (TB), factor cards (TBF), discount cards (DTO) and combos (COM), with per-product entries, discount rules and combo conditions.
๐๏ธ Get price list by ID
Returns a single price list including branch schedules, payment method constraints and card types. The response carries an `ETag` header.
๐๏ธ Update price list
Full replacement of an existing price list. Also finalises a draft: the server clears `draft` on every update. `branchSchedules` and `paymentMethodIds` follow the collection contract: null = untouched, [] = clear, non-empty = full replacement.
๐๏ธ Delete price list
Deletes a price list (also used to cancel a draft created by `POST /new`).
๐๏ธ Merge-patch price list
RFC 7396 merge-patch over `application/merge-patch+json`. Send only the fields you want to change; include a field with value `null` to remove it. Use the `If-Match` header for optimistic concurrency control.
๐๏ธ Update price list entry
Updates the value fields of an entry (price, discountPercent, factor, finalPrice, vatIncluded, reference). The target product is immutable.
๐๏ธ Delete price list entry
Deletes one entry (product price or discount rule row).
๐๏ธ Update price list combo condition
Updates name, quantity, price/discount and VAT flags of a combo condition. The purchase/sale side is immutable.
๐๏ธ Delete price list combo condition
Deletes a combo condition. Fails when the condition is referenced by documents already invoiced with the combo.
๐๏ธ List price lists
Returns a paginated list of price lists with envelope `{data, totalCount, skip, limit, hasMore}`. Filter by kind with `priceListType==TB` (TB, TBF, DTO, COM), by side with `forSales==true` and by state with `active==true` / `draft==false`. Limit is capped at 200; skip is clamped to >= 0.
๐๏ธ Create price list
Creates a price list directly in finalised state (no draft phase). Prefer `POST /new` when the creation happens through a form that also attaches entries or combo conditions.
๐๏ธ List price list entries
Paginated entries (per-product prices and discount rules) of one price list. Product entries carry `productId`; discount rules carry `ruleOrder` plus the category/brand/group/campaign scope. Filter rules with `ruleOrder=notnull=''`, combo scope with `comboConditionId==7`.
๐๏ธ Create price list entry
Creates one per-product entry. Requires `productId` and a value: `price` (finalPrice=true), `discountPercent` (finalPrice=false) or `factor` (TBF).
๐๏ธ Bulk-assign price list entries
Set-based price assignment over every product matched by the filters (categories, brands, groups, campaign, price range, description/reference/barcode). Mirrors the legacy 'assign to articles' batch action. Duplicates are de-duplicated server-side. Returns 204 (the operation is set-based; list the entries to see the result).
๐๏ธ Bulk-delete price list entries
Removes every entry matched by the filters (same filter block as the bulk assignment). Returns the number of removed rows.
๐๏ธ Create price list discount rules
Creates one discount rule per combination of the provided category/brand/group lists, optionally scoped to a campaign or a combo condition. Pre-existing rules with the same scope are replaced; the response reports created and removed counts. Rules are listed through `GET /entries?filter=ruleOrder=notnull=''` and removed through `DELETE /discount-rules/{ruleOrder}`.
๐๏ธ List price list combo conditions
Combo conditions of a COM price list: purchase requirements (`purchaseCondition=true`) and applied discounts (`purchaseCondition=false`).
๐๏ธ Create price list combo condition
Adds a combo condition to a COM price list. Requires `purchaseCondition`; the server assigns a default name (Artโยกculo N / Regalo N) when none is provided.
๐๏ธ Create price list draft
PERSISTS a new price list in draft mode (`draft=true`) and returns it with a real `id` รรรถ unlike the non-persisting `/new` of other resources. The row must exist so entries, discount rules and combo conditions can be attached while the form is being filled; the first PUT finalises the draft. Hints: `priceListType` (required รรรถ TB, TBF, DTO or COM), `forSales` (default true), `companyId` (defaults to the user's current company), `copyFromId` (duplicates the source price list including entries and combo conditions), `name`, `code`. Delete the draft with the regular DELETE to cancel.
๐๏ธ Get price list stock valuation
Values the on-hand stock of a branch for every product covered by the price list: units, purchase value, base sale value and the sale value after applying this price list. Mirrors the 'Valoraciโโn' panel of the legacy dialog.
๐๏ธ Delete price list discount rule
Removes the discount rule identified by its `ruleOrder`, optionally scoped to a combo condition via `comboConditionId`.