Coupon Validations

Operations for validating coupons.

Validate a Coupon by Code

get

Checks if a coupon is valid based on the provided code, user ID, and transaction value.

Authorizations
Query parameters
coupon_codestringRequired

The coupon code to validate.

Example: AMAZING
user_idstringRequired

The ID of the user attempting to use the coupon.

Example: 123
transaction_valuenumberRequired

The total value of the transaction.

Example: 1000
Responses
200
The coupon is valid. The response includes the validation status and coupon details.
application/json
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
  }
}

Validate by Coupon ID

get

Checks if a coupon is valid for a specific user by providing the coupon ID and user ID.

Authorizations
Path parameters
couponIdstringRequired

The ID of the coupon to validate.

Example: cpn-1502288320598b19c0d59fd
Query parameters
user_idstringRequired

The ID of the user attempting to use the coupon.

Example: 123
Responses
200
The coupon is valid. The response includes the validation status and coupon details.
application/json
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
  }
}