SKU-Based Offer using Merchant Hosted Checkout

After you create a SKU-based offer on PayU Dashboard, you can start collecting payments for products with SKU-based offer. For more information on creating a SKU-based offer, refer to Create a SKU-Based Offer.

📘

Note:

For payment journey of instant discount offers using Merchant Hosted Checkout, refer to Instant Discount or Cashback using Merchant Hosted Checkout.

Steps to integrate

  1. Fetch offers
  2. Validate offer
  3. Payment request
  4. Check the response from PayU

Step 1: Fetch offers

Additional request parameter skusDetail for SKU

In addition to the request parameters listed in the Fetch Offers API section, the skusDetail parameter is posted with the following fields are posted in an array:

FieldDescription
skuAmount
optional
String The price of one/ single unit of SKU is specified in this field.
skuId
mandatory
String The product identifier to select offer is specified in this field.
quantity

optional
String The quantity for the product is specified in this field.****
offerKeys
optional
_String The offer keys to filter at SKU-level is specified in this field.

skusDetail parameter in sample request

The sample request posted will include the skusDetail parameter similar to the following:

"skusDetail": [
    {
      "skuAmount": 600,
      "quantity": 3,
      "skuId": "123",
      "offerKeys": null
    }

Sample Response

Back to Home
Introduction
Types of Offers
Getting Started
Create an Offer
PayU Hosted Checkout Integration
Merchant Hosted Checkout Integration
Instant Discount Offer
SKU-Based Offer
Offers API
Fetch Offer API
Validate Offer API
Manage Existing Offers
View Performance Details
Complete a Draft
Update an Offer
Pause an Offer
Resume a Paused Offer
Clone an Offer
Deactivate an Offer
Offers Error Codes
Refunds for Offers
Search
API Reference
Plugins
Web Checkout
API Playground
Offers Integration/Merchant Hosted Checkout Integration/SKU-Based Offer
Collect Payments with SKU-Based Offer using Merchant Hosted Checkout
After you create a SKU-based offer on PayU Dashboard, you can start collecting payments for products with SKU-based offer. For more information on creating a SKU-based offer, refer to Add a SKU-Based Offer.

Note: For payment journey of instant discount offers using Merchant Hosted Checkout, refer to Merchant Hosted Checkout Integration with Offers.

Steps to Integrate:
Fetch Offers
Validate Offer
Payment Request
Check Response from PayU
Step 1: Fetch Offers
Additional Request Parameter skusDetail for SKU
In addition to the request parameters listed in the Fetch Offers API section, the skusDetail parameter is posted with the following fields are posted in an array:

Field	Description
skuAmount
optional
String The price of one/ single unit of SKU is specified in this field.
skuId
mandatory
String The product identifier to select offer is specified in this field.
quantity

optional
String The quantity for the product is specified in this field.
offerKeys

optional
StringThe offer keys to filter at SKU-level is specified in this field.
skusDetail in Sample Request
The sample request posted will include the skusDetail parameter similar to the following:

Markup
"skusDetail": [
    {
      "skuAmount": 600,
      "quantity": 3,
      "skuId": "123",
      "offerKeys": null
    }
Sample Response
 "skusDetail": {
      "skus": [
        {
          "skuId": "123",
          "quantity": 3,
          "skuAmount": 600,
          "offers": [
            {
              "offerKey": "SummerSpecialOffer2021@q1Bh0jsogwqP",
              "type": "MERCHANT",
              "title": "festive_500",
              "description": "festive discount",
              "tnc": "abc",
              "tncLink": "abcd",
              "minTxnAmount": 198,
              "maxTxnAmount": 2000,
              "offerType": "INSTANT",
              "validFrom": "2022-02-28 12:56:11",
              "validTo": "2022-12-28 12:57:16",
              "discountDetail": {
                "discountType": "PERCENTAGE",
                "discountPercentage": 10,
                "discount": 180,
                "discountedAmount": 1620,
                "maxDiscount": 100
              },
              "isNoCostEmi": false,
              "isSubvented": true,
              "isSkuOffer": true,
              "creditCard": [
                {
                  "networks": [
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    },
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    },
                    {
                      "code": "ICICI",
                      "title": "Icici Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "debitCard": [
                {
                  "networks": [
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    },
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "netBanking": [
                {
                  "title": "AXIS Bank",
                  "paymentCode": "AXIB"
                },
                {
                  "title": "Canara Bank",
                  "paymentCode": "CABB"
                },
                {
                  "title": "Bank of India",
                  "paymentCode": "BOIB"
                }
              ],
              "wallet": [
                {
                  "title": "Freecharge PayLater | UPI | Wallet",
                  "paymentCode": "FREC"
                },
                {
                  "title": "Jio Money",
                  "paymentCode": "JIOM"
                }
              ],
              "upi": [
                {
                  "title": "upi",
                  "paymentCode": "UPI"
                }
              ],
              "emi": {
                "debitCard": null,
                "creditCard": {
                  "banks": [
                    {
                      "bankCode": "CITI",
                      "tenureOption": [
                        {
                          "title": "Citibank 9 Months",
                          "paymentCode": "EMI09",
                          "discountDetail": null
                        },
                        {
                          "title": "Citibank 6 Months",
                          "paymentCode": "EMI06",
                          "discountDetail": null
                        }
                      ]
                    },
                    {
                      "bankCode": "HDFC",
                      "tenureOption": [
                        {
                          "title": "HDFC Bank 12 Months",
                          "paymentCode": "EMI12",
                          "discountDetail": null
                        }
                      ]
                    }
                  ]
                }
              },
              "skuDetail": {
                "skuId": "123",
                "skuName": "Samsung S20",
                "minQuantity": 3,
                "maxQuantity": 10
              },
              "isAcrossSkuQuantity": false
            },
            {
              "offerKey": "SamsungBrandOffer2022@Qpzkc7zWouLm",
              "type": "BANK",
              "title": "Samsung Brand  Offer 2022",
              "description": "10% Instant discount",
              "tnc": "Discount will be applied instantly after applying coupon code",
              "tncLink": "www.icicibank/offer/t&c",
              "minTxnAmount": 500,
              "maxTxnAmount": 2000,
              "offerType": "INSTANT",
              "validFrom": "2022-02-07 15:53:16",
              "validTo": "2022-12-13 15:53:16",
              "discountDetail": {
                "discountType": "ABSOLUTE",
                "discountPercentage": 20,
                "discount": 100,
                "discountedAmount": 1700,
                "maxDiscount": 100
              },
              "isNoCostEmi": false,
              "isSubvented": true,
              "isSkuOffer": true,
              "creditCard": [
                {
                  "networks": [
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    },
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "ICICI",
                      "title": "Icici Bank"
                    },
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "debitCard": [
                {
                  "networks": [
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    },
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    },
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "netBanking": [
                {
                  "title": "Canara Bank",
                  "paymentCode": "CABB"
                },
                {
                  "title": "AXIS Bank",
                  "paymentCode": "AXIB"
                },
                {
                  "title": "Bank of India",
                  "paymentCode": "BOIB"
                }
              ],
              "wallet": [
                {
                  "title": "Jio Money",
                  "paymentCode": "JIOM"
                },
                {
                  "title": "Freecharge PayLater | UPI | Wallet",
                  "paymentCode": "FREC"
                }
              ],
              "upi": [
                {
                  "title": "upi",
                  "paymentCode": "UPI"
                }
              ],
              "emi": {
                "debitCard": {
                  "banks": [
                    {
                      "bankCode": "UTIB",
                      "tenureOption": [
                        {
                          "title": "Axis Bank 18 Months",
                          "paymentCode": "AXISD18",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 9 Months",
                          "paymentCode": "AXISD09",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 12 Months",
                          "paymentCode": "AXISD12",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 24 Months",
                          "paymentCode": "AXISD24",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 3 Months",
                          "paymentCode": "AXISD03",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 6 Months",
                          "paymentCode": "AXISD06",
                          "discountDetail": null
                        }
                      ]
                    }
                  ]
                },
                "creditCard": {
                  "banks": [
                    {
                      "bankCode": "CITI",
                      "tenureOption": [
                        {
                          "title": "Citibank 3 Months",
                          "paymentCode": "EMI03",
                          "discountDetail": null
                        },
                        {
                          "title": "Citibank 6 Months",
                          "paymentCode": "EMI06",
                          "discountDetail": null
                        },
                        {
                          "title": "Citibank 3 Months",
                          "paymentCode": "EMI03",
                          "discountDetail": null
                        }
                      ]
                    },
                    {
                      "bankCode": "HDFC",
                      "tenureOption": [
                        {
                          "title": "HDFC Bank 12 Months",
                          "paymentCode": "EMI12",
                          "discountDetail": null
                        }
                      ]
                    }
                  ]
                }
              },
              "skuDetail": {
                "skuId": "123",
                "skuName": "Samsung S20",
                "minQuantity": 3,
                "maxQuantity": 100
              },
              "isAcrossSkuQuantity": true
            }
          ]
        }
      ]
    }
  }
 "skusDetail": {
      "skus": [
        {
          "skuId": "123",
          "quantity": 3,
          "skuAmount": 600,
          "offers": [
            {
              "offerKey": "SummerSpecialOffer2021@q1Bh0jsogwqP",
              "type": "MERCHANT",
              "title": "festive_500",
              "description": "festive discount",
              "tnc": "abc",
              "tncLink": "abcd",
              "minTxnAmount": 198,
              "maxTxnAmount": 2000,
              "offerType": "INSTANT",
              "validFrom": "2022-02-28 12:56:11",
              "validTo": "2022-12-28 12:57:16",
              "discountDetail": {
                "discountType": "PERCENTAGE",
                "discountPercentage": 10,
                "discount": 180,
                "discountedAmount": 1620,
                "maxDiscount": 100
              },
              "isNoCostEmi": false,
              "isSubvented": true,
              "isSkuOffer": true,
              "creditCard": [
                {
                  "networks": [
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    },
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    },
                    {
                      "code": "ICICI",
                      "title": "Icici Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "debitCard": [
                {
                  "networks": [
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    },
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "netBanking": [
                {
                  "title": "AXIS Bank",
                  "paymentCode": "AXIB"
                },
                {
                  "title": "Canara Bank",
                  "paymentCode": "CABB"
                },
                {
                  "title": "Bank of India",
                  "paymentCode": "BOIB"
                }
              ],
              "wallet": [
                {
                  "title": "Freecharge PayLater | UPI | Wallet",
                  "paymentCode": "FREC"
                },
                {
                  "title": "Jio Money",
                  "paymentCode": "JIOM"
                }
              ],
              "upi": [
                {
                  "title": "upi",
                  "paymentCode": "UPI"
                }
              ],
              "emi": {
                "debitCard": null,
                "creditCard": {
                  "banks": [
                    {
                      "bankCode": "CITI",
                      "tenureOption": [
                        {
                          "title": "Citibank 9 Months",
                          "paymentCode": "EMI09",
                          "discountDetail": null
                        },
                        {
                          "title": "Citibank 6 Months",
                          "paymentCode": "EMI06",
                          "discountDetail": null
                        }
                      ]
                    },
                    {
                      "bankCode": "HDFC",
                      "tenureOption": [
                        {
                          "title": "HDFC Bank 12 Months",
                          "paymentCode": "EMI12",
                          "discountDetail": null
                        }
                      ]
                    }
                  ]
                }
              },
              "skuDetail": {
                "skuId": "123",
                "skuName": "Samsung S20",
                "minQuantity": 3,
                "maxQuantity": 10
              },
              "isAcrossSkuQuantity": false
            },
            {
              "offerKey": "SamsungBrandOffer2022@Qpzkc7zWouLm",
              "type": "BANK",
              "title": "Samsung Brand  Offer 2022",
              "description": "10% Instant discount",
              "tnc": "Discount will be applied instantly after applying coupon code",
              "tncLink": "www.icicibank/offer/t&c",
              "minTxnAmount": 500,
              "maxTxnAmount": 2000,
              "offerType": "INSTANT",
              "validFrom": "2022-02-07 15:53:16",
              "validTo": "2022-12-13 15:53:16",
              "discountDetail": {
                "discountType": "ABSOLUTE",
                "discountPercentage": 20,
                "discount": 100,
                "discountedAmount": 1700,
                "maxDiscount": 100
              },
              "isNoCostEmi": false,
              "isSubvented": true,
              "isSkuOffer": true,
              "creditCard": [
                {
                  "networks": [
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    },
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "ICICI",
                      "title": "Icici Bank"
                    },
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "debitCard": [
                {
                  "networks": [
                    {
                      "code": "VISA",
                      "title": "Visa Network"
                    },
                    {
                      "code": "MAST",
                      "title": "Master Card Network"
                    }
                  ],
                  "banks": [
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    },
                    {
                      "code": "HDFC",
                      "title": "Hdfc Bank"
                    }
                  ],
                  "title": null,
                  "paymentCode": null
                }
              ],
              "netBanking": [
                {
                  "title": "Canara Bank",
                  "paymentCode": "CABB"
                },
                {
                  "title": "AXIS Bank",
                  "paymentCode": "AXIB"
                },
                {
                  "title": "Bank of India",
                  "paymentCode": "BOIB"
                }
              ],
              "wallet": [
                {
                  "title": "Jio Money",
                  "paymentCode": "JIOM"
                },
                {
                  "title": "Freecharge PayLater | UPI | Wallet",
                  "paymentCode": "FREC"
                }
              ],
              "upi": [
                {
                  "title": "upi",
                  "paymentCode": "UPI"
                }
              ],
              "emi": {
                "debitCard": {
                  "banks": [
                    {
                      "bankCode": "UTIB",
                      "tenureOption": [
                        {
                          "title": "Axis Bank 18 Months",
                          "paymentCode": "AXISD18",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 9 Months",
                          "paymentCode": "AXISD09",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 12 Months",
                          "paymentCode": "AXISD12",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 24 Months",
                          "paymentCode": "AXISD24",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 3 Months",
                          "paymentCode": "AXISD03",
                          "discountDetail": null
                        },
                        {
                          "title": "Axis Bank 6 Months",
                          "paymentCode": "AXISD06",
                          "discountDetail": null
                        }
                      ]
                    }
                  ]
                },
                "creditCard": {
                  "banks": [
                    {
                      "bankCode": "CITI",
                      "tenureOption": [
                        {
                          "title": "Citibank 3 Months",
                          "paymentCode": "EMI03",
                          "discountDetail": null
                        },
                        {
                          "title": "Citibank 6 Months",
                          "paymentCode": "EMI06",
                          "discountDetail": null
                        },
                        {
                          "title": "Citibank 3 Months",
                          "paymentCode": "EMI03",
                          "discountDetail": null
                        }
                      ]
                    },
                    {
                      "bankCode": "HDFC",
                      "tenureOption": [
                        {
                          "title": "HDFC Bank 12 Months",
                          "paymentCode": "EMI12",
                          "discountDetail": null
                        }
                      ]
                    }
                  ]
                }
              },
              "skuDetail": {
                "skuId": "123",
                "skuName": "Samsung S20",
                "minQuantity": 3,
                "maxQuantity": 100
              },
              "isAcrossSkuQuantity": true
            }
          ]
        }
      ]
    }
  }
Step 2: Validate Offer
Additional Request Parameters
In addition to the request parameters listed in the Validate Offer API section, the skusDetail parameter with skus in an JSON array is posted, where each skus contain the following fields are posted in an array:

Field	Description
autoApply	The flag to specify to automatically apply the offer.
skuAmount
optional
The price of one/ single unit of SKU is specified in this field.
offerKeys

optional
The offer keys to filter at SKU-level is specified in this field.
quantity

optional
The quantity for the product is specified in this field.
skuId
mandatory
The product identifier to select offer is specified in this field. For more information on creating a SKU offer, refer to Collect Payments with SKU-Based Offer using Merchant Hosted Checkout.
skusDetail Object in Request
Markup
  "skusDetail": {
    "skus": [
      {
      "autoApply": false,
        "skuAmount": 1000,
        "offerKeys": [
          "SummerSpecialOffer2021@q1Bh0jsogwqP"
        ],
        "quantity": 1,
        "skuId": "1"
      }
    ]
  }
skusDetail Object in Response
        "skusDetail": {
            "skusDiscountDetail": {
                "totalCashbackDiscount": null,
                "totalInstantDiscount": 100,
                "totalDiscountedAmount": 900
            },
            "skus": [
                {
                    "skuId": "1",
                    "quantity": 1,
                    "name": "One Plus",
                    "skuAmount": 1000,
                    "isValid": true,
                    "autoApply": false,
                    "discountDetail": {
                        "offerKey": "SummerSpecialOffer2021@q1Bh0jsogwqP",
                        "offerType": "INSTANT",
                        "discount": 100,
                        "discountedAmount": 900,
                        "discountType": "PERCENTAGE"
                    },
         "offerDetail":{
         "offerId":10005,
         "offerKey":"SummerSpecialOffer2021@q1Bh0jsogwqP",
         "offerType":"INSTANT",
         "title":"SummerSpecialOffer",
         "description":"SummerSpecialOffer discount",
         "validFrom":"2021-07-01 17:02:11",
         "validTo":"2022-08-05 15:53:16",
         "tnc":"abc",
         "tncLink":"abcd",
         "discountType":"ABSOLUTE",
         "offerPercentage":null,
         "maxDiscountPerTxn":100.00,
         "minTxnAmount":10.00,
         "maxTxnAmount":25000.00,
         "status":"ACTIVE",
         "isNce":false,
         "disallowTransactionInvalidOffer": false,
         "isSkuOffer": true,
         "isSubventedOffer": true
      }
Step 3: Payment Request
Additional Request Parameters for SKU-Based Offer
Reference: For the checkout flow and list of request parameters required for the Offer integration, refer to Merchant Hosted Checkout Integration.

Field	Description
cart_details
mandatory for SKU
JSON Object The card details is specified in this parameter in a JSON format.
Note: If given null, no cart will be created for the transaction.
cart_details.amount
mandatory
String The amount for the SKU-based offer.
cart_details.items
mandatory
String The number of the items for the SKU-based offer.
cart_details.sku_details
mandatory
JSON Object The SKU details is specified in this parameter in a JSON format.
cart_details.sku_details.sku_id
mandatory
String This parameter contains the unique identifier for SKU.
Note: The Product ID in the Excel file as described in the Add a SKU-Based Offer section and the skuId request parameter used in the Merchant Hosted Checkout Integration for SKU-based offer have the same function, Hence, after you create Product IDs on Dashboard, use them as values for the skuId parameter.
sku_details.sku_name
mandatory
String This parameter contains the SKU name.
sku_details.quantity
mandatory
String The parameter must contain the quantity of SKU added in cart.
sku_details.amount_per_sku
mandatory
String The parameter must contain the per SKU amount.
sku_details.offer_key

optional
String This parameter must contain the Offer Key(s) which can be used for this transaction.
sku_details.offer_auto_apply

optional
String This parameter contains the flag for when to enable auto application of best offer on this SKU.
cart_details Object in Sample Request
Curl
"cart_details": {
    "amount": 55000,
    "items": 2,
    "sku_details": [
      {
        "sku_id": "smartphone234",
        "sku_name": "Smartphone",
        "amount_per_sku": "45000",
        "quantity": 1,
        "offer_key": null,
        "offer_auto_apply": true
      },
      {
        "sku_id": "smartwatch132",
        "sku_name": "Smartwatch",
        "amount_per_sku": "10000",
        "quantity": 1,
        "offer_key": [
          "flat500@2022"
        ],
        "offer_auto_apply": false
      }
    ]
  }
Step 4: Check the Response from PayU
You need to look for the skusDetail object in the response. For the complete response, refer to Merchant Hosted Checkout Integration.

Success Scenario
The skusDetail JSON in the following sample response:

{"cart_details": {
    "id": "18",
    "payu_id": "999000000000983",
    "total_items": "2",
    "total_cart_amount": "55000",
    "offer_applied": null,
    "offer_availed": null,
    "instant_discount": "1000",
    "cashback_discount": "500",
    "total_discount": "1500",
    "net_cart_amount": "54000",
    "created_at": null,
    "updated_at": null,
    "sku_details": [
      {
        "id": "35",
        "cart_id": "18",
        "payu_id": "999000000000983",
        "mid": "180012",
        "sku_id": "smartphone234",
        "sku_name": "Smartphone",
        "amount_per_sku": "45000.00",
        "quantity": "1",
        "amount_before_discount": "45000",
        "discount": "1000",
        "amount_after_discount": "44000",
        "offer_key": null,
        "offer_status": null,
        "offer_type": null,
        "created_at": null,
        "updated_at": null
      },
      {
        "id": "36",
        "cart_id": "18",
        "payu_id": "999000000000983",
        "mid": "180012",
        "sku_id": "smartwatch132",
        "sku_name": "Smartwatch",
        "amount_per_sku": "10000.00",
        "quantity": "1",
        "amount_before_discount": "10000.00",
        "discount": "500",
        "amount_after_discount": "10000.00",
        "offer_key": null,
        "offer_status": null,
        "offer_type": null,
        "created_at": null,
        "updated_at": null
      }
    ]
  }}
Failure Scenarios
For a list of error messages for the failure scenarios, refer to Offers Error Codes.

Next Steps
Fetch Offer API
API Command: fetch_offers The fetch_offers API fetches all active (with the Live status on Dashboard) offers for this Merchant ID. Note: If the amount are received in the request, the discount calculation for each offer is also sent as part of the response. If the amount is not received, the response does not contain the…
Continue reading
Fetch Offer API

Validate Offer API
API Command: validate_offer The validate_offer API validates the payment request against an offer key. This API doesn’t apply the offer and only validates the request. Endpoints Test Environment https://sandbox.payu.in/offers/transactions/validate Production Environment https://api.payu.in/offers/transactions/validate Request Headers The request header contains the following fields: The following sample Java code contains the logic used to encrypt as described in…
Continue reading
Validate Offer API

Was this document helpful?
ON THIS PAGE
Step 1: Fetch Offers
Additional Request Parameter skusDetail for SKU
skusDetail in Sample Request
Sample Response
Step 2: Validate Offer
Additional Request Parameters
skusDetail Object in Request
skusDetail Object in Response
Step 3: Payment Request
Additional Request Parameters for SKU-Based Offer
cart_details Object in Sample Request
Step 4: Check the Response from PayU
Success Scenario
Failure Scenarios
Updated about 5 months ago
Twitter
Follow @PayUindia on Twitter
Github
Follow @PayUindia on Github
API Playground
API Playground
Test the actual APIs you want to use in API Playground
© 2023 PayU Docs

To the top↑

Step 2: Validate Offer

Additional request parameters

In addition to the request parameters listed in Validate Offer API, the skusDetail parameter with skus in an JSON array is posted, where each skus contain the following fields are posted in an array:

FieldDescription
autoApplyThe flag to specify to automatically apply the offer.
skuAmountThe price of one/ single unit of SKU is specified in this field.
offerKeysThe offer keys to filter at SKU-level is specified in this field.
quantityThe quantity for the product is specified in this field.
skuIdThe product identifier to select offer is specified in this field. For more information on creating a SKU offer.

skusDetail Object in request

  "skusDetail": {
    "skus": [
      {
      "autoApply": false,
        "skuAmount": 1000,
        "offerKeys": [
          "SummerSpecialOffer2021@q1Bh0jsogwqP"
        ],
        "quantity": 1,
        "skuId": "1"
      }
    ]
  }

skusDetail Object in response

        "skusDetail": {
            "skusDiscountDetail": {
                "totalCashbackDiscount": null,
                "totalInstantDiscount": 100,
                "totalDiscountedAmount": 900
            },
            "skus": [
                {
                    "skuId": "1",
                    "quantity": 1,
                    "name": "One Plus",
                    "skuAmount": 1000,
                    "isValid": true,
                    "autoApply": false,
                    "discountDetail": {
                        "offerKey": "SummerSpecialOffer2021@q1Bh0jsogwqP",
                        "offerType": "INSTANT",
                        "discount": 100,
                        "discountedAmount": 900,
                        "discountType": "PERCENTAGE"
                    },
         "offerDetail":{
         "offerId":10005,
         "offerKey":"SummerSpecialOffer2021@q1Bh0jsogwqP",
         "offerType":"INSTANT",
         "title":"SummerSpecialOffer",
         "description":"SummerSpecialOffer discount",
         "validFrom":"2021-07-01 17:02:11",
         "validTo":"2022-08-05 15:53:16",
         "tnc":"abc",
         "tncLink":"abcd",
         "discountType":"ABSOLUTE",
         "offerPercentage":null,
         "maxDiscountPerTxn":100.00,
         "minTxnAmount":10.00,
         "maxTxnAmount":25000.00,
         "status":"ACTIVE",
         "isNce":false,
         "disallowTransactionInvalidOffer": false,
         "isSkuOffer": true,
         "isSubventedOffer": true
      }

Step 3: Payment request

Additional request parameters for SKU-Based offer

📘

Reference:

For the checkout flow and list of request parameters required for the Offer integration, refer to Instant Discount or Cashback using Merchant Hosted Checkout.

FieldDescription
cart_details
mandatory for SKU
JSON Object The card details is specified in this parameter in a JSON format.
Note: If given null, no cart will be created for the transaction.
cart_details.amount
mandatory
String The amount for the SKU-based offer.
cart_details.items
mandatory
String The number of the items for the SKU-based offer.
cart_details.sku_details
mandatory
JSON Object The SKU details is specified in this parameter in a JSON format.
cart_details.sku_details.sku_id
mandatory
String This parameter contains the unique identifier for SKU.
Note: The Product ID in the Excel file as described in the Create a SKU-Based Offer section and the skuId request parameter used in the Merchant Hosted Checkout Integration for SKU-based offer have the same function, Hence, after you create Product IDs on Dashboard, use them as values for the skuId parameter.
sku_details.sku_name
mandatory
String This parameter contains the SKU name.
sku_details.quantity
mandatory
String The parameter must contain the quantity of SKU added in cart.
sku_details.amount_per_sku
mandatory
String The parameter must contain the per SKU amount.
sku_details.offer_key
mandatory
String This parameter must contain the Offer Key(s) which can be used for this transaction. |
sku_details.offer_auto_apply
mandatory
_String_This parameter contains the flag for when to enable auto application of best offer on this SKU.

cart_details Object in sample request

"cart_details": {
    "amount": 55000,
    "items": 2,
    "sku_details": [
      {
        "sku_id": "smartphone234",
        "sku_name": "Smartphone",
        "amount_per_sku": "45000",
        "quantity": 1,
        "offer_key": null,
        "offer_auto_apply": true
      },
      {
        "sku_id": "smartwatch132",
        "sku_name": "Smartwatch",
        "amount_per_sku": "10000",
        "quantity": 1,
        "offer_key": [
          "flat500@2022"
        ],
        "offer_auto_apply": false
      }
    ]
  }

Step 4: Check the response from PayU

You need to look for the skusDetail object in the response. For the complete response, refer to Merchant Hosted Checkout.

Success scenario

The skusDetail JSON in the following sample response:

{"cart_details": {
    "id": "18",
    "payu_id": "999000000000983",
    "total_items": "2",
    "total_cart_amount": "55000",
    "offer_applied": null,
    "offer_availed": null,
    "instant_discount": "1000",
    "cashback_discount": "500",
    "total_discount": "1500",
    "net_cart_amount": "54000",
    "created_at": null,
    "updated_at": null,
    "sku_details": [
      {
        "id": "35",
        "cart_id": "18",
        "payu_id": "999000000000983",
        "mid": "180012",
        "sku_id": "smartphone234",
        "sku_name": "Smartphone",
        "amount_per_sku": "45000.00",
        "quantity": "1",
        "amount_before_discount": "45000",
        "discount": "1000",
        "amount_after_discount": "44000",
        "offer_key": null,
        "offer_status": null,
        "offer_type": null,
        "created_at": null,
        "updated_at": null
      },
      {
        "id": "36",
        "cart_id": "18",
        "payu_id": "999000000000983",
        "mid": "180012",
        "sku_id": "smartwatch132",
        "sku_name": "Smartwatch",
        "amount_per_sku": "10000.00",
        "quantity": "1",
        "amount_before_discount": "10000.00",
        "discount": "500",
        "amount_after_discount": "10000.00",
        "offer_key": null,
        "offer_status": null,
        "offer_type": null,
        "created_at": null,
        "updated_at": null
      }
    ]
  }}