acp-delegated-payment

Implement the ACP delegated payment flow and SharedPaymentToken (SPT) provisioning. Use when integrating with Stripe for payment tokenization, handling SPT lifecycle, or building the payment completion flow.

17 stars

Best use case

acp-delegated-payment is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Implement the ACP delegated payment flow and SharedPaymentToken (SPT) provisioning. Use when integrating with Stripe for payment tokenization, handling SPT lifecycle, or building the payment completion flow.

Teams using acp-delegated-payment should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/acp-delegated-payment/SKILL.md --create-dirs "https://raw.githubusercontent.com/OrcaQubits/agentic-commerce-skills-plugins/main/acp-agentic-commerce/skills/acp-delegated-payment/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/acp-delegated-payment/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How acp-delegated-payment Compares

Feature / Agentacp-delegated-paymentStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Implement the ACP delegated payment flow and SharedPaymentToken (SPT) provisioning. Use when integrating with Stripe for payment tokenization, handling SPT lifecycle, or building the payment completion flow.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# ACP Delegated Payment & SharedPaymentToken

## Before writing code

**Fetch live docs**:
1. Fetch `https://developers.openai.com/commerce/specs/payment/` for the delegated payment specification
2. Fetch `https://docs.stripe.com/agentic-commerce/concepts/shared-payment-tokens` for SPT implementation details
3. Web-search `site:docs.stripe.com agentic-commerce delegate payment` for Stripe integration guide
4. Web-search `site:github.com agentic-commerce-protocol spec openapi delegate` for the delegate payment OpenAPI spec

## Conceptual Architecture

### What Delegated Payment Solves

The agent facilitates purchases but must **never see raw card data**. Delegated payment creates a secure intermediary:
- Buyer's payment credentials go to the PSP (Stripe), not the agent or merchant
- PSP returns a single-use, scoped token (SPT)
- Agent passes the SPT to the merchant in the `complete` call
- Merchant charges via PSP using the SPT

### End-to-End Flow

```
Buyer → Agent: "Buy this"
Agent → PSP: POST /agentic_commerce/delegate_payment (credentials + constraints)
PSP → Agent: SharedPaymentToken (single-use, scoped)
Agent → Merchant: POST /checkout_sessions/{id}/complete (with SPT)
Merchant → PSP: Charge using SPT
PSP → Merchant: Payment confirmation
Merchant → Agent: Session status = completed + order
```

### SPT Constraints (Allowance)

Each SharedPaymentToken is scoped with:
- **max_amount** — Maximum chargeable amount (integer, minor units)
- **currency** — Currency code
- **checkout_session_id** — Tied to a specific session
- **merchant_id** — Only usable by the specified merchant
- **expires_at** — Expiration timestamp
- **reason** — Purpose of the allowance (value: `"one_time"` for single-use checkout tokens)

If any constraint is violated, the charge fails.

### SPT Properties

- **Single-use** — Can only be charged once
- **Time-bound** — Expires after a configured duration
- **Amount-scoped** — Cannot exceed the max amount
- **Merchant-scoped** — Only the designated merchant can use it
- **Session-scoped** — Tied to a specific checkout session

### 3D Secure Flow

When the merchant returns `authentication_required`:
1. Agent receives a 3DS challenge
2. Agent performs 3DS authentication with the buyer
3. Agent calls `complete` again with `authentication_result` containing:
   - `three_ds_cryptogram`
   - `electronic_commerce_indicator`
   - `transaction_id`
   - `version`

### SPT Webhook Events

| Event | Recipient | Purpose |
|-------|-----------|---------|
| `shared_payment.granted_token.used` | Merchant | Confirms SPT was consumed |
| `shared_payment.granted_token.deactivated` | Merchant | SPT revoked or expired |
| `shared_payment.issued_token.used` | Agent | Payment was processed |
| `shared_payment.issued_token.deactivated` | Agent | SPT invalidated |

### PCI Considerations

- Direct `/delegate_payment` integration may affect PCI DSS scope
- Network tokens preferred over full PAN (FPAN) where possible
- Never log full card numbers or CVCs
- SPT itself is not PCI-sensitive — it's a vault reference

### Best Practices

- Always set `max_amount` to the session total (not higher)
- Set short expiration times — just enough for the checkout completion
- Handle SPT expiration gracefully — re-provision if needed
- Implement SPT webhook listeners for lifecycle tracking
- Log SPT creation and usage for reconciliation (without sensitive data)

Fetch the delegated payment OpenAPI spec and Stripe SPT docs for exact endpoint, request/response schemas, and error codes before implementing.

Related Skills

woo-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce payment gateways — WC_Payment_Gateway, direct/redirect/hosted integrations, tokenization, subscriptions support, refunds, and PCI compliance. Use when creating custom payment method integrations.

ucp-payment-handlers

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement UCP payment handlers — configure Google Pay, Shop Pay, or custom payment methods with tokenization, credential flow, and instrument schemas. Use when integrating payment processing into a UCP checkout.

spree-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Integrate payment gateways with Spree — PaymentMethod model, the v5.4+ PaymentSession provider-agnostic checkout flow, Stripe via `spree_stripe` (Apple/Google Pay, Link, Connect for marketplaces), Adyen via `spree_adyen`, PayPal via `spree_paypal_checkout`, StoreCredit / GiftCard as payment methods, refunds, payment state machine, and authoring a custom gateway. Use when wiring a payment integration, handling webhooks from a gateway, or debugging payment-state issues.

sf-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement Salesforce Commerce payments — Salesforce Payments (supports multiple processors including Stripe and Adyen), B2C payment adapters (JavaScript cartridge-based), B2B payment adapters (Apex-based), PCI compliance via tokenization, 3D Secure/SCA support, and payment method management. Use when implementing payment processing.

saleor-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement Saleor payment processing — transaction-based payment flow, payment Apps, sync webhook events, Stripe/Adyen patterns, and refunds. Use when building payment integrations.

medusa-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement Medusa v2 payment processing — payment module, provider abstraction, payment sessions, authorization/capture/refund lifecycle, and Stripe/PayPal integration. Use when adding payment providers.

bc-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Integrate BigCommerce payments — Payment Processing API, stored payment instruments, payment methods, server-side payment processing for headless, and PCI considerations. Use when building custom payment flows or processing payments programmatically.

ap2-payment-processor

17
from OrcaQubits/agentic-commerce-skills-plugins

Build an AP2 Merchant Payment Processor — the agent that constructs payment authorization messages, requests credentials from the Credentials Provider, processes payments, and returns receipts. Use when implementing the MPP role.

ap2-payment-mandate

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement the AP2 Payment Mandate — the VDC shared with payment networks and issuers to signal AI involvement and user authorization. Use when building payment authorization flows, tokenization, and network integration.

acp-payment-handlers

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement ACP payment handlers — pluggable payment method specifications including tokenized cards, seller-backed methods (gift cards, points, store credit), and handler negotiation. Use when adding payment methods or building custom payment handler support.

woo-testing

17
from OrcaQubits/agentic-commerce-skills-plugins

Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.

woo-shipping

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.