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
StringID allotted to an address.
aggregatorName
StringPayment gateway identifier.
buyNow
BooleanThis is boolean to get buy_now cart.
cardId
Stringsaved card token reference id.
id
StringThe unique identifier of the cart.
iin
StringDebit/Credit card prefix (first 6 digit).
merchantCode
StringIdentifier used by payment gateway for a given payment mode, e.g. NB_ICIC, PAYTM.
network
StringCredit/Debit card issuer, e.g. VISA, MASTERCARD, RUPAY.
paymentIdentifier
StringIdentifier of payment like ICIC, PAYTM.
paymentMode
StringPayment mode selected by the customer.
type
Stringcard type, e.g. Credit, Debit.
Response
coupon_validity
CouponValidityCoupon is valid flag if coupon is valid for the payment mode.
message
StringPayment mode valid message for coupon.
success
Boolean!Required
success flag of coupon payment mode validity API response.
Query
1query validateCoupon(2 $addressId: String3 $aggregatorName: String4 $buyNow: Boolean5 $cardId: String6 $id: String7 $iin: String8 $merchantCode: String9 $network: String10 $paymentIdentifier: String11 $paymentMode: String12 $type: String13) {14 validateCoupon(15 addressId: $addressId16 aggregatorName: $aggregatorName17 buyNow: $buyNow18 cardId: $cardId19 id: $id20 iin: $iin21 merchantCode: $merchantCode22 network: $network23 paymentIdentifier: $paymentIdentifier24 paymentMode: $paymentMode25 type: $type26 ) {27 coupon_validity {28 code29 discount30 display_message_en31 next_validation_required32 title33 valid34 }35 message36 success37 }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": true10 },11 "message": "message",12 "success": true13 }14}
Was this section helpful?