Help us improve
Share bugs, ideas, or general feedback.
From stripe-mpp
Implements MPP one-time charge flows for per-request API payments using HTTP 402 gates and mppx middleware. For pay-per-call APIs, data access, file downloads.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin stripe-mppHow this skill is triggered — by the user, by Claude, or both
Slash command
/stripe-mpp:mpp-charge-flowThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Implements Mppx server middleware for Hono, Express, Next.js, and Elysia to protect API routes with HTTP 402 payment gates, verify proofs of payment, and configure methods like Stripe.
Injects x402 payment middleware into Express APIs to enforce USDC micropayments on Base L2 for machine-to-machine monetization. Useful for premium endpoints or MCP servers.
Builds an Express server that charges USDC per API request using the x402 payment protocol. Use for monetizing endpoints as a paid service discoverable by other agents.
Share bugs, ideas, or general feedback.
Fetch live docs:
https://www.npmjs.com/package/mppx for the charge middleware API and configurationhttps://paymentauth.org/ for the canonical charge intent specificationsite:github.com stripe-samples machine-payments charge for charge flow sample codehttps://docs.stripe.com/payments/machine/mpp for Stripe charge integration detailsThe charge intent implements immediate, per-request settlement. Each API call triggers a single payment. The flow is:
Client: GET /api/data
Server: 402 Payment Required
WWW-Authenticate: Payment <challenge with intent="charge">
Client: Fulfills payment (on-chain tx or card charge)
Client: GET /api/data
Authorization: Payment <credential with proof>
Server: 200 OK
Payment-Receipt: <receipt>
// Protect a route with a charge gate
app.get('/api/data', mppx.charge({ amount: '100' }), async (c) => {
// Only reached after successful payment
return c.json({ data: 'premium content' });
});
The amount is specified in the smallest unit of the payment method's currency.
For routes where the price depends on the request:
app.get('/api/data/:size', async (c, next) => {
const size = c.req.param('size');
const amount = calculatePrice(size);
return mppx.charge({ amount: String(amount) })(c, next);
}, async (c) => {
return c.json({ data: 'variable-price content' });
});
WWW-Authenticate header with 402 status| Payment Method | Unit | Example: $0.01 |
|---|---|---|
| Tempo (USDC) | Smallest token unit | Verify in SDK docs |
| Stripe | Cents (minor currency unit) | 100 (1 USD cent = 100) |
| Lightning | Millisatoshis | Varies |
Always verify the exact unit convention in the SDK documentation for your payment method.
| Scenario | Server Response |
|---|---|
| No payment header | 402 with payment-required challenge |
| Payment amount too low | 402 with verification-failed |
| Payment to wrong address | 402 with verification-failed |
| Expired challenge | 402 with payment-expired |
| Duplicate credential (replay) | 402 with verification-failed |
| Successful payment | 200 with Payment-Receipt |
Fetch the latest mppx SDK docs and payment method documentation for exact charge configuration options and amount unit conventions before implementing.