---
title: IPN Callback
description: Receive instant payment notifications with transaction status updates.
---

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

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

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| merchant_id  required | Numeric | Merchant id of the Merchant in the airpay system | `45` |
| ap_transactionid  required | Numeric | airpay transaction reference number | `4324324` |
| amount  required | Numeric | Amount with two decimals | `1999.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 | Varchar | Merchant name | `Akkara Industries` |
| wallet_balance  optional | Numeric | Remaining balance in wallet (only in case of wallet transactions) | `2000.00` |
| surcharge_amount  optional | Numeric | Additional charges for particular transaction (sending only if applicable) | `5.00` |
| billed_amount  optional | Numeric | Billed amount | `1200.00` |
| 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) |
| auth_id  optional | Numeric<br>(`6`) | Authentication Code<br>In case of sale completion it is required. |
| token  optional | Alphanumeric | Token |
| carduniquecode  optional | Alphanumeric | Card unique code (applicable only for pg,emi,pos,onclick ) |
| reason  optional | Alphanumeric | Reason |
| transaction_reason  optional | Alphanumeric | Transaction reason |
| card_country  optional | Alphanumeric | Card country |
| conversion_rate  optional | Numeric | Conversion rate |
| message  required | Alphanumeric | Response message received from the payment gateway | `Transaction success` |
| customer_vpa  optional | Alphanumeric | VPA will return if channel is upi |
| ap_SecureHash  required | AlphaNumeric | Secure hash generated by airpay<br>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); | `1490948220` |
| orderid  required | Numeric | Merchant order ID (length 1-20) |
| customvar  optional | Alphanumeric | Customvar value received from you |
| chmod  required | 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 | `pg` |
| bank_name  optional | Alphanumeric | Bank name used to do the transaction |
| card_scheme  optional | Alphanumeric | Card Issuer (length 1-50) |
| customer_name  optional | Alphanumeric | Customer Name |
| customer_email  optional | Email | Customer Email customer@example.com (length 6-50) |
| customer_phone  optional | Numeric | Customer Phone (length 8-15) |
| currency_code  optional | Numeric | Currency Code (length 3) | `356` |
| risk  optional | Numeric | Risk Transaction (0 or 1) |
| 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<br>Awaiting Confirmation - 450 |
| 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` |
| card_number  optional | Chars | Masked card number (length 12-19) |
| card_type  optional | Alphanumeric | Card type (length 5) |
| 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 |
| transaction_time  optional | Alphanumeric | Transaction datetime d-m-Y H:i:s (length 11) |

### Success Response

```json
IPN Callback Response
    {
         "merchant_id": 45,
         "ap_transactionid": 4324324,
         "amount": 1999.00,
         "transaction_status": 200,
         "message": "Success",
         "ap_SecureHash": ,
         "orderid": "ORDER123",
         "customvar": ,
         "chmod": "pg",
         "bank_name": "AXIS BANK"",
         "customer_name": "John",
         "customer_email": "customer@example.com",
         "customer_phone": 9898989989898,
         "currency_code": 356,
         "risk": "0",
         "transaction_type": 310,
         "transaction_payment_status": "Authorize",
         "card_number": 989 ***** 999,
         "card_type": "cc",
         "transaction_time": "12-12-2023 10:10:12",
         "merchant_name": "Akkara Industries",
         "wallet_balance": 2000.00,
         "surcharge_amount": 5.00,
         "billed_amount": 1200.00,
         "rrn": 016153570198200,
         "token": "4efaf21c79864ec154babfc494f45fd1f65a570805084965",
         "card_unique_code": "c237b1ba20f5f6cbe32f47e6db1d1d53",
         "reason": "Fund",
         "card_country": "IND",
         "conversion_rate": 3.68
    }
```