> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://mpp.dev/api/mcp` to find what you need.

# Stripe \[Cards and stablecoins from one integration]

Use Stripe's machine-payments integration to offer stablecoins (Tempo and others) and [Shared Payment Tokens (SPTs)](https://docs.stripe.com/agentic-commerce/concepts/shared-payment-tokens) from one MPP server. Successful stablecoin payments are recorded in Stripe as `PaymentIntent` objects for unified reporting.

Every `PaymentIntent` that `mppx` creates or records includes `machine_payment`, `mpp_challenge_id`, `mpp_intent`, and `mpp_sdk` metadata by default so you can identify and analyze MPP payments in Stripe. The SDK identifier includes the `mppx` version. Built-in values are limited to 500 Unicode characters, and matching integration-, method-, or request-scoped metadata overrides them.

SPTs let a client share a customer's payment method with your Stripe account under configurable expiration and usage limits. The client creates an SPT through Stripe, and the server consumes it to create a `PaymentIntent`.

:::info[Stripe prerequisites]
Complete the eligibility and account prerequisites in the [Stripe MPP guide](https://docs.stripe.com/payments/machine/mpp) before you accept MPP payments.
:::

:::tip[For agents]
Use the [Link CLI](/tools/wallet#link-cli) to pay for `stripe` SPT services from a Link wallet without writing integration code. `link-cli mpp pay` handles the full 402 → SPT → retry flow automatically.
:::

## Server integration

Use [`stripe.create`](/sdk/typescript/server/Method.stripe.create) as the default server setup. Configure a deposit-address resolver to register Tempo and SPT charge methods and record completed stablecoin payments in Stripe.

```ts twoslash [server.ts]
import Stripe from 'stripe'
import { Mppx, stripe } from 'mppx/server'

const client = new Stripe(process.env.STRIPE_SECRET_KEY!)

const payments = stripe.create({
  client,
  depositAddresses: (network) => stripe.findOrCreateDepositAddress(client, network),
  livemode: false,
  networkId: process.env.STRIPE_NETWORK_ID!,
})

const mppx = Mppx.create({
  methods: await payments.defaultMethods(),
  secretKey: process.env.MPP_SECRET_KEY!,
})
```

The resolver runs only for the stablecoin networks you enable. If one network fails, `mppx` warns and keeps the other resolved methods. Omit `depositAddresses` for a synchronous SPT-only setup.

Set `hostedFeePayer: true` in a live-mode integration to sponsor Tempo transaction fees through Stripe. This option applies to Tempo charge and Sessions methods, requires a compatible Stripe Node SDK client, and doesn't support Stripe Connect account routing.

Use [`stripe.spt`](/sdk/typescript/server/Method.stripe.spt) directly when you only accept SPT payments. Import `Mppx` from `mppx/server/core` and `stripe` from `mppx/stripe/server/spt` to omit unrelated payment rails.

## Shared Payment Token flow

```mermaid
sequenceDiagram
  participant Client
  participant Server
  participant Stripe
  Client->>Server: (1) GET /resource
  Server-->>Client: (2) 402 + Challenge
  Client->>Stripe: (3) Create SPT from Challenge
  Stripe-->>Client: (4) spt_...
  Client->>Server: (5) GET /resource + Credential
  Server->>Stripe: (6) Create PaymentIntent (using SPT)
  Stripe-->>Server: (7) pi_...
  Server-->>Client: (8) 200 OK + Receipt

```

1. **Server** responds with `402` and a Challenge containing the amount, currency, and Stripe method details (Business Network profile, allowed payment method types).
2. **Client** collects a payment method (via Stripe Elements or a stored method), then creates an SPT through the Stripe API with usage limits matching the Challenge.
3. **Client** sends a Credential containing the SPT.
4. **Server** creates a Stripe `PaymentIntent` using the SPT and confirms it.
5. **Server** returns the resource with a Receipt referencing the `PaymentIntent`.

## Intents

[Charge](/payment-methods/stripe/charge) — One-time payments through Stripe
