---
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.Supported values:`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 | `pg` |
| `txnsubtype` | No | Numeric | Transaction subtype.`1` = INR Auth-Capture`2` = INR Sale Auth`3` = INR Moto`4` = INR Moto Auth-Capture`5` = INR Sale DCC`6` = INR DCC Auth-Capture`7` = 3 Months EMI`8` = 6 Months EMI`9` = 9 Months EMI`10` = 12 Months EMI`11` = 18 Months EMI`12` = INR Subscription`13` = 24 Months EMI`36` = 36 Months EMI`74` = 3 Months Debit EMI`75` = 6 Months Debit EMI`76` = 9 Months Debit EMI`77` = 12 Months Debit EMI | `2` |
| `wallet` | No | Numeric | Wallet transaction type.`0` = Default`1` = Load Consumer Wallet`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.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.Supported values:`inline``iframe``server_side_sdk``mobile``cs-cart``drupal``joomla``magento``opencart``shopify``wordpress``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`.Format: `DD/MM/YYYY`.Date must be current date +1 (T+1). | `01/01/2025` |
| `sb_period` | No | Char (1) | Subscription period for `txnsubtype = INR-SI`.Supported values: D - Day, W - Week, M - Month, Y - Year, A - Adhoc| `D` |
| `sb_frequency` | No | Numeric (1-3) | Subscription frequency | `12` |
| `sb_amount` | No | Numeric (1-10 .2) | Subscription amount | `100.00` |
| `sb_isrecurring` | No | Numeric (1) | Is subscription recurring (for enabling subscription) (for txnsubtype INR-SI) (`1` / `0`) | `1` |
| `sb_recurringcount` | No | Numeric (1-3) | Subscription recurring count.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.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.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 statusSUCCESSTRANSACTION IN PROCESSFAILEDDROPPEDCANCELINCOMPLETEBOUNCEDNO 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 Status200 - Transaction is success211 - Transaction is processing400 - Transaction is failed401 - Transaction will not register properly402 - Payment that has not yet been processed403 - Not received any call back from bank405 - Transaction has bounced503 - No records found | `200` |
| message  required | Alphanumeric | Response message received from payment gatewaySuccess Transaction is successTransaction in Process Transaction in processingFailed Transaction in failedDropped The transaction will not register properlyCancel Payment that has not yet been processedIncomplete Not recieved any call back from bankBounced The transaction has bouncedNo 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 TypeMandate approved, Auth - 310Sale - 320Capture - 330Refund - 340Chargeback - 350Reversal - 360SaleComplete - 370SaleAdjust - 380TipAdjust - 390Sale+Cash - 400Cashback - 410Void - 420Release - 430Cashwithdrawal - 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);  ```  If chmod is UPI, then ap_SecureHash is ``` Hash generated by : crc32(TRANSACTIONID. : .APTRANSACTIONID. : .AMOUNT. : .TRANSACTIONSTATUS. : .MESSAGE. : .MID. : .USERNAME. : .CUSTOMER_VPA);  ``` | `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. 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"
      "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":[]
      }
   }
```