Vouchers
Operations related to creating, retrieving, and managing vouchers.
Retrieves a list of all vouchers for the authenticated merchant.
A successful response returning a list of vouchers.
Unauthorized. The API key or Merchant ID is invalid or missing.
Internal Server Error.
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.
The number of vouchers to create.
2The timestamp when the vouchers become valid. Use 0 for immediate validity.
1480427100The timestamp when the vouchers expire. Use 0 for no expiry.
0The value of each voucher.
50.00The unit of the voucher's value.
percentagePossible values: The currency of the voucher's value.
USDA tag to associate with the created vouchers.
internal-47494Vouchers created successfully. Returns an array of the new vouchers.
Bad Request. The request body is invalid.
Unauthorized. The API key or Merchant ID is invalid or missing.
Internal Server Error.
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.
The ID of the voucher to retrieve.
vcr-150659959859cce2ae044b5A successful response returning the voucher details.
Unauthorized. The API key or Merchant ID is invalid or missing.
Voucher not found.
Internal Server Error.
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.
The ID of the voucher to delete.
vcr-150676308659cf614e2f56eVoucher deleted successfully. No content is returned.
No content
Unauthorized. The API key or Merchant ID is invalid or missing.
Voucher not found.
Internal Server Error.
DELETE /vouchers/{voucherId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
No content
Last updated