Vouchers

Operations related to creating, retrieving, and managing vouchers.

List all Vouchers

get

Retrieves a list of all vouchers for the authenticated merchant.

Authorizations
Responses
200
A successful response returning a list of vouchers.
application/json
get
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"
      ]
    }
  ]
}

Create Vouchers

post

Creates one or more new vouchers based on the specified parameters.

Authorizations
Body
countintegerRequired

The number of vouchers to create.

Example: 2
start_timeinteger · int64Optional

The timestamp when the vouchers become valid. Use 0 for immediate validity.

Example: 1480427100
expiry_timeinteger · int64Optional

The timestamp when the vouchers expire. Use 0 for no expiry.

Example: 0
valuestringRequired

The value of each voucher.

Example: 50.00
value_unitstring · enumRequired

The unit of the voucher's value.

Example: percentagePossible values:
currencystringRequired

The currency of the voucher's value.

Example: USD
tagstringOptional

A tag to associate with the created vouchers.

Example: internal-47494
Responses
201
Vouchers created successfully. Returns an array of the new vouchers.
application/json
post
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"
    ]
  }
]

Get Voucher by ID

get

Retrieves a specific voucher by its unique ID.

Authorizations
Path parameters
voucherIdstringRequired

The ID of the voucher to retrieve.

Example: vcr-150659959859cce2ae044b5
Responses
200
A successful response returning the voucher details.
application/json
get
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"
    ]
  }
}

Delete Voucher by ID

delete

Permanently deletes a specific voucher by its unique ID.

Authorizations
Path parameters
voucherIdstringRequired

The ID of the voucher to delete.

Example: vcr-150676308659cf614e2f56e
Responses
204
Voucher deleted successfully. No content is returned.
delete
DELETE /vouchers/{voucherId} HTTP/1.1
Host: api.vauchar.com
Authorization: Basic username:password
Accept: */*

No content