For the complete documentation index, see llms.txt. This page is also available as Markdown.

Voucher Redemptions

Operations related to voucher redemptions.

List Redemptions for a Voucher

get

Retrieves a list of all redemptions for a specific voucher.

Authorizations
AuthorizationstringRequired

Basic Authentication using Merchant ID as username and API Key as password.

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
hrefstring · uriOptional

The URI for the collection of redemptions.

Example: https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5/redemptions
get/vouchers/{voucherId}/redemptions
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
AuthorizationstringRequired

Basic Authentication using Merchant ID as username and API Key as password.

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
hrefstring · uriOptional

The unique URI for the redemption resource.

Example: https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5/redemptions/res-150660197859ccebfa8b218
typestringOptional

The type of the object.

Example: redemption
idstringOptional

The unique identifier for the redemption.

Example: res-150660197859ccebfa8b218
voucher_idstringOptional

The ID of the voucher that was redeemed.

Example: vcr-150659959859cce2ae044b5
user_idstringOptional

The ID of the user who made the redemption.

Example: user001
customer_idstringOptional

The ID of the customer associated with the redemption.

Example: cust-150658890659ccb8ea8b387
user_emailstringOptional

The email of the user.

user_phonestringOptional

The phone number of the user.

transaction_idstringOptional

The ID of the associated transaction.

value_usedstringOptional

The value used in this redemption.

Example: 185.00
team_idstringOptional

The ID of the team associated with the redemption.

createdinteger · int64Optional

The timestamp when the redemption occurred.

Example: 1506601978
post/vouchers/{voucherId}/redemptions
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
AuthorizationstringRequired

Basic Authentication using Merchant ID as username and API Key as password.

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.

No content

delete/vouchers/{voucherId}/redemptions/{redemptionId}
DELETE /vouchers/{voucherId}/redemptions/{redemptionId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*

No content

Last updated