Skip to main content

Create Payment Intent

Create a new payment intent to initiate a payment flow.

POSThttps://api.zenpayz.com/api/v1/payment-intents
Bearer · API key

Request

Headers

HeaderDescription
Authorization
REQUIRED
Bearer {api_key}
X-Signature
REQUIRED
HMAC-SHA256 signature
X-Timestamp
REQUIRED
ISO 8601 timestamp
X-Secret-Salt
REQUIRED
Secret salt for HMAC validation
Content-Type
REQUIRED
application/json
X-Idempotency-Key
OPTIONAL
Unique key to prevent duplicates

Body Parameters

ParameterTypeDescription
amount
REQUIRED
integerAmount in smallest currency unit (e.g., cents)
currency
REQUIRED
stringISO 4217 currency code (e.g., USD, INR)
paymentMethod
OPTIONAL
stringPreferred payment method
customerEmail
OPTIONAL
stringCustomer email address
customerPhone
OPTIONAL
stringCustomer phone number
customerFirstName
OPTIONAL
stringCustomer first name
customerLastName
OPTIONAL
stringCustomer last name
customerCountry
OPTIONAL
stringISO country code (e.g., IN, US)
description
OPTIONAL
stringPayment description
successUrl
OPTIONAL
stringRedirect URL on success
cancelUrl
OPTIONAL
stringRedirect URL on cancel
{
"amount": 100,
"currency": "INR",
"paymentMethod": "upi",
"customerEmail": "test@example.com",
"customerPhone": "+911234567890",
"customerFirstName": "Test",
"customerLastName": "Customer",
"customerCountry": "IN",
"description": "Test payment"
}

Payment Methods

ValueDescription
credit_cardCredit card
upiUPI (India)
net_bankingNet banking
cryptoCryptocurrency
note
  • credit_card is currently supported for TWD (Taiwan Dollar) payments. The customerPhone field must be a 10-digit number starting with 09 (e.g., 0912345678).
  • upi is used for INR (Indian Rupee) payments.
  • For crypto payments (USDT, USDC, BTC, ETH, SOL, BNB), the paymentMethod field is optional — the system auto-detects the payment method from the crypto currency.
Try it out

Test payment intent creation interactively using the API Simulator.

{
"amount": 100,
"currency": "INR",
"paymentMethod": "upi",
"customerEmail": "test@example.com",
"customerPhone": "+911234567890",
"customerFirstName": "Test",
"customerLastName": "Customer",
"customerCountry": "IN",
"description": "Test payment"
}

Response

Success (201 Created)

{
"success": true,
"data": {
"intentId": "pi_1771910100598_prckpcg01",
"merchantId": "mer_3630198df5cb479b",
"customerId": null,
"amount": 100,
"currency": "INR",
"status": "requires_payment_method",
"description": "Test payment",
"expiresAt": "2026-02-24T05:20:00.598Z",
"estimatedCompletionTime": 30000,
"processingFee": 0,
"createdAt": "2026-02-24T05:15:00.599Z",
"metadata": {},
"paymentPageUrl": "https://checkout.zenpayz.com/pay/pi_1771910100598_prckpcg01?token=pi_1771910100598_secret_csit7h",
"routingDecision": {
"reason": "Initial routing - will be optimized with customer intelligence",
"paymentMethods": ["UPI", "PIX", "FPS"],
"supportedCountries": ["IN", "BR", "HK"]
}
}
}

Error Responses

CodeHTTPMessage
INVALID_AMOUNT400Amount must be greater than 0
INVALID_CURRENCY400Currency not supported
UNAUTHORIZED401Invalid API key
LIMIT_EXCEEDED403Transaction limit exceeded
VALIDATION_ERROR422Request validation failed

Examples

curl -X POST https://api.zenpayz.com/api/v1/payment-intents \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2026-02-24T05:15:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"currency": "INR",
"paymentMethod": "upi",
"customerEmail": "test@example.com",
"customerPhone": "+911234567890",
"customerFirstName": "Test",
"customerLastName": "Customer",
"customerCountry": "IN",
"description": "Test payment"
}'

Payment Intent Status

StatusDescription
requires_payment_methodAwaiting payment method selection
processingPayment is being processed
succeededPayment completed successfully
failedPayment failed
cancelledPayment was cancelled
expiredPayment intent expired

Next Steps

After creating a payment intent:

  1. Redirect customer to checkout or confirm payment
  2. Get Payment Intent to check status
  3. Confirm Payment with customer details
  4. Set up Webhooks for async status updates