API Responses
Success Responses
Create PI Success
json
{
"success": true, // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"data": {
"_id": "", // Unique identifier for the payment intent.
"pi_client_secret": "", // Client secret used to confirm the payment intent.
"created_at": "", // Timestamp when the payment intent was created.
"updated_at": "", // Timestamp when the payment intent was last updated.
"amount": 0, // Payment amount in smallest currency unit.
"currency": "", // Three-letter ISO currency code \(e.g., PKR\).
"refund": {
"refunded_amount": 0, // Amount that has been refunded.
"refund_object_id": "" // ID of the refund object \(null if no refund\).
},
"object_name": "", // Type of object \("payment_intent"\).
"customer": {
"name": "", // Customer's name.
"email": "", // Customer's email address.
"phone": "", // Customer's phone number.
"vip_customer": false, // Indicates if customer is a VIP.
"previous_customer": false // Indicates if customer has purchased before.
},
"description": "", // Description of the payment.
"pi_status": "", // Current status of the payment intent.
"pm_token": "", // Payment method token \(empty string if not used\).
"shipping": {
"address1": "", // Primary shipping address line.
"address2": "", // Secondary shipping address line.
"city": "", // Shipping city.
"country": "", // Shipping country.
"firstName": "", // Recipient's first name.
"lastName": "", // Recipient's last name.
"phone": "", // Customer's phone number.
"province": "", // Shipping province or state.
"zip": "", // Postal or ZIP code.
"shipping_method": "" // Selected shipping method.
},
"metadata": {
"order_reference": "", // Reference ID for the order.
"reason": "" // Reason for the payment intent.
},
"token": "", // Token for tokenized payments \(null if not used\).
"capture_method": "", // How the payment should be captured \(automatic or manual\).
"return_url": "", // URL to return to after payment completion.
"html_response": "", // HTML response data from payment gateway.
"bank_response": "", // Response data from the bank.
"last_payment_response": {
"token": "" // Token for tokenized payments \(null if not used\).
},
"encryptionKey": "", // Public key for encrypting sensitive data.
"product": {
"product_name": "", // Name of the product.
"product_category": "", // Category of the product.
"no_of_items": 0, // Number of items purchased.
"_id": "" // Unique identifier for the payment intent.
},
"billingAddress": {}, // Billing address information \(empty if not provided\).
"routing_rules_history": [], // History of routing rules applied.
"subscription": {}, // Subscription information \(empty if not applicable\).
"checkout_page_url": "", // URL for hosted checkout page.
"dqr_data": {} // DQR \(Dynamic QR\) data if applicable.
}
}Confirm PI Requires 3DS
json
{
"success": true, // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"data": {
"_id": "", // Unique identifier for the payment intent.
"pi_client_secret": "", // Client secret used to confirm the payment intent.
"created_at": "", // Timestamp when the payment intent was created.
"updated_at": "", // Timestamp when the payment intent was last updated.
"last_update": "", // Most recent update timestamp.
"amount": 0, // Payment amount in smallest currency unit.
"currency": "", // Three-letter ISO currency code \(e.g., PKR\).
"payment_method_types": [], // Type of payment method \(e.g., "card"\).
"customer": {
"name": "", // Customer's name.
"email": "", // Customer's email address.
"phone": "" // Customer's phone number.
},
"description": "", // Description of the payment.
"pi_status": "", // Current status of the payment intent.
"pm_token": "" // Payment method token \(empty string if not used\).
}
}Payment Captured
json
{
"success": true, // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"data": {
"last_payment_response": {
"error": "", // Indicates if there was an error \(false = success\).
"status": "", // Payment status \(e.g., "PAYMENT_CAPTURED"\).
"message": "", // Human-readable message about the request result.
"token": "" // Token for tokenized payments \(null if not used\).
},
"error": "", // Indicates if there was an error \(false = success\).
"status": "", // Payment status \(e.g., "PAYMENT_CAPTURED"\).
"message": "", // Human-readable message about the request result.
"token": "", // Token for tokenized payments \(null if not used\).
"payment_method_types": [], // Type of payment method \(e.g., "card"\).
"account_id": "", // Account identifier for the transaction.
"versionNo": "", // Version number of the API or system.
"token_data": {
"agreementId": "", // Token-specific data object.
"traceId": "" // Token-specific data object.
}
}
}Tokenized payment Captured
json
{
"success": true, // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"data": {
"_id": "", // Unique identifier for the payment intent.
"pi_client_secret": "", // Client secret used to confirm the payment intent.
"created_at": "", // Timestamp when the payment intent was created.
"updated_at": "", // Timestamp when the payment intent was last updated.
"last_update": "", // Most recent update timestamp.
"amount": 0, // Payment amount in smallest currency unit.
"currency": "", // Three-letter ISO currency code \(e.g., PKR\).
"refund": {
"refunded_amount": 0, // Amount that has been refunded.
"refund_object_id": "" // ID of the refund object \(null if no refund\).
},
"object_name": "", // Type of object \("payment_intent"\).
"payment_method_types": [], // Type of payment method \(e.g., "card"\).
"customer": {
"name": "", // Customer's name.
"email": "", // Customer's email address.
"phone": "" // Customer's phone number.
},
"description": "", // Description of the payment.
"pi_status": "", // Current status of the payment intent.
"pm_token": "", // Payment method token \(empty string if not used\).
"shipping": {
"address1": "", // Primary shipping address line.
"address2": "", // Secondary shipping address line.
"city": "", // Shipping city.
"country": "", // Shipping country.
"firstName": "", // Recipient's first name.
"lastName": "", // Recipient's last name.
"phone": "", // Customer's phone number.
"province": "", // Shipping province or state.
"zip": "", // Postal or ZIP code.
"shipping_method": "" // Selected shipping method.
},
"metadata": {
"order_reference": "" // Reference ID for the order.
},
"token": "", // Token for tokenized payments \(null if not used\).
"capture_method": "", // How the payment should be captured \(automatic or manual\).
"return_url": "", // URL to return to after payment completion.
"html_response": "", // HTML response data from payment gateway.
"bank_response": "", // Response data from the bank.
"last_payment_response": {
"error": "", // Indicates if there was an error \(false = success\).
"status": "", // Payment status \(e.g., "PAYMENT_CAPTURED"\).
"message": "", // Human-readable message about the request result.
"token": "" // Token for tokenized payments \(null if not used\).
},
"encryptionKey": "", // Public key for encrypting sensitive data.
"billingAddress": {}, // Billing address information \(empty if not provided\).
"routing_rules_history": [], // History of routing rules applied.
"gateway": "", // Payment gateway used \(e.g., "bank-alfalah"\).
"subscription": {}, // Subscription information \(empty if not applicable\).
"checkout_page_url": "", // URL for hosted checkout page.
"dqr_data": {} // DQR \(Dynamic QR\) data if applicable.
}
}Failed Responses
Payment Fail
json
{
"success": "", // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"data": {
"last_payment_response": {
"error": "", // Indicates if there was an error \(false = success\).
"status": "", // Payment status \(e.g., "PAYMENT_CAPTURED"\).
"message": "", // Human-readable message about the request result.
"token": "", // Token for tokenized payments \(null if not used\).
"card_details": {} // Card information object \(empty if not available\).
},
"error": "", // Indicates if there was an error \(false = success\).
"status": "", // Payment status \(e.g., "PAYMENT_CAPTURED"\).
"message": "", // Human-readable message about the request result.
"token": "", // Token for tokenized payments \(null if not used\).
"card_details": {}, // Card information object \(empty if not available\).
"account_id": "", // Account identifier for the transaction.
"versionNo": "", // Version number of the API or system.
"payment_method_types": "" // Type of payment method \(e.g., "card"\).
}
}Invalid Card
json
{
"status": "", // Payment status \(e.g., "PAYMENT_CAPTURED"\).
"message": "", // Human-readable message about the request result.
"data": [], // Container object for payment intent data.
"success": "" // Indicates if the API request was successful.
}Invalid Payment Intent
json
{
"success": "", // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"error": {
"message": "", // Human-readable message about the request result.
"statusCode": "" // HTTP status code \(e.g., 404 = Not Found\).
}
}Payment Already Captured
json
{
"success": "", // Indicates if the API request was successful.
"responseStatus": "", // Status of the response \(e.g., "OK"\).
"message": "", // Human-readable message about the request result.
"error": {
"statusCode": "", // HTTP status code \(e.g., 404 = Not Found\).
"message": "" // Human-readable message about the request result.
}
}