Voucher Redemptions

Operations related to voucher redemptions.

List Redemptions for a Voucher

get

Retrieves a list of all redemptions for a specific voucher.

Authorizations
Path parameters
voucherIdstringRequired

The ID of the voucher to retrieve redemptions for.

Example: vcr-150659959859cce2ae044b5
Responses
200
A successful response returning a list of redemptions.
application/json
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
    }
  ]
}

Create a Redemption

post

Redeems a voucher against a transaction.

Authorizations
Path parameters
voucherIdstringRequired

The ID of the voucher to redeem.

Example: vcr-150676308659cf614e2f56e
Body
user_idstringRequired

The ID of the user making the redemption.

Example: 123
user_emailstring · emailOptional

The email address of the user.

Example: test@vauchar.com
user_phonestringOptional

The phone number of the user.

Example: 82383209830
transaction_idstringOptional

An external transaction ID for tracking.

Example: transa001
value_usednumberOptional

The value of the voucher being used in this transaction.

Example: 50
Responses
201
Redemption successful. Returns the details of the redemption.
application/json
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
}

Delete a Redemption

delete

Deletes a specific voucher redemption. This is useful for reversing a redemption.

Authorizations
Path parameters
voucherIdstringRequired

The ID of the voucher associated with the redemption.

Example: vcr-150676308659cf614e2f56e
redemptionIdstringRequired

The ID of the redemption to delete.

Example: res-150676438959cf6665717f4
Responses
204
Redemption deleted successfully. No content is returned.
delete
DELETE /vouchers/{voucherId}/redemptions/{redemptionId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*

No content