Coupon Validations
Operations for validating coupons.
Checks if a coupon is valid based on the provided code, user ID, and transaction value.
HTTP Basic Authentication. The username is your Merchant ID and the password is your API Key. The combined string Merchant_Id:Api_Key should be Base64 encoded.
The coupon code to validate.
AMAZINGThe ID of the user attempting to use the coupon.
123The total value of the transaction.
1000The coupon is valid. The response includes the validation status and coupon details.
Bad Request. The coupon is invalid or does not meet the criteria (e.g., expired, invalid code, does not apply to the transaction value). The response will contain a specific validation message.
Unauthorized. The API Key or Merchant ID is missing or invalid.
Not Found. The coupon with the specified code does not exist.
Internal Server Error.
GET /coupons/validate?coupon_code=text&user_id=text&transaction_value=1 HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
{
"validation_status": {
"status": 1000,
"message": "Coupon is valid"
},
"data": {
"href": "https://api.vauchar.com/coupons/cpn-1502288320598b19c0d59fd",
"type": "coupon",
"id": "cpn-1502288320598b19c0d59fd",
"coupon_code": "AMAZING",
"created": 1502288320,
"start_time": 1502287200,
"expiry_time": 0,
"allowed_users": 0,
"redemptions_limit_total": 0,
"redemptions_limit_per_user": 0,
"value": "5000.00",
"value_unit": "value",
"currency": "USD",
"active_status": 1
}
}Checks if a coupon is valid for a specific user by providing the coupon ID and user ID.
HTTP Basic Authentication. The username is your Merchant ID and the password is your API Key. The combined string Merchant_Id:Api_Key should be Base64 encoded.
The ID of the coupon to validate.
cpn-1502288320598b19c0d59fdThe ID of the user attempting to use the coupon.
123The coupon is valid. The response includes the validation status and coupon details.
Bad Request. The coupon is invalid for the user.
Unauthorized. The API Key or Merchant ID is missing or invalid.
Not Found. The coupon with the specified ID does not exist.
Internal Server Error.
GET /coupons/{couponId}/validate?user_id=text HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
{
"validation_status": {
"status": 1000,
"message": "Coupon is valid"
},
"data": {
"href": "https://api.vauchar.com/coupons/cpn-1502288320598b19c0d59fd",
"type": "coupon",
"id": "cpn-1502288320598b19c0d59fd",
"coupon_code": "AMAZING",
"created": 1502288320,
"start_time": 1502287200,
"expiry_time": 0,
"allowed_users": 0,
"redemptions_limit_total": 0,
"redemptions_limit_per_user": 0,
"value": "5000.00",
"value_unit": "value",
"currency": "USD",
"active_status": 1
}
}Last updated