Payment Intents
Payment intents provide a two-phase payment flow. You create an intent to declare the payment parameters, then confirm it when the customer is ready to pay. This is useful when you need to collect customer details or authorize a payment before processing it. If you are coming from Stripe, this will feel familiar.Create a Payment Intent
Amount in USD.
Currency code.
Description of the payment.
automatic to capture immediately on confirmation, or manual to authorize only.Time in seconds before the intent expires. Default is 24 hours.
Arbitrary key-value pairs attached to the intent.
Example
Response
Secret used to confirm the intent from the client side. Pass this to your frontend.
Current intent status. See the state machine below.
List Payment Intents
Query Parameters
Filter by status:
requires_payment, processing, succeeded, canceled, failed.Number of results to return.
Get a Payment Intent
The payment intent ID (e.g.,
pi_test_abc123).Get Payment Intent Events
Confirm a Payment Intent
The Solana wallet address of the customer making the payment.
The client secret for verification. This must match the secret returned when the intent was created.
Type of payment transaction (e.g.,
direct, gasless).When
true, ZendFi sponsors the gas fees for this transaction.Additional metadata to attach at confirmation time.
Example
Cancel a Payment Intent
Intent Status Lifecycle
| Status | Description |
|---|---|
requires_payment | Intent created, waiting for confirmation |
processing | Confirmed, payment being processed |
succeeded | Payment completed successfully |
canceled | Intent was canceled before confirmation |
failed | Payment processing failed |
expired | Intent expired (default: 24 hours) |
When to Use Payment Intents
Use payment intents when you need:- Two-phase flow: Separate intent creation (server-side) from confirmation (client-side).
- Client secrets: Securely pass payment parameters to the frontend without exposing your API key.
- Manual capture: Authorize a payment now, capture it later (e.g., after shipping).
- Expiration control: Set custom expiration windows for long-lived checkout sessions.