Skip to main content
POST
/
v1
/
vouchers
/
{code}
/
validate
curl --request POST \
--url https://{cluster}.voucherify.io/v1/vouchers/{code}/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"customer": {
"id": "cust_4vMj8Twr5nBzvTrNCgipMb6M"
},
"order": {
"items": [
{
"product_id": "prod_0ba621bae5d39762ce",
"quantity": "1"
},
{
"product_id": "prod_0b661d404787ec6d3b",
"quantity": "1",
"price": 3100
}
]
}
}'
{
"valid": false,
"reason": "redemption does not match validation rules",
"error": {
"code": 400,
"key": "redemption_rules_violated",
"message": "redemption does not match validation rules",
"details": "Gift Card cannot be redeemed because of violated validation rules: val_wvipKm99CJuL",
"request_id": "v-0bccef7a9585cf63b6"
},
"tracking_id": "track_ZGPtmYcM+Mw=",
"code": "vBQvYFEM",
"metadata": {}
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

Path Parameters

code
string
required
Example:

Body

application/json
  • Vouchers Validate Discount Request Body
  • Vouchers Validate Gift Request Body
  • Vouchers Validate Loyalty Request Body
customer
object
order
object
session
object
tracking_id
string
metadata
object
options
object

Response

  • Vouchers Validate Valid Response Body
  • Vouchers Validate Invalid Response Body
valid
boolean
default:true
required
code
string
required
applicable_to
object
required
inapplicable_to
object
required
metadata
object
required
tracking_id
string
required
campaign
string
campaign_id
string
discount
object
  • Amount
  • Unit
  • Unit Multiple
  • Percent
  • Fixed
gift
object
loyalty
object
reward
object
order
object
session
object
start_date
string
expiration_date
string