Vouchers
Operations related to creating, retrieving, and managing vouchers.
Retrieves a list of all vouchers for the authenticated merchant.
Authorizations
Responses
200
A successful response returning a list of vouchers.
application/json
401
Unauthorized. The API key or Merchant ID is invalid or missing.
500
Internal Server Error.
get
GET /vouchers HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
{
"href": "https://api.vauchar.com/vouchers",
"count": 2,
"data": [
{
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5",
"type": "voucher",
"id": "vcr-150659959859cce2ae044b5",
"voucher_code": "E57BBO2ASPF25",
"tag": "text",
"created": 1506599598,
"start_time": 1506579300,
"expiry_time": 1509474600,
"value": "50.00",
"value_unit": "percentage",
"currency": "USD",
"redeemed": 1,
"redeemed_date": 1506601978,
"teams": [
"text"
],
"brands": [
"text"
]
}
]
}
Creates one or more new vouchers based on the specified parameters.
Authorizations
Body
countintegerRequiredExample:
The number of vouchers to create.
2
start_timeinteger · int64OptionalExample:
The timestamp when the vouchers become valid. Use 0 for immediate validity.
1480427100
expiry_timeinteger · int64OptionalExample:
The timestamp when the vouchers expire. Use 0 for no expiry.
0
valuestringRequiredExample:
The value of each voucher.
50.00
value_unitstring · enumRequiredExample:
The unit of the voucher's value.
percentage
Possible values: currencystringRequiredExample:
The currency of the voucher's value.
USD
tagstringOptionalExample:
A tag to associate with the created vouchers.
internal-47494
Responses
201
Vouchers created successfully. Returns an array of the new vouchers.
application/json
400
Bad Request. The request body is invalid.
401
Unauthorized. The API key or Merchant ID is invalid or missing.
500
Internal Server Error.
post
POST /vouchers HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 133
{
"count": 2,
"start_time": 1480427100,
"expiry_time": 0,
"value": "50.00",
"value_unit": "percentage",
"currency": "USD",
"tag": "internal-47494"
}
[
{
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5",
"type": "voucher",
"id": "vcr-150659959859cce2ae044b5",
"voucher_code": "E57BBO2ASPF25",
"tag": "text",
"created": 1506599598,
"start_time": 1506579300,
"expiry_time": 1509474600,
"value": "50.00",
"value_unit": "percentage",
"currency": "USD",
"redeemed": 1,
"redeemed_date": 1506601978,
"teams": [
"text"
],
"brands": [
"text"
]
}
]
Retrieves a specific voucher by its unique ID.
Authorizations
Path parameters
voucherIdstringRequiredExample:
The ID of the voucher to retrieve.
vcr-150659959859cce2ae044b5
Responses
200
A successful response returning the voucher details.
application/json
401
Unauthorized. The API key or Merchant ID is invalid or missing.
404
Voucher not found.
500
Internal Server Error.
get
GET /vouchers/{voucherId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
{
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5",
"data": {
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5",
"type": "voucher",
"id": "vcr-150659959859cce2ae044b5",
"voucher_code": "E57BBO2ASPF25",
"tag": "text",
"created": 1506599598,
"start_time": 1506579300,
"expiry_time": 1509474600,
"value": "50.00",
"value_unit": "percentage",
"currency": "USD",
"redeemed": 1,
"redeemed_date": 1506601978,
"teams": [
"text"
],
"brands": [
"text"
]
}
}
Permanently deletes a specific voucher by its unique ID.
Authorizations
Path parameters
voucherIdstringRequiredExample:
The ID of the voucher to delete.
vcr-150676308659cf614e2f56e
Responses
204
Voucher deleted successfully. No content is returned.
401
Unauthorized. The API key or Merchant ID is invalid or missing.
404
Voucher not found.
500
Internal Server Error.
delete
DELETE /vouchers/{voucherId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
No content