Handy TipsUse your webhook URL as the API endpoint for the Coupon Code APIs.
Sample Code
Fetch the list of coupons available using this API. your-webhook-urlRequest
Request Parameters
order_id mandatory
: string The unique identifier of the order created in the previous step.
email optional
: string The customer’s email address.
contact optional
: string The customer’s phone number.
Response Parameters
coupons
: array Details of the coupons created.
code
: string The unique identifier of the coupon.
summary
: string A summary about the coupon.
description
: string A brief description of the coupon.
tnc
: array Terms and conditions about the coupon.
Apply Coupons API
Apply a coupon on a transaction using this API. your-webhook-urlRequest
Request Parameters
order_id mandatory
: string The unique identifier of the order created in the previous step.
email optional
: string The customer’s email address.
contact optional
: string The customer’s phone number.
cart_value mandatory
: integer The customer’s cart value.
shipping_charge optional
: integer The shipping charge levied on the customer.
cod_charge optional
: integer The cash-on-delivery charge levied on the customer.
coupon_code mandatory
: string The coupon code to be applied on the transaction.
Response Parameters
order_id
: string The unique identifier of the order created in the previous step.
status
: boolean Indicates whether the coupon got applied successfully to the transaction. Possible values:
true: The coupon was successfully applied.false: The coupon was not successfully applied.
methods
: array The supported payment methods.
new_cart_value
: integer The net cart value (original value minus coupon discount).
discount
: integer The discount amount.
new_shipping_charge
: integer The net shipping charge.
items
: object Details of the items.
cost
: integer The item cost.
item
: string The unique identifier of the item.
cod_charge
: integer The cash-on-delivery charge levied.
failure_reason
: string The reason why the coupon did not get applied successfully. For example, Coupon Code has expired.