---
title: Order Confirmation
description: Pull transaction status updates from the airpay system after order confirmation.
---

This API can PULL transaction updates like transaction status to the merchant host after the order is confirmed. This API will work only on live MID, for the sandbox MID this API will not work.

#### POST

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

## Header

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| Content-Type  required | String | The Content-Type header indicates the media type of the request or response body so the receiver knows how to process the data. | `application/x-www-form-urlencodeds` |

## Request Body

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| orderid  optional | Alphanumeric  <br>(1-30) | Merchant generated transaction id. (Either orderid or ap_transactionid or rrn is required) | `ORD12345` |
| ap_transactionid  optional | Alphanumeric | airpay transaction id. (Either orderid or ap_transactionid or rrn is required) | `123456` |
| rrn  optional | Numeric | Retrieval Reference Number. (Either orderid or ap_transactionid or rrn is required) | `556677` |
| terminal_id  optional | Numeric  <br>(8) | POS terminal id |
| txn_type  optional | Alphanumeric | Type of transaction. e.g. pos |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| ap_transactionid  required | Numeric | airpay transaction reference number | `11314` |
| merchant_id  required | Numeric | Merchant ID | `123356` |
| orderid  required | Alphanumeric | orderid you have send to airpay system | `ORDER123456` |
| amount  required | Numeric | Transaction amount | `100.00` |
| 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` |
| merchant_name  optional | Alphanumeric | Response message received from payment gateway |
| wallet_balance  optional | Alphanumeric | Remaining balance in wallet (only in case of wallet transactions) |
| surcharge_amount  optional | Alphanumeric | Additional charges for particular transaction (sending only if applicable) |
| settlement_date  optional | Date | Settlement Date |
| billed_amount  optional | Numeric | Billed amount |
| terminal_id  optional | Numeric | Terminal Id (only in case of POS transactions) |
| pos_entry_mode  optional | Numeric | POS entry mode (only in case of POS transactions) |
| cc_expiry  optional | Numeric | Card Expiry (only in case of POS transactions) |
| rrn  optional | Alphanumeric | RRN<br>In case of sale completion it is required. |
| message  required | Alphanumeric | Response message received from payment gateway | `Success` |
| chmod  required | Alphanumeric | Chanel of Payment done | `pg` |
| bank_name  optional | Alphanumeric | Name of the bank, this field is available in pg |
| token  optional | Alphanumeric | Token |
| carduniquecode  optional | Alphanumeric | Card unique code (applicable only for pg,emi,pos,onclick ) |
| bank_response_msg  optional | Alphanumeric | Response message from the bank |
| reason  optional | Alphanumeric | Failed Reason |
| transaction_reason  optional | Alphanumeric | Transaction reason |
| customer_bank_balance  optional | Alphanumeric | Customer bank balance |
| customer_name  optional | Alphanumeric | Customer Name |
| customer_phone  optional | Alphanumeric | Customer Phone |
| customer_email  optional | Email | Customer Email |
| customer_vpa  optional | Alphanumeric | VPA will return if channel is upi |
| risk  optional | Boolean | If the transaction is at risk 1, otherwise 0. |
| currency_code  optional | Numeric | Payment Currency<br>Indian Rupee - 356 | `356` |
| transaction_type  optional | Numeric | Transaction Type (length 3)<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<br>Awaiting Confirmation - 450 |
| transaction_time  optional | Date | Transaction Time |
| subscription_id  optional | Numeric | subscription id if enabled subscription |
| subscription_next_rundate  optional | Date | Next subscription date if subscription transaction |
| campaign_id  optional | Numeric | Campaign ID |
| campaign_title  optional | Alphanumeric | Campaign Title |
| campaign_discount  optional | Numeric | Campaign Discount |
| charged_amount  optional | Numeric | Amount Charged |
| auth_id  optional | Numeric | Authentication ID |
| ipn_id  optional | Numeric | IPN request ID |
| transaction_payment_status  required | Alphanumeric | Transaction payment status<br>Transaction Payment Status are: SUCCESS,INCOMPLETE,FAIL,INPROCESS,Mandate Approved,AUTHORIZE,AUTHORIZATION,CAPTURE,VOIDED,RISK | `SUCCESS` |
| card_number  optional | Char | Masked card number (length 12-19)\ |
| card_country  optional | Alphanumeric | Card issued country, this field is available in pg |
| card_type  optional | Alphanumeric | Type of Card Credit/Debit/Unknown |
| card_scheme  optional | Alphanumeric | Card issuer name, this field is available in pg |
| emi_tenure  optional | Numeric | EMI Tenure (length 2)<br>3 Months - 3<br>6 Months - 6<br>9 Months - 9<br>12 Months - 12<br>18 Months - 18<br>24 Months - 24 |
| conversion_rate  optional | Numeric | Conversion rate |
| ap_SecureHash  required | Alphanumeric | Secure hash generated by airpay | `1490948220` |
| customvar  optional | Alphanumeric | Any information passed in the request, which can be received in the response exactly as it was sent. We can pass multiple data in 'CustomVar' separated by the '|' symbol. Eg: 1234567|test|ABC1234 (length 120 max) |
| original_currency  optional | Numeric | Original currency |
| original_fxrate  optional | Numeric | Foreign currency exchange rate |
| utr_no  optional | Alphanumeric | Unique Transaction Reference No (length 16-22) |

## PHP

```php
 <?php
$merchant_id   = "<merchant_id>";
$username      = "<username>";
$password      = "<password>";
$secret        = "<secret>";
$secretKey     = '<secretKey>';
$data = array();
$data['orderid'] = "ORD123456";
$data['ap_transactionid'] = "12345678";
$data['rrn'] = "556677";

$privatekey = hash('sha256', $secret.'@'.$username.':|:'.$password);
$encdata	   = encrypt(json_encode($data), $secretKey);
$checksum   = checksum($data);

$payload    = [
                'merchant_id'=>$merchant_id,
	            'encdata' => $encdata,
	            'checksum' => $checksum,
                'privatekey' => $privatekey
              ];

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://kraken.airpay.co.in/pay/v4/api/verify/?token=<token>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $payload
));

$result = curl_exec($curl);

curl_close($curl);
$response = json_decode($result)->response;
?>
```

### 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":[]
      }
   }
```