Payment Intents

Payment intents represent a request to collect payment from a customer.

Overview

A payment intent is created when you want to process a payment.

Creating a Payment Intent

Request

POST /payment-intents
Content-Type: application/json

{
  "amount": 1000,
  "currency": "usd",
  "description": "Payment for order #123"
}

Response

{
  "id": "pi_1234567890",
  "amount": 1000,
  "currency": "usd",
  "status": "requires_payment_method",
  "created": 1234567890
}

Payment Intent Statuses

Payment intents progress through several statuses:

  • requires_payment_method - Payment method needs to be attached
  • requires_confirmation - Payment method attached, awaiting confirmation
  • requires_action - Additional action required (e.g., 3D Secure)
  • processing - Payment is being processed
  • succeeded - Payment completed successfully
  • canceled - Payment was canceled
  • requires_capture - Payment authorized, awaiting capture

Retrieving a Payment Intent

GET /payment-intents/{id}

Updating a Payment Intent

POST /payment-intents/{id}
Content-Type: application/json

{
  "amount": 1500
}

Canceling a Payment Intent

POST /payment-intents/{id}/cancel

Webhooks

Payment intent events are sent via webhooks:

  • payment_intent.created
  • payment_intent.succeeded
  • payment_intent.failed
  • payment_intent.canceled