---
title: IPN Callback
description: This API is for generating Dynamic QR: QR that is generated each time for a new transaction for UPI payments.
---

# ORDER CONFIRMATION - IPN Callback

Instant Payment Notifications (IPN), or callbacks, are the way we notify you of the transaction status updates. This API will call the merchant url and return mercid, aptransaction id, amount, transaction status, merchant name, billed amount, ap_securehash, transaction id, card issuer, currency code etc if successful.

## POST

```
https://examplemerchantwebsite.eg/callback
```

## Header

| Field | Type | Description |
| --- | --- | --- |
| Content-Type | String | application/x-www-form-urlencoded |

## Success 200

| Field | Type | Description |
| --- | --- | --- |
| MERCID | Numeric | Merchant id of the Merchant in the airpay system |
| APTRANSACTIONID | Numeric | Airpay transaction reference number |
| AMOUNT | Numeric | Amount with two decimals |
| TRANSACTIONSTATUS | Numeric | Transaction Status<br>Success - 200 Transaction is success<br>Transaction in Process - 211 Transaction in processing<br>Failed - 400 Transaction in failed<br>Dropped - 401 The transaction will not register properly<br>Cancel - 402,502 payment that has not yet been processed<br>Incomplete - 403 Not recieved any call back from bank<br>Bounced - 405 The transaction has bounced<br>No Records - 503 There is no records found |
| MERCHANT_NAME | Varchar | Merchant name |
| WALLETBALANCE | Numeric | Remaining balance in wallet (only in case of wallet transactions) |
| SURCHARGE | Numeric | Additional charges for particular transaction (sending only if applicable) |
| BILLEDAMOUNT | Numeric | Billed amount |
| TERMINALID | Numeric | Terminal Id (only in case of POS transactions) |
| POSENTRYMODE | Numeric | POS entry mode (only in case of POS transactions) |
| CC_EXPIRY | Numeric | Card Expiry (only in case of POS transactions) |
| AUTHCODE | Numeric | Authentication Code (length 6)<br>In case of sale completion it is required. |
| TOKEN | Alphanumeric | Token |
| CARDUNIQUECODE | Alphanumeric | Card unique code (applicable only for pg,emi,pos,onclick ) |
| REASON | Alphanumeric | Reason |
| TRANSACTIONREASON | Alphanumeric | Transaction reason |
| CUSTOMERBANKBAL | Alphanumeric | Customer bank balance |
| CARDCOUNTRY | Alphanumeric | Card country |
| CONVERSIONRATE | Numeric | Conversion rate |
| MESSAGE | Alphanumeric | Response message received from the payment gateway |
| CUSTOMERVPA | Alphanumeric | VPA will return if channel is upi |
| ap_SecureHash | AlphaNumeric | Secure hash generated by airpay If Channel is upi,<br>Hash generated by : crc32(TRANSACTIONID. : .APTRANSACTIONID. : .AMOUNT. : .TRANSACTIONSTATUS. : .MESSAGE. : .MID. : .USERNAME. : . CUSTOMERVPA); Otherwise,<br>Hash generated by : crc32(TRANSACTIONID. : .APTRANSACTIONID. : .AMOUNT. : .TRANSACTIONSTATUS. : .MESSAGE. : .MID. : .USERNAME); |
| TRANSACTIONID | Numeric | Merchant order ID (length 1-20) |
| CUSTOMVAR | Alphanumeric|Space|Equal | Customvar value received from you |
| CHMOD | Alphanumeric | Payment channel used to make payment<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<br>wallet - Wallet<br>pos - POS<br>payltr - paylater<br>aloan - Aloan<br>aeps - AEPS |
| BANKNAME | Alphanumeric | Bank name used to do the transaction |
| CARDISSUER | Alphanumeric | Card Issuer (length 1-50) |
| CUSTOMER | Alphanumeric|Space | Customer Name |
| CUSTOMEREMAIL | Email | Customer Email customer@example.com (length 6-50) |
| CUSTOMERPHONE | Numeric|Space|Hyphen | Customer Phone (length 8-15) |
| CURRENCYCODE | Numeric | Currency Code (length 3)<br>Indian Rupee - 356 |
| RISK | Numeric | Risk Transaction (0 or 1) |
| TRANSACTIONTYPE | 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 |
| TRANSACTIONPAYMENTSTATUS | Alphanumeric | Transaction Payment Status<br>Transaction Payment Status are: SUCCESS,INCOMPLETE,FAIL,INPROCESS,Mandate Approved,AUTHORIZE,AUTHORIZATION,CAPTURE,VOIDED,RISK |
| CARD_NUMBER | Chars | Masked card number (length 12-19) |
| CARDTYPE | Alphanumeric | Card type (length 5) |
| EMITENURE | 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 |
| TRANSACTIONTIME | Alphanumeric | Transaction datetime d-m-Y H:i:s (length 11) |
## Success-Response:

```
IPN Callback Response
{
      {
         "MERCID": 45,
         "APTRANSACTIONID": 4324324,
         "AMOUNT": 1999.00,
         "TRANSACTIONSTATUS": 200,
         "MESSAGE": "Success",
         "ap_SecureHash": ,
         "TRANSACTIONID": ,
         "CUSTOMVAR": ,
         "CHMOD": "pg",
         "BANKNAME": "AXIS BANK"",
         "CARDISSUER": "AXIS",
         "CUSTOMER": "John",
         "CUSTOMEREMAIL": "customer@example.com",
         "CUSTOMERPHONE": 9898989989898,
         "CURRENCYCODE": 356,
         "RISK": "",
         "TRANSACTIONTYPE": 310,
         "TRANSACTIONPAYMENTSTATUS": "Authorize",
         "CARD_NUMBER": 989 ***** 999,
         "CARDTYPE": "cc",
         "EMITENURE": "",
         "TRANSACTIONTIME": "12-12-2020 10:10:12",
         "MERCHANT_NAME": "Akkara Industries",
         "WALLETBALANCE": 2000.00,
         "SURCHARGE": 5.00,
         "BILLEDAMOUNT": 1200.00,
         "RRN": 016153570198200,
         "TOKEN": "4efaf21c79864ec154babfc494f45fd1f65a570805084965",
         "CARDUNIQUECODE": "c237b1ba20f5f6cbe32f47e6db1d1d53",
         "REASON": "Fund",
         "CARDCOUNTRY": "IND",
         "CONVERSIONRATE": 3.68
      }
}
```

# KYC

# KYC - Add KYC

KYC- Know Your Customer. It is a process by which we can obtain information about the identity and address. The customer can add KYC related documents and details through this API.

Note: max 50 UIDs can be shared in single api call. If record already exist, existing record will be overridden and updated. Only new records will be added and existing will be updated.

post

```
https://kraken.airpay.co.in/airpay/api/addkyc.php
```

## Header

| Field | Type | Description |
| --- | --- | --- |
| Content-Type | String | application/json |

## Parameter

| Field | Type | Description |
| --- | --- | --- |
| username | String | User's username (required) |
| merchant_id | Number | Merchant ID (length 1-20) (required) |
| private_key | String | Private Key (length 10-200) (required)<br>private_key = hash('sha256', secret.'@'.username.':|:'.password) |
| checksum | String | Checksum (length 10-200) (required)<br>date = YYYY-MM-DD<br>alldata = merchant_id.private_key.kyc_data<br>Key generated by : key = hash('SHA256',username."~:~".password)<br>checksum generated by : checksum = hash('SHA256', key.'@'.alldata) |
| UID | String | Customer UID shared by merchant (required) |
| kyc_type | String | KYC type (length 2-5) (required) Customer Name - CNCustomer Email - EMPhone Number - PNDriving Licence - DLPancard - PCPassport - PP |
| kyc_number | String | KYC number (length 8-100) (required) |
| kyc_data optional | Json | KYC Data structure as follows<br>[ { "UID": "ehrjdsihogfoejroejfrjwfw9f9ewu49r4m4t9rrtj04", "kycinfo": [ { "kyc_type": "PC", "kyc_number": "321400006787" }, { "kyc_type": "PP", "kyc_number": "321400006787" } ] }, { "UID": "UID", "kycinfo": [ { "kyc_type": "DL", "kyc_number": "2938934hhh3" } ] } ]<br>SHA256 encryption logic: kychashkey = hash('SHA256',username."~:~".password);kyc_number = hash('SHA256', kychashkey.'@'.kyc_number); |

## Request-Example:

```
        {
			 	"merchant_id" : "11111",
				"private_key" : "71a4efaf21c79864ec154babfc494f45fd1f65a570805084965d5b29486f1dfe",
				"checksum" : "92c617a556982a8d124ff2b7ce9eae3e",
				"kyc_data" : "[
				  {
				    "UID": "ehrjdsihogfoejroejfrjwfw9f9ewu49r4m4t9rrtj04",
				    "kycinfo": [
				      {
				        "kyc_type": "PC",
				        "kyc_number": "321400006787"
				      },
				     {
				        "kyc_type": "PP",
				        "kyc_number": "321400006787"
				      }
				    ]
				  },
				  {
				   "UID": "UID",
				    "kycinfo": [
				      {
				        "kyc_type": "DL",
				        "kyc_number": "2938934hhh3"
				      }
				    ]
				  }
				]"
			}
```

## Success 200

| Field | Type | Description |
| --- | --- | --- |
| status | Number | Status Code |
| message | String | Status Message for<br>200 : Success, 400 : Failed |
| statusdescription | String | Description of status |

## For Success:

```
HTTP/1.1 200 OK
{

  "status": 200,
  "message": "Success",
  "statusdescription": "Success"

 }
```
## For Failure:
```
  HTTP/1.1 200 OK
  {

  "status": 400,
  "message": "Failed",
  "statusdescription": [
 {
      "ERROR": "Please provide valid merchant ID"
   },
  {
      "ERROR": "Please provide valid Private Key"
   },
 {
     "ERROR": "Please provide valid Checksum"
   }
 ]
}
```