Voucher Redemptions
Operations related to voucher redemptions.
Retrieves a list of all redemptions for a specific voucher.
Authorizations
Path parameters
voucherIdstringRequiredExample:
The ID of the voucher to retrieve redemptions for.
vcr-150659959859cce2ae044b5
Responses
200
A successful response returning a list of redemptions.
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}/redemptions HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
{
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5/redemptions",
"data": [
{
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5/redemptions/res-150660197859ccebfa8b218",
"type": "redemption",
"id": "res-150660197859ccebfa8b218",
"voucher_id": "vcr-150659959859cce2ae044b5",
"user_id": "user001",
"customer_id": "cust-150658890659ccb8ea8b387",
"user_email": "text",
"user_phone": "text",
"transaction_id": "text",
"value_used": "185.00",
"team_id": "text",
"created": 1506601978
}
]
}
Redeems a voucher against a transaction.
Authorizations
Path parameters
voucherIdstringRequiredExample:
The ID of the voucher to redeem.
vcr-150676308659cf614e2f56e
Body
user_idstringRequiredExample:
The ID of the user making the redemption.
123
user_emailstring · emailOptionalExample:
The email address of the user.
test@vauchar.com
user_phonestringOptionalExample:
The phone number of the user.
82383209830
transaction_idstringOptionalExample:
An external transaction ID for tracking.
transa001
value_usednumberOptionalExample:
The value of the voucher being used in this transaction.
50
Responses
201
Redemption successful. Returns the details of the redemption.
application/json
400
Bad Request. The request body is invalid or the voucher is not valid for redemption.
401
Unauthorized. The API key or Merchant ID is invalid or missing.
404
Voucher not found.
500
Internal Server Error.
post
POST /vouchers/{voucherId}/redemptions HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 121
{
"user_id": "123",
"user_email": "test@vauchar.com",
"user_phone": "82383209830",
"transaction_id": "transa001",
"value_used": 50
}
{
"href": "https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5/redemptions/res-150660197859ccebfa8b218",
"type": "redemption",
"id": "res-150660197859ccebfa8b218",
"voucher_id": "vcr-150659959859cce2ae044b5",
"user_id": "user001",
"customer_id": "cust-150658890659ccb8ea8b387",
"user_email": "text",
"user_phone": "text",
"transaction_id": "text",
"value_used": "185.00",
"team_id": "text",
"created": 1506601978
}
Deletes a specific voucher redemption. This is useful for reversing a redemption.
Authorizations
Path parameters
voucherIdstringRequiredExample:
The ID of the voucher associated with the redemption.
vcr-150676308659cf614e2f56e
redemptionIdstringRequiredExample:
The ID of the redemption to delete.
res-150676438959cf6665717f4
Responses
204
Redemption deleted successfully. No content is returned.
401
Unauthorized. The API key or Merchant ID is invalid or missing.
404
Voucher or Redemption not found.
500
Internal Server Error.
delete
DELETE /vouchers/{voucherId}/redemptions/{redemptionId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*
No content