# Confirm A Payment Intent — Stripe

> Confirm that your customer intends to pay with current or provided payment method. See the documentation.

- Key: `stripe-confirm-payment-intent`
- Type: Action (Write)
- Version: 0.1.5
- App: Stripe (`stripe`) — https://pipedream.com/apps/stripe.md
- This page (HTML): https://pipedream.com/apps/stripe/actions/confirm-payment-intent
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs

## Description

Confirm that your customer intends to pay with current or provided payment method. [See the documentation](https://stripe.com/docs/api/payment_intents/confirm).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | Yes | Example: pi_0FhyHzGHO3mdGsgAJNHu7VeJ Options are loaded from the connected account. |
| `customer` | `string` | No | Example: cus_Jz4ErxGo9t1agg Options are loaded from the connected account. |
| `paymentMethod` | `string` | No | Example: pm_card_visa Options are loaded from the connected account. |
| `receiptEmail` | `string` | No | Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. |
| `setupFutureUsage` | `string` | No | Indicate if you intend to use the specified payment method for a future payment. If you intend to only reuse the payment method when your customer is present in your checkout flow, choose on_session; otherwise, choose off_session. |
| `shippingAddressCity` | `string` | No | City, district, suburb, town, or village. |
| `shippingAddressCountry` | `string` | No | Two-letter country code (ISO 3166-1 alpha-2). |
| `shippingAddressLine1` | `string` | No | Address line 1 (e.g., street, PO Box, or company name). |
| `shippingAddressLine2` | `string` | No | Address line 2 (e.g., apartment, suite, unit, or building). |
| `shippingAddressPostalCode` | `string` | No | ZIP or postal code. |
| `shippingAddressState` | `string` | No | State, county, province, or region. |
| `shippingName` | `string` | No | Recipient name. |
| `shippingCarrier` | `string` | No | The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. |
| `shippingPhone` | `string` | No | Recipient phone (including extension). |
| `shippingTrackingNumber` | `string` | No | The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. |
| `captureMethod` | `string` | No | Controls when the funds will be captured from the customer's account. |
| `confirmationToken` | `string` | No | ID of the ConfirmationToken used to confirm this PaymentIntent. |
| `errorOnRequiresAction` | `boolean` | No | Set to true to fail the payment attempt if the PaymentIntent transitions into requires_action. This parameter is intended for simpler integrations that do not handle customer actions, like saving cards without authentication. |
| `mandate` | `string` | No | ID of the mandate that's used for this payment. |
| `mandateDataCustomerAcceptanceType` | `string` | No | The type of customer acceptance information included with the Mandate. |
| `mandateDataCustomerAcceptanceAcceptedAt` | `string` | No | The time at which the customer accepted the Mandate. |
| `mandateDataCustomerAcceptanceOffline` | `object` | No | If this is a Mandate accepted offline, this hash contains details about the offline acceptance. |
| `mandateDataCustomerAcceptanceOnlineIpAddress` | `string` | No | The IP address from which the Mandate was accepted by the customer. |
| `mandateDataCustomerAcceptanceOnlineUserAgent` | `string` | No | The user agent of the browser from which the Mandate was accepted by the customer. |
| `offSession` | `boolean` | No | Set to true to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and charge them later. |
| `paymentMethodData` | `object` | No | If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the payment_method property on the PaymentIntent. See the documentation. |
| `paymentMethodOptions` | `object` | No | Payment method-specific configuration for this PaymentIntent. See the documentation. |
| `paymentMethodTypes` | `string[]` | No | Payment method types that may be used |
| `radarOptionsSession` | `string` | No | A Radar Session is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. |
| `returnUrl` | `string` | No | The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. |
| `useStripeSdk` | `boolean` | No | Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "stripe",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "stripe-confirm-payment-intent",
  arguments: {
    id: "Payment Intent ID",
    customer: "Customer ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "stripe-confirm-payment-intent",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    stripe: { authProvisionId: "apn_xxxxxxx" },
    id: "Payment Intent ID",
    customer: "Customer ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "stripe-confirm-payment-intent",
    "configured_props": {
      "stripe": { "authProvisionId": "apn_xxxxxxx" },
      "id": "Payment Intent ID",
      "customer": "Customer ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/stripe.md · All apps: https://pipedream.com/apps
