Vouchers
Operations related to creating, retrieving, and managing vouchers.
Retrieves a list of all vouchers for the authenticated merchant.
Basic Authentication using Merchant ID as username and API Key as password.
A successful response returning a list of vouchers.
The URI for the collection of vouchers.
https://api.vauchar.com/vouchersThe total number of vouchers in the data array.
2Unauthorized. 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.
Basic Authentication using Merchant ID as username and API Key as password.
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.
The unique URI for the voucher resource.
https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5The type of the object.
voucherThe unique identifier for the voucher.
vcr-150659959859cce2ae044b5The code for the voucher.
E57BBO2ASPF25A tag associated with the voucher.
The timestamp when the voucher was created.
1506599598The timestamp when the voucher becomes valid.
1506579300The timestamp when the voucher expires.
1509474600The value of the voucher.
50.00The unit of the voucher's value.
percentagePossible values: The currency of the voucher's value.
USDIndicates if the voucher has been redeemed (1 for true, 0 for false).
1The timestamp when the voucher was redeemed.
1506601978A list of teams associated with the voucher.
A list of brands associated with the voucher.
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.
Basic Authentication using Merchant ID as username and API Key as password.
The ID of the voucher to retrieve.
vcr-150659959859cce2ae044b5A successful response returning the voucher details.
The unique URI for the voucher resource.
https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5Unauthorized. 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.
Basic Authentication using Merchant ID as username and API Key as password.
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