Promotions and previous price
Put products and packs on offer with dates and channels. Reads expose the offer and the legal previous price, and price resolution takes a date, a channel and the customer of the web.
Promotions are now part of the public contract. They are available on every plan that includes products, from Esencial.
- A new
promotionsresource creates offers with items, dates and channels (documentsandweb), with their own scopespromotions:read,promotions:writeandpromotions:delete. - Reading products and packs always includes
promotion(the offer ornull) withlabel,previous_price,reduction_percentandannounce_reduction. price-lists/resolveandprice-lists/resolve-manytakedate,channelandclient_id. The price list is chosen as in a document: aprice_list_idwins (nullmeans no price list), otherwise the default price list of the customer applies, and an inactive one answers 422.- Every resolved price carries
regular_unit_price,regular_sourceandpromotion(nullwhen none applies). Thegrossamounts use the VAT of the item and the regime of the company. For the exact amount, including the customer's equivalence surcharge or exemption, use the totals calculation. - The price breakdown of a pack takes
client_idandchannel, and returns the offer of the pack with its regular price. - Price lists and their prices accept the
updated[gte]andupdated[lte]filters. Theupdated_atof a price list also moves when one of its prices changes. - Document lines take
sold_onandchannel, so that an offer only for the web reaches the invoice of the order. A web sale charged at the offer price counts as sold with the offer. - PDF templates add the option
show_regular_price, which prints the regular price and the rebate under the concept of a line sold with an offer.
Read Promotions and previous price and Your store with Factuarea.
Events
| Event | Change |
|---|---|
promotion.created, promotion.updated, promotion.started, promotion.ended and promotion.cancelled | New, with the promotion |
promotion.deleted | New, with {id, object: "promotion", deleted: true} |
price_list.created, price_list.updated and price_list.item_updated | New, with the price list or the price. Use them to refresh a cache of prices |
price_list.deleted and price_list.item_deleted | New, with {id, object, deleted: true}. The price carries its price_list_id |
product.updated and pack.updated | Also when an offer starts or ends |
New errors: promotion_not_found, promotion_started, promotion_read_only,
invalid_promotion_item and duplicate_promotion_item. The MCP server adds
list_promotions, get_promotion, create_promotion, update_promotion,
cancel_promotion and delete_promotion, and resolve_catalog_price and
resolve_many_catalog_prices take client_id.
New endpoints6
| Endpoint | Description |
|---|---|
GET/v1/companies/{company}/promotions | List all promotions |
POST/v1/companies/{company}/promotions | Create a promotion |
GET/v1/companies/{company}/promotions/{promotion} | Retrieve a promotion |
PATCH/v1/companies/{company}/promotions/{promotion} | Update a promotion |
DEL/v1/companies/{company}/promotions/{promotion} | Delete a promotion |
POST/v1/companies/{company}/promotions/{promotion}/cancel | Cancel a promotion |