Логотип Commerce Pricing And Promotions

Commerce Pricing And Promotions

Спільнота
PranavNagrecha
commerce-pricing-and-promotions

Configure pricebooks, tiered pricing, promotions, coupon codes, and cart discounts for B2B or D2C Commerce stores. Trigger keywords: WebStorePricebook, BuyerGroupPricebook, PriceAdjustmentSchedule, PromotionsCartCalculator, commerce coupon, cart-level discount, tiered price, Commerce promotion. NOT for Sales Cloud pricebooks and PricebookEntry - use admin/products-and-pricebooks. NOT for CPQ quote pricing and discount schedules - use admin/cpq-pricing-rules.

Огляд

ВидавецьPranavNagrecha
РепозиторійAwesomeSalesforceSkills
Назва навичкиcommerce-pricing-and-promotions
Зірки
26
Форки
5
Файли в пакеті
6
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 6

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: PranavNagrecha. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Commerce Pricing And Promotions у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/commerce-pricing-and-promotions
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PranavNagrecha/AwesomeSalesforceSkills.git /tmp/AwesomeSalesforceSkills
mkdir -p .claude/skills
cp -r /tmp/AwesomeSalesforceSkills/skills/admin/commerce-pricing-and-promotions .claude/skills/commerce-pricing-and-promotions
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Commerce Pricing And Promotions в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Commerce Pricing And Promotions, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Commerce Pricing And Promotions не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Commerce Pricing and Promotions

This skill activates when a practitioner needs to configure pricebook assignment, tiered pricing, or promotions (including coupons and cart-level discounts) for a Salesforce B2B or D2C Commerce store. It covers the full pricing resolution stack — from pricebook attachment through discount application at checkout — and explains all silent-failure limits that cause real production bugs.


Before Starting

Gather this context before working on anything in this domain:

  • Store type and Id: B2B and D2C stores share the same pricing objects but differ in guest-buyer access patterns. Retrieve the WebStore.Id first.
  • Pricebook resolution limit: The price engine evaluates at most 25 pricebooks per API call. Pricebooks ranked beyond 25 are silently excluded — no error is raised. Count assigned pricebooks before adding new ones.
  • Promotions do not self-apply: Activating a Promotion record does not automatically apply discounts at checkout. The checkout flow must include the PromotionsCartCalculator subflow. Confirm this before debugging "promotion not working" reports.
  • API version floor: PriceAdjustmentSchedule (tiered pricing parent) requires API v60.0+. PriceAdjustmentTier requires API v47.0+. Verify the org's API version before deploying tiered pricing metadata.

Core Concepts

1. Pricebook Attachment via Junction Objects

Commerce stores do not use the standard Sales Cloud Pricebook2Id field on Account or Opportunity. Two dedicated junction objects control pricebook visibility:

  • WebStorePricebook — links a Pricebook2 to a WebStore. Maximum 5 pricebooks per store. This is the platform hard limit; the 6th record raises a validation error.
  • BuyerGroupPricebook — links a Pricebook2 to a BuyerGroup. Maximum 50 pricebooks per BuyerGroup and 100 BuyerGroups per pricebook.

During price resolution, the engine collects all pricebooks visible to the buyer (via their BuyerGroup memberships and the store's WebStorePricebook assignments), ranks them by the Priority field on the junction record, then evaluates at most 25 pricebooks. Pricebooks ranked 26th or higher are silently skipped — no error, no log entry.

2. Tiered Pricing with PriceAdjustmentSchedule

Tiered pricing (quantity-based price breaks) uses two objects linked to a PricebookEntry:

  • PriceAdjustmentSchedule (API v60.0+) — the parent record that defines the adjustment method (Percent, Amount, or Price) and the associated PricebookEntry.
  • PriceAdjustmentTier (API v47.0+) — child records on the schedule, each defining a LowerBound, optional UpperBound, and the adjustment value.

The engine applies the matching tier at add-to-cart time. If no tier matches (e.g., quantity falls outside all defined bounds), the base PricebookEntry.UnitPrice is used without adjustment.

3. Promotions, Segments, and the Checkout Flow Requirement

A Promotion record activates a discount but does nothing by itself. The full promotion execution stack is:

  1. Promotion — defines the discount type, priority, start/end dates, and whether it is automatic or coupon-gated.
  2. PromotionSegmentSalesStore — scopes the promotion to a specific WebStore.
  3. PromotionSegmentBuyerGroup — further scopes the promotion to a specific BuyerGroup (optional; omit for store-wide promotions).
  4. PromotionCode — links a coupon code string to the promotion (only for coupon-gated promotions).
  5. Checkout flow with PromotionsCartCalculator subflow — at checkout, the platform's evaluate API runs all applicable automatic promotions (up to 50) and all applied manual/coupon promotions (up to 50) ranked by Priority. Promotions beyond rank 50 in either category are silently excluded.

Hard cart limits enforced at checkout:

  • Maximum 5 coupon codes per cart — adding a 6th raises a user-visible error.
  • Maximum 24 item-level adjustments per cart.
  • Maximum 6 order-level adjustments per cart.

Common Patterns

Pattern A: Store-Wide Automatic Promotion

When to use: A discount applies to all buyers in the store with no coupon required — e.g., a site-wide 10% off sale.

How it works:

  1. Create a Promotion record with IsActive = true, Priority set relative to other promotions, and StartDate/EndDate defined.
  2. Create a PromotionSegmentSalesStore record linking the promotion to the target WebStore.
  3. Leave PromotionSegmentBuyerGroup absent (store-wide scope).
  4. Confirm the checkout flow includes the PromotionsCartCalculator subflow — without it, the promotion never fires.
  5. Test by adding qualifying products to a cart and completing checkout.

Why not the alternative: Simply activating the Promotion record and assuming it applies is the most common production bug. The checkout flow integration is non-optional.

Pattern B: BuyerGroup-Scoped Pricebook with Tiered Pricing

When to use: Different buyer tiers (e.g., Distributors vs. Retailers) need different base prices, with further quantity-based discounts layered on top.

How it works:

  1. Create one Pricebook2 per buyer tier with appropriate PricebookEntry records and UnitPrice values.
  2. Create a BuyerGroupPricebook junction record for each Pricebook2 → BuyerGroup pairing. Set Priority to control resolution order within the group (lower number = higher priority).
  3. Create a WebStorePricebook junction record for each pricebook that should also be discoverable at the store level (keep total under 5).
  4. For products with quantity breaks, create a PriceAdjustmentSchedule linked to the relevant PricebookEntry, then add PriceAdjustmentTier child records for each quantity band.
  5. Verify tier bounds are contiguous and non-overlapping — gaps cause the base price to apply silently.

Why not the alternative: Using a single pricebook for all buyers and applying manual price overrides at order entry bypasses the automated resolution stack and cannot scale across thousands of products or buyer groups.

Pattern C: Coupon-Gated Promotion

When to use: A discount applies only when a buyer enters a valid coupon code at checkout.

How it works:

  1. Create a Promotion record with the discount definition. Set it as manual (not automatic) so it does not fire without a code.
  2. Create a PromotionSegmentSalesStore junction to scope it to the correct store.
  3. Create one or more PromotionCode records linked to the promotion, each with a unique Code string.
  4. Buyers enter the code at checkout. The PromotionsCartCalculator subflow validates the code and applies the discount.
  5. Enforce the 5-coupon-per-cart limit in UX design — surface a clear error message if a buyer attempts to add a 6th code.

Decision Guidance

SituationRecommended ApproachReason
All buyers in the store get the same priceOne Pricebook2 attached via WebStorePricebookSimplest resolution path; use BuyerGroupPricebook only when differentiation is needed
Different buyer groups need different pricesSeparate Pricebook2 per tier, attached via BuyerGroupPricebookThe resolution engine picks the highest-priority matching pricebook per buyer
Quantity breaks on specific productsPriceAdjustmentSchedule + PriceAdjustmentTier on PricebookEntryDeclarative tiered pricing; no custom Apex required
Automatic discount for all buyersPromotion + PromotionSegmentSalesStore, no couponSimplest promotion scope; still requires the checkout flow subflow
Discount only for a specific buyer groupPromotion + PromotionSegmentSalesStore + PromotionSegmentBuyerGroupScoping to BuyerGroup prevents the discount from leaking to other segments
Discount requires a coupon codePromotion (manual) + PromotionCode recordsManual promotions are only evaluated when a buyer supplies the code
Store is close to the 5-pricebook limitConsolidate buyer tiers into fewer Pricebook2 recordsThe 5-per-store limit is hard; consolidation or BuyerGroupPricebook is the only path

Recommended Workflow

Step-by-step instructions for an AI agent or practitioner working on this task:

  1. Audit current pricebook assignment. Query WebStorePricebook for the target WebStore.Id and count existing records. Confirm the count is under 5 before creating new ones. Query BuyerGroupPricebook for each relevant BuyerGroup and confirm counts are under 50.
  2. Design the buyer-tier-to-pricebook mapping. Document which BuyerGroup maps to which Pricebook2 and what Priority value each junction record should carry. Confirm total unique pricebooks evaluated per buyer does not exceed 25.
  3. Create or update pricebook junction records. Insert WebStorePricebook records for store-level visibility and BuyerGroupPricebook records for segment-level assignment. Set Priority fields deliberately — the evaluation order determines which price wins when multiple pricebooks contain the same product.
  4. Configure tiered pricing if required. Create PriceAdjustmentSchedule linked to the target PricebookEntry, then add PriceAdjustmentTier child records with contiguous quantity bounds. Verify no gaps exist between tier upper and lower bounds.
  5. Set up promotions and scope them correctly. Create Promotion records, then wire PromotionSegmentSalesStore (required) and optionally PromotionSegmentBuyerGroup. For coupon-gated promotions, create PromotionCode records. Confirm IsActive = true and date ranges are correct.
  6. Verify the checkout flow includes the Promotions subflow. Open the active checkout flow in Flow Builder and confirm the PromotionsCartCalculator element is present in the cart calculation sequence. Without it, no promotions fire.
  7. Run SOQL validation and end-to-end checkout test. Execute the validation queries in the template to confirm all junction records are wired correctly. Place a test order as a buyer in the affected BuyerGroup and confirm prices and discounts resolve as expected.

Review Checklist

Run through these before marking work in this area complete:

  • WebStorePricebook count for the store is 5 or fewer
  • BuyerGroupPricebook count per BuyerGroup is 50 or fewer; pricebook has 100 or fewer BuyerGroups
  • Total pricebooks visible to any single buyer does not exceed 25
  • PriceAdjustmentTier bounds are contiguous (no gaps, no overlaps) for every tiered product
  • Each active Promotion has a PromotionSegmentSalesStore record for the correct store
  • Checkout flow contains the PromotionsCartCalculator subflow element
  • Cart-level adjustments stay within limits: 24 item-level, 6 order-level, 5 coupon codes
  • Promotions ranked beyond 50 (automatic) or 50 (manual) have been removed or re-prioritized
  • End-to-end checkout test performed as a buyer in each affected BuyerGroup

Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

  1. Silent pricebook exclusion at rank 26+ — The price engine evaluates at most 25 pricebooks per call. If a buyer belongs to multiple BuyerGroups with many pricebook assignments and the total visible pricebooks exceeds 25, the lowest-priority ones are silently skipped. No error is logged. Buyers may see wrong prices with no obvious cause.
  2. Promotions require the checkout flow subflow — Activating a Promotion record and making it active does not apply any discount. The PromotionsCartCalculator must be present in the active checkout flow. Removing or bypassing the flow (e.g., during testing with a custom flow) silently disables all promotions.
  3. 5 coupon codes per cart is a hard limit — Attempting to apply a 6th coupon code raises a user-visible error. Design the UX to surface a clear message before this limit is hit, not after.
  4. Silent promotion exclusion at rank 51+ — The evaluate API processes at most 50 automatic and 50 manual promotions per checkout, ranked by Priority. Promotions outside that window are silently ignored. Regularly audit promotion counts and retire expired records.
  5. Pricebook2Id on Account does not work for Commerce — The standard Sales Cloud field Account.Pricebook2Id is ignored by the Commerce pricing engine. Pricebook assignment for Commerce buyers must go through WebStorePricebook and BuyerGroupPricebook.

Output Artifacts

ArtifactDescription
WebStorePricebook recordsJunction records linking each Pricebook2 to the WebStore with a Priority value
BuyerGroupPricebook recordsJunction records assigning pricebooks to BuyerGroup records for segment-specific pricing
PriceAdjustmentSchedule recordsParent records enabling tiered pricing on a PricebookEntry (requires API v60.0+)
PriceAdjustmentTier recordsChild records defining quantity bounds and adjustment values for tiered pricing
Promotion + segment junction recordsPromotion, PromotionSegmentSalesStore, PromotionSegmentBuyerGroup records defining the discount and its scope
PromotionCode recordsCoupon code strings linked to manual promotions
SOQL validation queriesQueries verifying junction record wiring before buyer testing

Related Skills

  • admin/b2b-commerce-store-setup — covers WebStore, BuyerGroup, EntitlementPolicy, and catalog access wiring that must be in place before pricing configuration

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Commerce Pricing And Promotions?

Configure pricebooks, tiered pricing, promotions, coupon codes, and cart discounts for B2B or D2C Commerce stores. Trigger keywords: WebStorePricebook, BuyerGroupPricebook, PriceAdjustmentSchedule, PromotionsCartCalculator, commerce coupon, cart-level discount, tiered price, Commerce promotion. NOT for Sales Cloud pricebooks and PricebookEntry - use admin/products-and-pricebooks. NOT for CPQ quote pricing and discount schedules - use admin/cpq-pricing-rules.

Навіщо використовувати Commerce Pricing And Promotions у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Commerce Pricing And Promotions — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Commerce Pricing And Promotions у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/commerce-pricing-and-promotions. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Commerce Pricing And Promotions?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Commerce Pricing And Promotions?

Зі скількома забажаєте. У TypingMind ви можете використовувати Commerce Pricing And Promotions із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Commerce Pricing And Promotions?

На GitHub цю навичку публікує PranavNagrecha. Умови ліцензування дивіться в репозиторії. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі
Логотип openclaw

Openclaw Test Performance

openclaw
ОрганізаціяПопулярне

Вимірюйте продуктивність, діагностуйте й оптимізуйте час виконання тестів і наборів плагінів OpenClaw, вузькі місця імпорту, CPU/RSS, зростання heap і повільні шляхи покриття тестами.

82.2K
391K
Файлів: 1
Відкрити
Логотип openclaw

Openclaw Testing

openclaw
ОрганізаціяПопулярне

Добирайте пропорційні за обсягом тести й перевірки OpenClaw, діагностуйте помилки та передавайте завдання, чутливі до середовища, або підтвердження для релізу відповідальним особам.

82.2K
391K
Файлів: 2
Відкрити
Логотип openclaw

Release Openclaw Ci

openclaw
ОрганізаціяПопулярне

Запускайте, відстежуйте, налагоджуйте та підсумовуйте повний CI для релізів OpenClaw, перевірки релізів, контрольні перевірки робочих провайдерів, підтвердження встановлення й оновлення та попередні перевірки секретів для релізу.

82.2K
391K
Файлів: 3
Відкрити
Логотип openclaw

Release Openclaw Mac

openclaw
ОрганізаціяПопулярне

Виконуйте підписування релізів OpenClaw для macOS, нотаризацію, оновлення appcast і просування ресурсів або відновлюйте ці процеси.

82.2K
391K
Інструкції
Відкрити

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇