query

validateCoupon

Validate the applicability of a coupon code for the selected payment mode for the existing cart. This ensures the coupon's validity before proceeding with the payment process, enhancing user experience and preventing potential errors during transactions.
Arguments
addressId
String
ID allotted to an address.
aggregatorName
String
Payment gateway identifier.
buyNow
Boolean
This is boolean to get buy_now cart.
cardId
String
saved card token reference id.
The unique identifier of the cart.
Debit/Credit card prefix (first 6 digit).
merchantCode
String
Identifier used by payment gateway for a given payment mode, e.g. NB_ICIC, PAYTM.
network
String
Credit/Debit card issuer, e.g. VISA, MASTERCARD, RUPAY.
paymentIdentifier
String
Identifier of payment like ICIC, PAYTM.
paymentMode
String
Payment mode selected by the customer.
type
String
card type, e.g. Credit, Debit.
Response
coupon_validity
CouponValidity
Coupon is valid flag if coupon is valid for the payment mode.
message
String
Payment mode valid message for coupon.
success
Boolean!
Required
success flag of coupon payment mode validity API response.
Query
1query validateCoupon(
2 $addressId: String
3 $aggregatorName: String
4 $buyNow: Boolean
5 $cardId: String
6 $id: String
7 $iin: String
8 $merchantCode: String
9 $network: String
10 $paymentIdentifier: String
11 $paymentMode: String
12 $type: String
13) {
14 validateCoupon(
15 addressId: $addressId
16 aggregatorName: $aggregatorName
17 buyNow: $buyNow
18 cardId: $cardId
19 id: $id
20 iin: $iin
21 merchantCode: $merchantCode
22 network: $network
23 paymentIdentifier: $paymentIdentifier
24 paymentMode: $paymentMode
25 type: $type
26 ) {
27 coupon_validity {
28 code
29 discount
30 display_message_en
31 next_validation_required
32 title
33 valid
34 }
35 message
36 success
37 }
38}
Try it
Input Variables
1{
2 "addressId": "addressId",
3 "aggregatorName": "aggregatorName",
4 "buyNow": true,
5 "cardId": "cardId",
6 "id": "08a16b83-9094-4e89-8c05-2ccadd5c1c7e",
7 "iin": "iin",
8 "merchantCode": "merchantCode",
9 "network": "network",
10 "paymentIdentifier": "paymentIdentifier",
11 "paymentMode": "paymentMode",
12 "type": "type"
13}
Response
1{
2 "validateCoupon": {
3 "coupon_validity": {
4 "code": "code",
5 "discount": 30.7,
6 "display_message_en": "display_message_en",
7 "next_validation_required": true,
8 "title": "title",
9 "valid": true
10 },
11 "message": "message",
12 "success": true
13 }
14}