<!-- ZenPays documentation · https://docs.zenpayz.com/docs/reference/objects/payment-intent -->

# 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

<ParamTable
  label="Field"
  rows={[
    { name: "id", type: "string", required: true, desc: "Unique identifier for the payment intent" },
    { name: "merchantId", type: "string", required: true, desc: "ID of the merchant receiving the payment" },
    { name: "merchantName", type: "string", required: false, desc: "Display name of the merchant" },
    { name: "merchantLogo", type: "string", required: false, desc: "URL to the merchant's logo for display on payment pages" },
    { name: "description", type: "string", required: false, desc: "Description of what the payment is for" },
    { name: "amount", type: "number", required: true, desc: "Payment amount in the smallest currency unit (e.g., cents for USD)" },
    { name: "currency", type: "string", required: true, desc: "Three-letter ISO currency code" },
    { name: "status", type: "PaymentStatus", required: true, desc: "Current status of the payment intent [PaymentStatus](/docs/reference/enums/payment-status)" },
    { name: "customerName", type: "string", required: false, desc: "Name of the customer making the payment" },
    { name: "customerEmail", type: "string", required: false, desc: "Email of the customer making the payment" },
    { name: "customerPhone", type: "string", required: false, desc: "Phone number of the customer making the payment" },
    { name: "processingFee", type: "number", required: false, desc: "Processing fee charged for this payment" },
    { name: "expiresAt", type: "string", required: false, desc: "ISO 8601 timestamp when the payment intent expires" },
    { name: "metadata", type: "Record<string, unknown>", required: false, desc: "Custom key-value data attached to the payment" },
    { name: "supportedPaymentMethods", type: "string[]", required: false, desc: "Payment methods available for this intent (e.g. 'UPI', 'UPIQR-H5', 'CARD')" },
    { name: "supportedCountries", type: "string[]", required: false, desc: "Supported countries for this intent (ISO 2-letter codes)" },
    { name: "channelLimits", type: "Record<string, Record<string, { min: number, max: number }>>", required: false, desc: "Per-currency, per-method min/max transaction limits" },
    { name: "selectedTsp", type: "string", required: false, desc: "TSP selected for processing this payment" },
    { name: "createdAt", type: "string", required: false, desc: "ISO 8601 timestamp when the payment intent was created" },
    { name: "updatedAt", type: "string", required: false, desc: "ISO 8601 timestamp when the payment intent was last updated" },
  ]}
/>

## Example

```json
{
  "id": "obj_1a2b3c",
  "merchantId": "merchant_1a2b3c",
  "merchantName": "string",
  "merchantLogo": "string",
  "description": "string",
  "amount": 5000,
  "currency": "USD",
  "status": "pending"
}
```

## Usage

```typescript
const intent = await client.payments.create({
  amount: 5000, // $50.00
  currency: 'USD',
  description: 'Order #12345'
});
console.log(`Payment URL: ${intent.paymentUrl}`);
```
