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
AuthorizationstringRequired

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.

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
/coupons/validate
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
  }
}

Validate by Coupon ID

get

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

Authorizations
AuthorizationstringRequired

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.

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
/coupons/{couponId}/validate
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