The Check Offer Status API (check_offer_status) can be used for the following scenarios:
Environment
| Test Environment | https://test.payu.in/merchant/postservice.php?form=2 |
| Production Environment | https://info.payu.in/merchant/postservice?form=2 |
Check Merchant Specific Offers
The Check Offer Status API is used to check the status of an offer for a particular merchant when all the details are passed. The return parameters are status, msg, discount/error_code, category, offer_key, offer_type (instant or cashback), offer_availed_count and offer_remaining_count.
Request Parameters
| Parameter | Description | Sample Value |
|---|---|---|
| var1 mandatory | The offer Key must be specified in this parameter. | offer@123 |
| var2 mandatory | The payment amount of the particular transaction must be specified in this parameter. | 10000 |
| var3 optional | This parameter must contain the payment category that the merchant wants the user to see by default on the PayU’s payment page. | CC |
| var4 optional | This parameter must contain the bank code. | AMEX |
| var5 mandatory | This parameter must contain the card number. | 5432112345678901 |
| var6 optional | This parameter must contain name of the customer as on the card. | Nitesh |
| var7 optional | This parameter must contain the phone number of the customer. | 9988776655 |
| var8 optional | This parameter must contain email address of the customer. | [email protected] |
Error Codes:
- ‘INVALID_OFFER’=>’E001′
- ‘INVALID_PAYMENT_METHOD’=>’E002’
In the Output:
Parameter ‘status’ = 1, means offer is valid
Parameter ‘status’ = 0, means offer is invalid
Sample Request
curl -X POST "https://test.payu.in/merchant/postservice?form=2"
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=JP***g&command=check_offer_status&var1=offer1@7788&var2=1000&var3=CC&var4=CC&var5=5123456789012346&var6=test&var7=987654321&[email protected]&hash=862503800fbd33ac040473bc20e1b6c33b4a575893c0ec48813122f6971e8af2c24d05f1e3da32bc00e416a179f0ae4c46d330141b39d68ba22ff250167d2eb0"Sample Response
Note:In the response, the category will be the passed Category.
Success Scenario
If the offer is valid:
{
"status": 1,
"msg": "Valid offer",
"discount": 100,
"category": "creditcard",
"offer_key": "offer1@7788",
"offer_type": "instant",
"offer_availed_count": 0,
"offer_remaining_count": 0
}Failure Scenario
- If the offer has expired:
If the offer has expired
Array
(
[status] => 0
[msg] => Offer expired.
[error_code] => E001
[category] => creditcard
[offer_key] => newoffer1@5686
[offer_type] => instant
[offer_availed_count] => Unknown
[offer_remaining_count] => Unknown
)- If the card limit is exhausted:
If the card limit is exhausted
Array
(
[status] => 0
[msg] => Offer Exhausted
[error_code] => E001
[category] => creditcard
[offer_key] => newoffer1@568
[offer_type] => Unknown
[offer_availed_count] => Unknown
[offer_remaining_count => Unknown
)- If the offer_key is invalid:
If the offer_key is invalid
Array
(
[status] => 0
[msg] => Invalid offer Key
[error_code] => E001
[offer_key] => newoffer1@568
[offer_type] => Unknown
[offer_availed_count] => Unknown
[offer_remaining_count] => Unknown
)Check Card Specific Offers
The check_offer_status API is used to check the status of an offer when only the parameters Offer Key and card number are passed as input. This API is used to check the offer status when the offer is created using bin only. In this case, we can depict that the offer has been created for which category (like CC, DC, NB, or EMI). Hence, for using this API, you need to pass the Offer Key and Card Number in var1 and var5 fields as inputs and leave the remaining fields empty.
The return parameters are status, msg, error_code (In case of error), category, offer_key, offer_type (instant/cashback), offer_availed_count, ‘offer_remaining_count’.
Request Parameters
| Parameter | Description | Example |
|---|---|---|
| var1 mandatory | This parameter contains the Offer Key of the merchant. | offer@123 |
| var2 mandatory | This parameter must be contain the amount. | 10000 |
| var3 optional | This parameter must be left blank. | – |
| var4 optional | This parameter must be left blank. | – |
| var5 mandatory | This parameter must contain the card number. | 5432112345678901 |
Error Codes
- ‘INVALID_OFFER’=>’E001′
- ‘INVALID_PAYMENT_METHOD’=>’E002’
In the Output:
- Parameter ‘status’ = 1, means offer is valid
- Parameter ‘status’ = 0, means offer is invalid
Sample Request
curl -X POST "https://test.payu.in/merchant/postservice?form=2"
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=JP***g&command=check_offer_status&var1=offer1@7788&var2=&var3=&var4=&var5=512345&hash=862503800fbd33ac040473bc20e1b6c33b4a575893c0ec48813122f6971e8af2c24d05f1e3da32bc00e416a179f0ae4c46d330141b39d68ba22ff250167d2eb0"Sample Response
Note:In the response, the category will be the passed Category.
Success Scenario
If the offer is valid:
{
"status": 1,
"msg": "Valid offer",
"discount": 100,
"category": "creditcard",
"offer_key": "offer1@7788",
"offer_type": "instant",
"offer_availed_count": 0,
"offer_remaining_count": 0
}Failure Scenario
- If the offer has expired:
If the offer has expired
Array
(
[status] => 0
[msg] => Offer expired.
[error_code] => E001
[category] => creditcard
[offer_key] => newoffer1@5686
[offer_type] => instant
[offer_availed_count] => Unknown
[offer_remaining_count] => Unknown
)- If the card limit is exhausted:
If the card limit is exhausted
Array
(
[status] => 0
[msg] => Offer Exhausted
[error_code] => E001
[category] => creditcard
[offer_key] => newoffer1@568
[offer_type] => Unknown
[offer_availed_count] => Unknown
[offer_remaining_count => Unknown
)- If the offer_key is invalid:
If the offer_key is invalid
Array
(
[status] => 0
[msg] => Invalid offer Key
[error_code] => E001
[offer_key] => newoffer1@568
[offer_type] => Unknown
[offer_availed_count] => Unknown
[offer_remaining_count] => Unknown
)