dist/cursor/acp-agentic-commerce/skills/acp-discount-extension/SKILL.md
Implement the ACP discount extension — discount codes, applied discounts, rejected codes, and line-item allocations. Use when adding coupon/promo code support to checkout flows.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins acp-discount-extensionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch live docs:
site:github.com agentic-commerce-protocol rfcs discount_extension for the discount extension RFCsite:github.com agentic-commerce-protocol examples discount-extension for discount exampleshttps://developers.openai.com/commerce/specs/checkout/ for how discounts interact with checkoutsite:github.com agentic-commerce-protocol spec json-schema discount for the discount JSON schemaThe discount extension adds coupon/promo code support to ACP checkout sessions. It's a built-in extension that follows the extensions framework with independent versioning.
discountdiscount@2026-01-27)$.CheckoutSessionCreateRequest.discounts and related locationsdiscounts.codes[] with discount codes the buyer wants to applyWhen a code is rejected, the merchant returns a reason:
discount_code_expired — Code has expireddiscount_code_invalid — Code doesn't existdiscount_code_combination_disallowed — Can't combine with other active discountsdiscount_code_minimum_not_met — Cart total below minimum thresholddiscount_code_usage_limit_reached — Code has been used too many timesdiscount_code_already_applied — Code is already active on this sessiondiscount_code_user_not_logged_in — Discount requires an authenticated userdiscount_code_user_ineligible — User does not qualify for this discountWhen a discount is applied, the merchant shows how the discount is distributed:
path field (e.g., $.line_items[0])path to the target line item and the discount amountApplied discounts affect the totals[] array:
items_discount — Total discount on itemsdiscount — Order-level discountstotal accordinglyThe discount extension follows capability negotiation:
discount in capabilities.extensions[]Fetch the discount extension RFC and JSON schema for exact field names, error code enumeration, and allocation structure before implementing.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.