Embedded Transaction
In embedded (directindex) transactions, the user will be selecting the payment option on the merchant’s page itself instead of being redirected to AirPay’s payment page for completing the payment.
https://payments.airpay.co.in/pay/v4/embedded/?token=<access_token>Request Body
Section titled “Request Body”| Parameter | Type Value | Description | Value Like |
|---|---|---|---|
| orderid required | Alphanumeric (1-30) | Merchant generated transaction id | ORD1234 |
| amount required | Numeric (1-10 .2) | Amount with two decimals | 100.00 |
| currency_code required | Numeric (3) | Numeric currency code | 356 |
| iso_currency required | String (3) | ISO Currency code | inr |
| buyer_email required | Email (3-50) | Buyer Email | customer@example.com |
| buyer_phone required | Numeric (8-15) | Buyer Phone | 99999999 |
| buyer_firstname required | Alphanumeric (1-50) | Buyer First Name | John |
| buyer_lastname required | Alphanumeric (1-50) | Buyer Last Name | Doe |
| buyer_address optional | Alphanumeric (1-50) | Chapman, 711-2880 Nulla St.] Buyer Address | Cecilia |
| buyer_city optional | Alphanumeric (1-50) | Buyer City | Mankato |
| buyer_state optional | Alphanumeric (1-50) | Buyer State | Mississippi |
| buyer_pincode optional | Alphanumeric (4-8) | Buyer Pincode | 96522 |
| buyer_country optional | Alphanumeric (2-50) | Buyer Country | USA |
| customvar optional | Alphanumeric | Space | Equal (1-4096) |
| chmod optional | Chars | Payment Mode ppc - prepaid card pg - payment gateway nb - Netbanking pgcc - Credit card pgdc - Debit card cash - Cash emi - EMI rtgs - RTGS upi - UPI btqr - Bharat QR payltr - Pay later va - Virtual account enach - eNACH remit - Remittance Allowed values: pg, ppc, nb, pgcc, pgdc, cash, emi, rtgs, upi, btqr, payltr, va, enach, remit | pg |
| txnsubtype optional | Numeric | Transaction SubType, type of transaction. Allowed values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 74, 75, 76, 77 | 2 |
| wallet optional | Numeric | Transaction Wallet Default - 0 1 – Load consumer Wallet 2 – Debit consumer wallet Allowed values: 0, 1{1} | 0 |
| utility_biller_name optional | Alphanumeric (2-50) | The Utility Biller Name parameter shall be mandatory for transactions with the following Merchant Category Codes (MCCs): 4900, 6012, 6051, 6300, 6513, 8011, 8050, 8062, 8099, 8111, 8211, 8220, 8241, 8244, 8249, 8299, 8351, 9311. | |
| channel required | Alphaumeric | Payment Type pg - pg nb - net banking ppc - Wallet(ppc) rtgs - RTGS emi - EMI upi - UPI cash - cash virtual-acc - Virtual Account Allowed values: pg, nb, ppc, rtgs, emi, upi, cash, virtual-acc{2-11} | pg |
| uid optional | Alphanumeric (1-32) | Unique user identifier from merchant | |
| utr required | Alphanumeric (16-22) | Unique Transaction Reference No If channel is “rtgs” | 3213213124 |
| customer_vpa required | Alphanumeric (1-25) | Customer Virtual Payment Address (required in UPI) | test@okhdfcbank |
| walletflg required | Chars (1) | If the payment is wallet (Y, N) | N |
| billed_amount optional | Numeric (1-10 .2) | billed amount with two decimals | |
| surcharge_amount optional | Numeric (1-10 .2) | Surcharge amount of this transaction (sending only if applicable) | |
| token optional | Alphanumeric (2-30) | Token (if token is enabled) | |
| token_expiry optional | String (2-30) | Token Expiry (if token is enabled) | |
| token_cryptogram optional | String | Cryptogram generated by token requestor. Only in case of channel is pg | |
| mer_dom optional | Alphanumeric | Base64 encoded merchant domain. | aHR0cDovL2xvY2FsaG9zdA== |
| bank_code optional | Alphanumeric (1-20) | Bank Code. If channel is “ppc” or “nb” or “EMI” | |
| emitenure optional | Numeric (2) | EMI Tenure If channel is “emi” | |
| card_number required | Numeric (12-19) | Card Number/ or Token in case of tokenized transaction (required for pg and emi). | 6321***3123 |
| card_cvv required | Numeric (3-4) | Card CVV (required for pg and emi) | 123 |
| card_scheme optional | String (1-50) | Card scheme (rupay,visa,mastercard etc…) | |
| savecard optional | Chars (1) | Y – For saving card in tokenized format. | |
| carduniquecode optional | Alphaumeric (3-64) | Card unique code. If channel is “pg” and carduniquecode is not empty | |
| expiry_mm required | Numeric (2) | Card Card Expiry Month (required for pg and emi) | |
| expiry_yy required | Numeric (2) | Card Expiry Year (required for pg and emi) | |
| sb_nextrundate optional | Date (103) | Next subscription date (for enabling subscription)(for txnsubtype INR-SI) mm/dd/yyyy date must be current date+1 (t+1) | |
| sb_period optional | Chars (1) | Subscription period (for enabling subscription) (for txnsubtype INR-SI) Day/Week/Month/Year/Adhoc | |
| sb_frequency optional | Numeric (1-3) | Subscription frequency (for enabling subscription) (for txnsubtype INR-SI) | |
| sb_amount optional | Numeric (1-10 .2) | Subscription amount (for enabling subscription) (for txnsubtype INR-SI) | |
| sb_isrecurring optional | Numeric (1) | Is subscription recurring (for enabling subscription) (for txnsubtype INR-SI) | |
| sb_recurringcount optional | Numeric (1-3) | Subscription Recurring Count (for enabling subscription and Is Subscription Recurring is Yes , if recurring count is 999 than subscription is set as never ending end date its apply only for enach transaction) (for txnsubtype INR-SI) | |
| sb_retryattempts optional | Numeric (1) | Subscription retry attempts ( for enabling subscription) (for txnsubtype INR-SI) | |
| sb_maxamount optional | Numeric (1-10 .2) | Maximum amount can char (for txnsubtype INR-SI) | |
| upi_tpv_account optional | Numeric (12-18) | Bank Account number passed within this parameter will be used for restricting the Payments accepted to the UPI Account linked with mentioned bank account number. Any other Bank account used to complete the UPI transaction will be rejected. Please contact the airpay support team to enable this. | |
| upi_tpv_ifsc optional | Alphanumeric (1-11) | The IFSC code of the UPI TPV account number is mandatory if the upi_tpv_account is being activated. | |
| customer_consent required | chars (1) | Consent flag to be sent by Merchant. Allowed values: Y, N | Y |
Success 200
Section titled “Success 200”| Parameter | Type Value | Description | Value Like |
|---|---|---|---|
| ap_transactionid required | Numeric | airpay transaction reference number | 11314 |
| transaction_payment_status required | Alphanumeric | Transaction payment status SUCCESS TRANSACTION IN PROCESS FAILED DROPPED CANCEL INCOMPLETE BOUNCED NO RECORDS | SUCCESS |
| merchant_id required | Numeric | Merchant ID | 123356 |
| orderid required | Alphanumeric | orderid you have send to airpay system | ORDER123456 |
| txn_mode optional | Alphanumeric | Transaction mode LIVE or Sandbox | LIVE |
| chmod required | Alphanumeric | Channel of Payment done | pg |
| amount required | Numeric | Transaction amount | 100.00 |
| currency_code optional | Numeric | Payment Currency | 356 |
| transaction_status required | Numeric | Transaction Payment Status 200 - Transaction is success 211 - Transaction is processing 400 - Transaction is failed 401 - Transaction will not register properly 402 - Payment that has not yet been processed 403 - Not received any call back from bank 405 - Transaction has bounced 503 - No records found | 200 |
| message required | Alphanumeric | Response message received from payment gateway | Success |
| customer_name optional | Alphanumeric | Customer Name | John Doe |
| customer_phone optional | Alphanumeric | Customer Phone | 987654321 |
| customer_email optional | Customer Email | customer@example.com | |
| transaction_type optional | Numeric | Transaction Type | 320 |
| risk optional | Boolean | If the transaction is at risk 1, otherwise 0. | 0 |
| billed_amount optional | Numeric | Includes total amount of bill amount with two decimals | 110.00 |
| token optional | Alphanumeric | Token string | 4efaf21c79864ec154babfc494f45fd1f65a570805084965 |
| transaction_time optional | Date | Transaction Time | 30-11-2023 12:32:59 |
| ap_SecureHash required | Alphanumeric | Secure hash generated by airpay | 1490948220 |
| custom_var optional | Alphanumeric ( 1-120) | Any information passed in the request, which can be received in the response exactly as it was sent. | `1234567 |
| subscription_id optional | Alphanumeric | Subscription ID, if subscription transaction | |
| subscription_next_rundate optional | Alphanumeric | subscription next run date, if subscription transaction |
<?php$merchant_id = "<merchant_id>";$username = "<username>";$password = "<password>";$secret = "<secret>";$secretKey = '<secretKey>';$data = array();$data['buyer_email'] = 'customer@example.com';$data['buyer_phone'] = '99999999';$data['buyer_firstname'] = 'John';$data['buyer_lastname'] = 'Doe';$data['buyer_address'] = 'Cecilia Chapman, 711-2880 Nulla St.';$data['buyer_city'] = 'Mankato';$data['buyer_state'] = 'Mississippi';$data['buyer_country'] = 'USA';$data['buyer_pincode'] = '96522';$data['orderid'] = 'ORD123456';$data['amount'] = '10.00';$data['channel'] = 'pg';$data['bank_code'] = 'XYZ';$data['currency_code'] = '356';$data['iso_currency'] = 'inr';
$privatekey = hash('sha256', $secret . '@' . $username . ':|:' . $password);$encdata = encrypt(json_encode($data), $secretKey);$checksum = checksum($data);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3./org/1999/xhtml">
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>airpay</title> <script type="text/javascript"> function submitForm() { var form = document.forms[0]; form.submit(); } </script></head>
<body onload="javascript:submitForm()"> <center> <table width="500px;"> <tr> <td align="center" valign="middle">Do Not Refresh or Press Back <br /> Redirecting to airpay</td> </tr> <tr> <td align="center" valign="middle"> <form action="https://payments.airpay.co.in/pay/v4/embedded/?token=<token>" method="#### POST"> <input type="hidden" name="privatekey" value="<?php echo $privatekey; ?>"> <input type="hidden" name="merchant_id" value="<?php echo $merchant_id; ?>"> <input type="hidden" name="encdata" value="<?php echo $encdata; ?>"> <input type="hidden" name="checksum" value="<?php echo $checksum; ?>"> </form> </td>
</tr>
</table>
</center></body>
</html>Success Response
Section titled “Success Response”HTTP/1.1 200 OK { "status_code":"200", "status":"success", "response_code":"00", "message":"Success", "data": { "transaction_payment_status":"SUCCESS", "merchant_id":"123356", "orderid":"ORDER123456", "ap_transactionid":"11314", "txn_mode":"LIVE", "chmod":"pg", "amount":"100.00", "currency_code":"356", "transaction_status":200, "message":"Success", "bank_response_msg":"Success", "customer_name":"John Doe", "customer_phone":"987654321", "customer_email":"customer@example.com", "transaction_type":320, "risk":"0", "customvar":"0", "token":"", "uid":"U123", "transaction_time":"30-11-2023 12:32:59", "surcharge_amount":"51.41", "card_scheme": "visa" "card_number": "462294XXXXXX3713" "carduniquecode": "SLzvR9xdUuLvG0EgnqYxOqUA2g6gi7Fi" "bank_name": "anz bank" "card_country": "australia" "card_type": "Credit" "token":"446FVcGpJbhmlNH4KyFl2He8nblrfeUk" "ap_SecureHash":"1490948220" } }Error Response
Section titled “Error Response”HTTP/1.1 200 OK { { "status_code":"400", "response_code":501, "status":"fail", "message":"Invalid Merchant Id", "data":[] } }