---
title: Simple Transaction
description: Redirect customers to airpay's payment page for completing payments.
---

In simple transaction, while making a payment the user will be redirected to airpay's payment page for completing the payment.The customer will be redirected to the success url cofigured at airpay after completing the transaction. 

**Note:** If specific payment modes are specified, only those will be visible to the customer while making a payment.

![Simple Transaction Flow](../../../../assets/simple_txn.png)

#### POST

```
https://payments.airpay.co.in/pay/v4/?token=<access_token>
```

## Request Body

| Parameter | Required | Type / Size | Description | Example |
|---|---|---|---|---|
| `orderid` | Yes | Alphanumeric (1-30) | Merchant generated transaction ID | `ORD1234` |
| `amount` | Yes | Numeric (1-10 .2) | Amount with two decimals | `100.00` |
| `currency_code` | Yes | Numeric (3) | Numeric currency code | `356` |
| `iso_currency` | Yes | String (3) | ISO currency code | `INR` |
| `buyer_email` | Yes | Email (3-50) | Buyer email address | `customer@example.com` |
| `buyer_phone` | Yes | Numeric (8-15) | Buyer phone number | `99999999` |
| `buyer_firstname` | Yes | Alphanumeric (1-50) | Buyer first name | `John` |
| `buyer_lastname` | Yes | Alphanumeric (1-50) | Buyer last name | `Doe` |
| `buyer_address` | No | Alphanumeric (1-50) | Buyer address | `711-2880 Nulla St.` |
| `buyer_city` | No | Alphanumeric (1-50) | Buyer city | `Mankato` |
| `buyer_state` | No | Alphanumeric (1-50) | Buyer state | `Mississippi` |
| `buyer_pincode` | No | Alphanumeric (4-8) | Buyer pincode | `96522` |
| `buyer_country` | No | Alphanumeric (2-50) | Buyer country | `USA` |
| `customvar` | No | Alphanumeric / Space / Equal (1-4096) | Additional information for tracking or custom processing | `1234567\|test\|ABC1234` |
| `chmod` | No | Chars | Payment modes available for the user. Leave blank to show all enabled modes.<br><br>Supported values:<br>`ppc` = Prepaid Card<br>`pg` = Payment Gateway<br>`nb` = Netbanking<br>`pgcc` = Credit Card<br>`pgdc` = Debit Card<br>`cash` = Cash<br>`emi` = EMI<br>`rtgs` = RTGS<br>`upi` = UPI<br>`btqr` = Bharat QR<br>`payltr` = Pay Later<br>`va` = Virtual Account<br>`enach` = eNACH<br>`remit` = Remittance | `pg` |
| `txnsubtype` | No | Numeric | Transaction subtype.<br><br>`1` = INR Auth-Capture<br>`2` = INR Sale Auth<br>`3` = INR Moto<br>`4` = INR Moto Auth-Capture<br>`5` = INR Sale DCC<br>`6` = INR DCC Auth-Capture<br>`7` = 3 Months EMI<br>`8` = 6 Months EMI<br>`9` = 9 Months EMI<br>`10` = 12 Months EMI<br>`11` = 18 Months EMI<br>`12` = INR Subscription<br>`13` = 24 Months EMI<br>`36` = 36 Months EMI<br>`74` = 3 Months Debit EMI<br>`75` = 6 Months Debit EMI<br>`76` = 9 Months Debit EMI<br>`77` = 12 Months Debit EMI | `2` |
| `wallet` | No | Numeric | Wallet transaction type.<br><br>`0` = Default<br>`1` = Load Consumer Wallet<br>`2` = Debit Consumer Wallet | `0` |
| `utility_biller_name` | No | Alphanumeric (2-50) | Mandatory for transactions with specific MCCs such as utilities, healthcare, education, and government payments.<br><br>Applicable MCCs: `4900`, `6012`, `6051`, `6300`, `6513`, `8011`, `8050`, `8062`, `8099`, `8111`, `8211`, `8220`, `8241`, `8244`, `8249`, `8299`, `8351`, `9311` | `Electricity Board` |
| `token` | Yes | Alphanumeric (2-30) | Token (if tokenization is enabled) | `4efaf21c79864ec154babfc494f45fd1f65a570805084965` |
| `kittype` | No | Chars | Type of integration kit being used.<br><br>Supported values:<br>`inline`<br>`iframe`<br>`server_side_sdk`<br>`mobile`<br>`cs-cart`<br>`drupal`<br>`joomla`<br>`magento`<br>`opencart`<br>`shopify`<br>`wordpress`<br>`prestashop` | `joomla` |
| `savecard` | No | Char (1) | Save card in tokenized format (`Y` / `N`) | `N` |
| `sb_nextrundate` | No | Date (20) | Next subscription date for `txnsubtype = INR-SI`.<br>Format: `MM/DD/YYYY`.<br>Date must be current date +1 (T+1). | `01/01/2025` |
| `sb_period` | No | Char (1) | Subscription period for `txnsubtype = INR-SI`.<br>Supported values: `Day`, `Week`, `Month`, `Year`, `Adhoc` | `Day` |
| `sb_frequency` | No | Numeric (1-3) | Subscription frequency | `12` |
| `sb_amount` | No | Numeric (1-10 .2) | Subscription amount | `100.00` |
| `sb_isrecurring` | No | Char (1) | Whether subscription is recurring (`Y` / `N`) | `Y` |
| `sb_recurringcount` | No | Numeric (1-3) | Subscription recurring count.<br>If value is `999`, subscription becomes never-ending (applicable for eNACH transactions). | `12` |
| `sb_retryattempts` | No | Numeric (1) | Subscription retry attempts | `3` |
| `sb_maxamount` | No | Numeric (1-10 .2) | Maximum subscription charge amount | `500.00` |
| `uid` | No | Alphanumeric (1-32) | Unique user identifier from merchant.<br>Applicable for channels: `ppc`, `nb`, `EMI` | `USER123` |
| `upi_tpv_account` | No | Numeric (12-18) | Restricts UPI payments to the linked bank account number. Payments from other accounts will be rejected. | `123456789012` |
| `upi_tpv_ifsc` | No | Alphanumeric (1-11) | IFSC code for the UPI TPV account.<br>Mandatory when `upi_tpv_account` is provided. | `SBIN0001234` |

## 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<br>SUCCESS<br>TRANSACTION IN PROCESS<br>FAILED<br>DROPPED<br>CANCEL<br>INCOMPLETE<br>BOUNCED<br>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<br>200 - Transaction is success<br>211 - Transaction is processing<br>400 - Transaction is failed<br>401 - Transaction will not register properly<br>402 - Payment that has not yet been processed<br>403 - Not received any call back from bank<br>405 - Transaction has bounced<br>503 - No records found | `200` |
| message  required | Alphanumeric | Response message received from payment gateway<br>Success Transaction is success<br>Transaction in Process Transaction in processing<br>Failed Transaction in failed<br>Dropped The transaction will not register properly<br>Cancel Payment that has not yet been processed<br>Incomplete Not recieved any call back from bank<br>Bounced The transaction has bounced<br>No Records There is no records found | `Success` |
| customer_name  optional | Alphanumeric | Customer Name | `John Doe` |
| customer_phone  optional | Alphanumeric | Customer Phone | `987654321` |
| customer_email  optional | Email | Customer Email | `customer@example.com` |
| transaction_type  optional | Numeric | Transaction Type<br>Mandate approved, Auth - 310<br>Sale - 320<br>Capture - 330<br>Refund - 340<br>Chargeback - 350<br>Reversal - 360<br>SaleComplete - 370<br>SaleAdjust - 380<br>TipAdjust - 390<br>Sale+Cash - 400<br>Cashback - 410<br>Void - 420<br>Release - 430<br>Cashwithdrawal - 440 | `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` |
| card_scheme  optional | Alphanumeric | Card issuer name, this field is available in pg |
| card_unique_code  optional | Alphanumeric | Card unique Code, this field is available in pg | `c237b1ba20f5f6cbe32f47e6db1d1d53` |
| bank_name  optional | Alphanumeric | Name of the bank, this field is available in pg | `AXIS BANK` |
| card_country  optional | Alphanumeric | Card issued country, this field is available in pg | `IND` |
| card_type  optional | Alphanumeric | Type of Card Credit/Debit/Unknown | `cc` |
| bank_response_msg  optional | Alphanumeric | Response message from the bank | `Success` |
| reason  optional | Alphanumeric | Failed Reason | `Fund` |
| ap_SecureHash  required | Alphanumeric | Secure hash generated by airpay   ``` Hash generated by : crc32(TRANSACTIONID. : .APTRANSACTIONID. : .AMOUNT. : .TRANSACTIONSTATUS. : .MESSAGE. : .MID. : .USERNAME);  ``` | `1490948220` |
| custom_var  optional | Alphanumeric<br>(`1-120`) | Any information passed in the request, which can be received in the response exactly as it was sent. We can pass multiple data in ***custom_var*** separated by the '|' symbol. | `1234567|test|ABC1234` |
| subscription_id  optional | Alphanumeric | Subscription ID, if subscription transaction |
| subscription_next_rundate  optional | Alphanumeric | subscription next run date, if subscription transaction |

## PHP

```php
<?php

   $merchant_id   = "<merchant_id>>";
   $username      = "<username>";
   $password      = "<password>";
   $secret        = "<secret>";
   $client_secret = "<client_secret>";
   $client_id     = "<client_id>";
   $secretKey     = '<secretKey>';

   $data = array();
   $data['buyer_email']     = 'customer@example.com';
   $data['buyer_phone']     = '99999999';
   $data['buyer_firstname'] = 'John';
   $data['buyer_lastname']  = 'Doe';
   $data['amount']          = '10.00';
   $data['orderid']         = 'ORD123456';
   $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>
   <html>
   <head>
   <title>airpay</title>
       <script type="text/javascript">
           function submitForm() {
               var form = document.forms[0];
               form.submit();
           }
       </script>
   </head>
   <body>
   <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/?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>

   </body>
   </html>
```

### Success Response

```json
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

```json
HTTP/1.1 200 OK
    {
     {
       "status_code":"400",
       "response_code":501,
       "status":"fail",
       "message":"Invalid Merchant Id",
       "data":[]
      }
   }
```