Skip to content

Embedded Transaction

| View as Markdown

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>
ParameterType ValueDescriptionValue Like
orderid requiredAlphanumeric
(1-30)
Merchant generated transaction idORD1234
amount requiredNumeric
(1-10 .2)
Amount with two decimals100.00
currency_code requiredNumeric
(3)
Numeric currency code356
iso_currency requiredString
(3)
ISO Currency codeinr
buyer_email requiredEmail
(3-50)
Buyer Emailcustomer@example.com
buyer_phone requiredNumeric
(8-15)
Buyer Phone99999999
buyer_firstname requiredAlphanumeric
(1-50)
Buyer First NameJohn
buyer_lastname requiredAlphanumeric
(1-50)
Buyer Last NameDoe
buyer_address optionalAlphanumeric
(1-50)
Chapman, 711-2880 Nulla St.] Buyer AddressCecilia
buyer_city optionalAlphanumeric
(1-50)
Buyer CityMankato
buyer_state optionalAlphanumeric
(1-50)
Buyer StateMississippi
buyer_pincode optionalAlphanumeric
(4-8)
Buyer Pincode96522
buyer_country optionalAlphanumeric
(2-50)
Buyer CountryUSA
customvar optionalAlphanumericSpaceEqual
(1-4096)
chmod optionalCharsPayment 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 optionalNumericTransaction 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 optionalNumericTransaction Wallet Default - 0 1 – Load consumer Wallet 2 – Debit consumer wallet
Allowed values: 0, 1{1}
0
utility_biller_name optionalAlphanumeric
(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 requiredAlphaumericPayment 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 optionalAlphanumeric
(1-32)
Unique user identifier from merchant
utr requiredAlphanumeric
(16-22)
Unique Transaction Reference No
If channel is “rtgs”
3213213124
customer_vpa requiredAlphanumeric
(1-25)
Customer Virtual Payment Address (required in UPI)test@okhdfcbank
walletflg requiredChars
(1)
If the payment is wallet (Y, N)N
billed_amount optionalNumeric
(1-10 .2)
billed amount with two decimals
surcharge_amount optionalNumeric
(1-10 .2)
Surcharge amount of this transaction (sending only if applicable)
token optionalAlphanumeric
(2-30)
Token (if token is enabled)
token_expiry optionalString
(2-30)
Token Expiry (if token is enabled)
token_cryptogram optionalStringCryptogram generated by token requestor. Only in case of channel is pg
mer_dom optionalAlphanumericBase64 encoded merchant domain.aHR0cDovL2xvY2FsaG9zdA==
bank_code optionalAlphanumeric
(1-20)
Bank Code. If channel is “ppc” or “nb” or “EMI”
emitenure optionalNumeric
(2)
EMI Tenure
If channel is “emi”
card_number requiredNumeric
(12-19)
Card Number/ or Token in case of tokenized transaction (required for pg and emi).6321***3123
card_cvv requiredNumeric
(3-4)
Card CVV (required for pg and emi)123
card_scheme optionalString
(1-50)
Card scheme (rupay,visa,mastercard etc…)
savecard optionalChars
(1)
Y – For saving card in tokenized format.
carduniquecode optionalAlphaumeric
(3-64)
Card unique code. If channel is “pg” and carduniquecode is not empty
expiry_mm requiredNumeric
(2)
Card Card Expiry Month (required for pg and emi)
expiry_yy requiredNumeric
(2)
Card Expiry Year (required for pg and emi)
sb_nextrundate optionalDate
(103)
Next subscription date (for enabling subscription)(for txnsubtype INR-SI) mm/dd/yyyy date must be current date+1 (t+1)
sb_period optionalChars
(1)
Subscription period (for enabling subscription) (for txnsubtype INR-SI) Day/Week/Month/Year/Adhoc
sb_frequency optionalNumeric
(1-3)
Subscription frequency (for enabling subscription) (for txnsubtype INR-SI)
sb_amount optionalNumeric
(1-10 .2)
Subscription amount (for enabling subscription) (for txnsubtype INR-SI)
sb_isrecurring optionalNumeric
(1)
Is subscription recurring (for enabling subscription) (for txnsubtype INR-SI)
sb_recurringcount optionalNumeric
(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 optionalNumeric
(1)
Subscription retry attempts ( for enabling subscription) (for txnsubtype INR-SI)
sb_maxamount optionalNumeric
(1-10 .2)
Maximum amount can char (for txnsubtype INR-SI)
upi_tpv_account optionalNumeric
(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 optionalAlphanumeric
(1-11)
The IFSC code of the UPI TPV account number is mandatory if the upi_tpv_account is being activated.
customer_consent requiredchars
(1)
Consent flag to be sent by Merchant.
Allowed values: Y, N
Y
ParameterType ValueDescriptionValue Like
ap_transactionid requiredNumericairpay transaction reference number11314
transaction_payment_status requiredAlphanumericTransaction payment status
SUCCESS
TRANSACTION IN PROCESS
FAILED
DROPPED
CANCEL
INCOMPLETE
BOUNCED
NO RECORDS
SUCCESS
merchant_id requiredNumericMerchant ID123356
orderid requiredAlphanumericorderid you have send to airpay systemORDER123456
txn_mode optionalAlphanumericTransaction mode LIVE or SandboxLIVE
chmod requiredAlphanumericChannel of Payment donepg
amount requiredNumericTransaction amount100.00
currency_code optionalNumericPayment Currency356
transaction_status requiredNumericTransaction 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 requiredAlphanumericResponse message received from payment gatewaySuccess
customer_name optionalAlphanumericCustomer NameJohn Doe
customer_phone optionalAlphanumericCustomer Phone987654321
customer_email optionalEmailCustomer Emailcustomer@example.com
transaction_type optionalNumericTransaction Type320
risk optionalBooleanIf the transaction is at risk 1, otherwise 0.0
billed_amount optionalNumericIncludes total amount of bill amount with two decimals110.00
token optionalAlphanumericToken string4efaf21c79864ec154babfc494f45fd1f65a570805084965
transaction_time optionalDateTransaction Time30-11-2023 12:32:59
ap_SecureHash requiredAlphanumericSecure hash generated by airpay1490948220
custom_var optionalAlphanumeric
(1-120)
Any information passed in the request, which can be received in the response exactly as it was sent.`1234567
subscription_id optionalAlphanumericSubscription ID, if subscription transaction
subscription_next_rundate optionalAlphanumericsubscription 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>
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"
}
}
HTTP/1.1 200 OK
{
{
"status_code":"400",
"response_code":501,
"status":"fail",
"message":"Invalid Merchant Id",
"data":[]
}
}