The PaymentIntent object
Represents a payment intent - the core object for initiating payments. A payment intent tracks the lifecycle of a payment from creation through completion or failure. It holds all the information needed to process the payment and is updated as the payment progresses.
Fields
| Field | Type | Description |
|---|---|---|
id REQUIRED | string | Unique identifier for the payment intent |
merchantId REQUIRED | string | ID of the merchant receiving the payment |
merchantName OPTIONAL | string | Display name of the merchant |
merchantLogo OPTIONAL | string | URL to the merchant's logo for display on payment pages |
description OPTIONAL | string | Description of what the payment is for |
amount REQUIRED | number | Payment amount in the smallest currency unit (e.g., cents for USD) |
currency REQUIRED | string | Three-letter ISO currency code |
status REQUIRED | PaymentStatus | Current status of the payment intent PaymentStatus |
customerName OPTIONAL | string | Name of the customer making the payment |
customerEmail OPTIONAL | string | Email of the customer making the payment |
customerPhone OPTIONAL | string | Phone number of the customer making the payment |
processingFee OPTIONAL | number | Processing fee charged for this payment |
expiresAt OPTIONAL | string | ISO 8601 timestamp when the payment intent expires |
metadata OPTIONAL | Record<string, unknown> | Custom key-value data attached to the payment |
supportedPaymentMethods OPTIONAL | string[] | Payment methods available for this intent (e.g. 'UPI', 'UPIQR-H5', 'CARD') |
supportedCountries OPTIONAL | string[] | Supported countries for this intent (ISO 2-letter codes) |
channelLimits OPTIONAL | Record<string, Record<string, { min: number, max: number }>> | Per-currency, per-method min/max transaction limits |
selectedTsp OPTIONAL | string | TSP selected for processing this payment |
createdAt OPTIONAL | string | ISO 8601 timestamp when the payment intent was created |
updatedAt OPTIONAL | string | ISO 8601 timestamp when the payment intent was last updated |
Example
{
"id": "obj_1a2b3c",
"merchantId": "merchant_1a2b3c",
"merchantName": "string",
"merchantLogo": "string",
"description": "string",
"amount": 5000,
"currency": "USD",
"status": "pending"
}
Usage
const intent = await client.payments.create({
amount: 5000, // $50.00
currency: 'USD',
description: 'Order #12345'
});
console.log(`Payment URL: ${intent.paymentUrl}`);