Confirm Payment
Confirm a payment intent with customer and payment method details. This initiates the actual payment processing.
POST
https://api.zenpayz.com/api/v1/payment-intents/{intentId}/confirmBearer · API key
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
intentId REQUIRED | string | Payment intent ID (e.g., pi_xxxxx) |
Headers
| Header | Description |
|---|---|
Content-Type REQUIRED | application/json |
X-Request-Id OPTIONAL | Unique request identifier (auto-generated if not provided) |
note
This endpoint is public — no API key or signature required. It is called from the checkout page on behalf of the customer.
Body
- UPI
- Card
- Bank Transfer
{
"customerDetails": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+911234567890",
"address": {
"country": "IN"
}
},
"paymentMethodDetails": {
"paymentMethod": "FIAT",
"paymentType": "UPI",
"upiId": "john@upi"
},
"deviceInfo": {
"userAgent": "Mozilla/5.0 ...",
"browserInfo": "Mozilla/5.0 ...",
"screenWidth": 1512,
"screenHeight": 982,
"deviceFingerprint": "a1b2c3d4e5f6",
"metadata": {
"selectedPaymentMethod": "fiat",
"selectedMethod": "upi",
"specificPaymentMethod": "UPI",
"customerCurrency": "INR"
}
}
}
tip
Card details (cardNumber, expiryMonth, expiryYear, cvv, cardHolderName) are optional. When omitted, the customer will be redirected to the TSP's hosted payment page to enter card details securely.
{
"customerDetails": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+911234567890",
"address": {
"country": "IN"
}
},
"paymentMethodDetails": {
"paymentMethod": "FIAT",
"paymentType": "CARD",
"cardNumber": "4242424242424242",
"expiryMonth": "12",
"expiryYear": "2028",
"cvv": "123",
"cardHolderName": "John Doe"
},
"deviceInfo": {
"userAgent": "Mozilla/5.0 ...",
"browserInfo": "Mozilla/5.0 ...",
"screenWidth": 1512,
"screenHeight": 982,
"deviceFingerprint": "a1b2c3d4e5f6",
"metadata": {
"selectedPaymentMethod": "fiat",
"selectedMethod": "card",
"specificPaymentMethod": "CARD",
"customerCurrency": "INR"
}
}
}
{
"customerDetails": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+250793045233",
"address": {
"country": "RW"
}
},
"paymentMethodDetails": {
"paymentMethod": "FIAT",
"paymentType": "BANK_TRANSFER"
},
"deviceInfo": {
"userAgent": "Mozilla/5.0 ...",
"browserInfo": "Mozilla/5.0 ...",
"screenWidth": 1512,
"screenHeight": 982,
"deviceFingerprint": "a1b2c3d4e5f6",
"metadata": {
"selectedPaymentMethod": "fiat",
"selectedMethod": "card",
"specificPaymentMethod": "BANK_TRANSFER",
"customerCurrency": "USD"
}
}
}
Field Reference
customerDetails (required)
| Parameter | Type | Description |
|---|---|---|
name REQUIRED | string | Customer full name (max 100 chars) |
email REQUIRED | string | Customer email |
phone OPTIONAL | string | Customer phone (max 15 chars) |
address.country OPTIONAL | string | ISO 3166-1 alpha-2 country code |
paymentMethodDetails (optional)
| Parameter | Type | Description |
|---|---|---|
paymentMethod REQUIRED | string | FIAT or CRYPTO |
paymentType REQUIRED | string | Payment type within the method (see below) |
Fiat payment types (paymentMethod: "FIAT"):
paymentType | Additional Fields | Description |
|---|---|---|
UPI | upiId (string) — UPI VPA e.g. user@upi | UPI payment |
CARD | cardNumber, expiryMonth, expiryYear, cvv, cardHolderName | Card payment |
NETBANKING | bankCode (string) — bank code | Net banking |
BANK_TRANSFER | — | Bank transfer |
PIX | — | PIX (Brazil) |
WALLET | — | Wallet payment |
Crypto payment types (paymentMethod: "CRYPTO"):
paymentType | Additional Fields | Description |
|---|---|---|
DIRECT_CRYPTO | chain (string) — blockchain e.g. ethereum, tron | Direct crypto payment |
BUY_WITH_WALLET | chain (string) — blockchain | Crypto purchase via wallet |
deviceInfo (optional)
| Parameter | Type | Description |
|---|---|---|
userAgent OPTIONAL | string | Browser user agent |
browserInfo OPTIONAL | string | Browser info string |
screenWidth OPTIONAL | number | Screen width in pixels |
screenHeight OPTIONAL | number | Screen height in pixels |
deviceFingerprint OPTIONAL | string | Device fingerprint hash |
metadata OPTIONAL | object | Additional context (selected method, customer currency, etc.) |
Response
Success (200 OK)
{
"success": true,
"data": {
"intentId": "pi_1771910100598_prckpcg01",
"status": "processing",
"redirectUrl": "https://checkout.zenpayz.io/pay/xxxxx",
"externalTransactionId": "txn_abc123"
},
"message": "Payment confirmed successfully",
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-24T05:15:00.599Z",
"processing_time_ms": 1250,
"api_version": "v1",
"endpoint": "POST /payment-intent/:intentId/confirm"
}
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| INVALID_REQUEST | 400 | Missing required fields |
| UNAUTHORIZED | 401 | Invalid API key |
| PAYMENT_INTENT_NOT_FOUND | 404 | Intent doesn't exist |
| STATE_CONFLICT | 409 | Intent not in valid state |
| PAYMENT_FAILED | 422 | Payment processing failed |
| CHANNEL_LIMIT_MIN_EXCEEDED | 422 | Amount below minimum for payment method |
| CHANNEL_LIMIT_MAX_EXCEEDED | 422 | Amount exceeds maximum for payment method |
Examples
- cURL
- JavaScript
- Python
- SDK (Recommended)
# No authentication required — this is a public endpoint
curl -X POST "https://api.zenpayz.com/api/v1/payment-intents/pi_1771910100598_prckpcg01/confirm" \
-H "Content-Type: application/json" \
-d '{
"customerDetails": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+911234567890",
"address": { "country": "IN" }
},
"paymentMethodDetails": {
"paymentMethod": "FIAT",
"paymentType": "UPI",
"upiId": "john@upi"
},
"deviceInfo": {
"userAgent": "Mozilla/5.0...",
"deviceFingerprint": "a1b2c3d4e5f6"
}
}'
const intentId = 'pi_1771910100598_prckpcg01';
const body = {
customerDetails: {
name: 'John Doe',
email: 'john@example.com',
phone: '+911234567890',
address: { country: 'IN' },
},
paymentMethodDetails: {
paymentMethod: 'FIAT',
paymentType: 'UPI',
upiId: 'john@upi',
},
deviceInfo: {
userAgent: navigator.userAgent,
screenWidth: window.screen.width,
screenHeight: window.screen.height,
deviceFingerprint: 'a1b2c3d4e5f6',
metadata: {
selectedPaymentMethod: 'fiat',
selectedMethod: 'upi',
specificPaymentMethod: 'UPI',
customerCurrency: 'INR',
},
},
};
// No authentication needed — public endpoint
const response = await fetch(
`https://api.zenpayz.com/api/v1/payment-intents/${intentId}/confirm`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
}
);
const result = await response.json();
if (result.data.redirectUrl) {
window.location.href = result.data.redirectUrl;
}
import requests
intent_id = "pi_1771910100598_prckpcg01"
body = {
"customerDetails": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+911234567890",
"address": {"country": "IN"},
},
"paymentMethodDetails": {
"paymentMethod": "FIAT",
"paymentType": "UPI",
"upiId": "john@upi",
},
"deviceInfo": {
"userAgent": "Mozilla/5.0...",
"deviceFingerprint": "a1b2c3d4e5f6",
},
}
# No authentication needed — public endpoint
response = requests.post(
f"https://api.zenpayz.com/api/v1/payment-intents/{intent_id}/confirm",
headers={"Content-Type": "application/json"},
json=body,
)
result = response.json()
if result["data"].get("redirectUrl"):
print(f"Redirect to: {result['data']['redirectUrl']}")
// JavaScript SDK
const result = await zenpays.payments.confirmPayment('pi_1771910100598_prckpcg01', {
customerDetails: {
name: 'John Doe',
email: 'john@example.com',
phone: '+911234567890',
address: { country: 'IN' },
},
paymentMethodDetails: {
paymentMethod: 'FIAT',
paymentType: 'UPI',
upiId: 'john@upi',
},
});
if (result.redirectUrl) {
window.location.href = result.redirectUrl;
}
Handling Payment Actions
The response may require additional actions:
| Action Type | Description | Next Step |
|---|---|---|
redirect | Redirect to payment page | Navigate to redirectUrl |
3ds_authentication | 3D Secure required | Show 3DS popup/iframe |
otp_verification | OTP required | Display OTP input |
none | No action needed | Payment complete |
Related Endpoints
- Create Payment Intent
- Get Payment Intent
- Webhooks - Handle async status updates