Acp discount extension

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Acp discount extension is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. 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.

How to use this skill

Skill file

ACP Discount Extension

Before writing code

Fetch live docs:

  1. Web-search site:github.com agentic-commerce-protocol rfcs discount_extension for the discount extension RFC
  2. Web-search site:github.com agentic-commerce-protocol examples discount-extension for discount examples
  3. Fetch https://developers.openai.com/commerce/specs/checkout/ for how discounts interact with checkout
  4. Web-search site:github.com agentic-commerce-protocol spec json-schema discount for the discount JSON schema

Conceptual Architecture

What the Discount Extension Does

The 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.

Extension Identity

Three Components

  1. Submitted Codes — Agent sends discounts.codes[] with discount codes the buyer wants to apply
  2. Applied Discounts — Merchant responds with successfully applied discounts, including coupon details and monetary allocations to line items
  3. Rejected Codes — Merchant responds with codes that couldn't be applied, including error reasons

Discount Error Codes

When a code is rejected, the merchant returns a reason:

Discount Allocations

When a discount is applied, the merchant shows how the discount is distributed:

Interaction with Totals

Applied discounts affect the totals[] array:

Extension Negotiation

The discount extension follows capability negotiation:

  1. Agent includes discount in capabilities.extensions[]
  2. Merchant confirms support in the response
  3. If not negotiated, discount fields are ignored

Best Practices

Fetch the discount extension RFC and JSON schema for exact field names, error code enumeration, and allocation structure before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.