When Should I Integrate Offers with Orders API?
If you use Razaorpay Magento, Shopify or WooCommerce plugins to integrate with Razorpay Payment Gateway, you need not integrate offers with Orders API. This is because orders are automatically created when customers initiate payment at the Checkout. However, if you are using our JS, SDK files or other ecommerce plugins, you must integrate offers with the Orders API.
This is the easiest way to display offers at the Checkout. While creating the offer from the Razorpay Dashboard, enable the Show Offer on Checkout option. The offer automatically appears at the Checkout.
Ensure you have integrated with the Orders API if you are using our JS, SDK files or ecommerce plugins other than Magento, Shopify and Woocommerce.
If you want a specific offer to be displayed at the Checkout, you can choose to associate the offer with an order. This must be done by passing the offers array as a request attribute in the Create Orders API.
This is useful if you have multiple product lines running on the same account and have certain business logic on your side for displaying offers. Also, beneficial in cases where the discount has already been applied, and you would like to restrict the payment method that should be used to avail the offer.