Coupon Validations
Operations for validating coupons.
Checks if a coupon is valid based on the provided code, user ID, and transaction value.
Authorizations
Query parameters
coupon_codestringRequiredExample:
The coupon code to validate.
AMAZING
user_idstringRequiredExample:
The ID of the user attempting to use the coupon.
123
transaction_valuenumberRequiredExample:
The total value of the transaction.
1000
Responses
200
The coupon is valid. The response includes the validation status and coupon details.
application/json
400
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.
401
Unauthorized. The API Key or Merchant ID is missing or invalid.
404
Not Found. The coupon with the specified code does not exist.
500
Internal Server Error.
get
GET /coupons/validate 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.
Authorizations
Path parameters
couponIdstringRequiredExample:
The ID of the coupon to validate.
cpn-1502288320598b19c0d59fd
Query parameters
user_idstringRequiredExample:
The ID of the user attempting to use the coupon.
123
Responses
200
The coupon is valid. The response includes the validation status and coupon details.
application/json
400
Bad Request. The coupon is invalid for the user.
401
Unauthorized. The API Key or Merchant ID is missing or invalid.
404
Not Found. The coupon with the specified ID does not exist.
500
Internal Server Error.
get
GET /coupons/{couponId}/validate 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
}
}