/stripe-mpp:mpp-spt-lifecyclefrom stripe-mpp
Implements Stripe Shared Payment Token lifecycle for MPP card payments: creation, consumption, retrieval, webhook events, and reconciliation. Best when building fiat/card flows with Stripe SPTs.
Ships in stripe-mpp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
https://docs.stripe.com/agentic-commerce/concepts/shared-payment-tokens for the canonical SPT documentationsite:docs.stripe.com shared_payment granted_token API for SPT API endpointsstripe shared payment token webhook events for SPT event schemashttps://docs.stripe.com/payments/machine/mpp for SPT usage within MPP contextShared Payment Tokens are one-time payment tokens scoped to a specific merchant and exact amount. They are the mechanism by which card/fiat payments work within the MPP protocol. The agent never handles raw card data — SPTs abstract away PCI-sensitive information.
1. Agent → Stripe: Create SPT (scoped to merchant + amount + expiry)
2. Stripe → Agent: Returns spt_... token
3. Agent → Server: Sends SPT as payment credential in 402 flow
4. Server → Stripe: Creates PaymentIntent with SPT
5. Stripe → Server: Payment confirmed
6. Stripe → Agent: Webhook: shared_payment.issued_token.used
7. Stripe → Server: Webhook: shared_payment.granted_token.used
POST /v1/test_helpers/shared_payment/granted_tokens
Parameters:
payment_method: pm_card_visa
usage_limits[currency]: usd
usage_limits[max_amount]: 1000 # $10.00 in cents
usage_limits[expires_at]: <unix_ts> # Expiration timestamp
seller_details[network_id]: <seller_id> # Merchant's network ID
seller_details[external_id]: <ext_id> # Optional external reference
POST /v1/payment_intents
Parameters:
amount: 500 # $5.00 in cents
currency: usd
shared_payment_granted_token: spt_...
confirm: true
When confirmed, Stripe clones the original PaymentMethod and processes the charge.
GET /v1/shared_payment/granted_tokens/{id}
Returns limited payment method details (card brand, last four digits) and usage restrictions.
| Event | Recipient | Trigger | Key Fields |
|---|---|---|---|
shared_payment.granted_token.used | Seller (Server) | SPT successfully consumed | token_id, amount, currency |
shared_payment.granted_token.deactivated | Seller (Server) | SPT revoked or expired | token_id, reason |
shared_payment.issued_token.used | Agent | Seller consumed the SPT | token_id, amount |
shared_payment.issued_token.deactivated | Agent | SPT no longer valid | token_id, reason |
app.post('/webhooks/stripe', async (c) => {
const sig = c.req.header('stripe-signature');
const event = stripe.webhooks.constructEvent(
await c.req.text(),
sig,
process.env.STRIPE_WEBHOOK_SECRET
);
switch (event.type) {
case 'shared_payment.granted_token.used':
// SPT was successfully consumed — update records
break;
case 'shared_payment.granted_token.deactivated':
// SPT expired or was revoked — clean up
break;
}
});
| Constraint | Purpose |
|---|---|
max_amount | Transaction cannot exceed this (minor units) |
currency | Token only works in specified currency |
expires_at | Token invalid after this timestamp |
network_id | Only specified merchant can use it |
external_id | Additional merchant scoping |
SPTs can be deactivated for:
expires_at passedmax_amount to the exact payment amount — never higherstripe.webhooks.constructEvent()Fetch the latest Stripe SPT API documentation for exact endpoint paths, webhook event schemas, and error codes before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
stripe, shared-payment-token, mpp, payment-lifecycle, webhooks, card-payments
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin stripe-mpp12 skills in this plugin
/mpp-charge-flowImplement MPP one-time charge payment flows — per-request payment gates for API monetization, data access, and file downloads. Use when building pay-per-call APIs or protecting individual resources with HTTP 402 charges./mpp-client-fetchImplement MPP client-side payment handling with mppx.fetch(). Use when building AI agents or automated clients that consume 402-protected APIs, handling the transparent challenge-response payment flow./mpp-conformanceValidate MPP implementations against the specification — verify HTTP 402 challenge-response compliance, header formats, payment method correctness, service discovery, and production readiness. Use when auditing an MPP integration or preparing for production launch./mpp-dev-patternsCross-cutting MPP development patterns — security, replay protection, HMAC challenge binding, receipt validation, error handling, retry logic, TLS requirements, and monitoring. Use when designing architecture or solving production concerns./mpp-proxyImplement MPP payment proxies — wrap existing APIs with HTTP 402 payment gates without modifying the upstream service. Use when monetizing third-party APIs, adding payment layers to existing services, or building API marketplaces./mpp-server-middlewareImplement MPP server-side middleware for Hono, Express, Next.js, and Elysia. Use when protecting API routes with HTTP 402 payment gates, configuring payment methods, or setting up the Mppx server instance.Other plugins' skills for the same job