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

Vouchers

Operations related to creating, retrieving, and managing vouchers.

List all Vouchers

get

Retrieves a list of all vouchers for the authenticated merchant.

Authorizations
AuthorizationstringRequired

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

Responses
200

A successful response returning a list of vouchers.

application/json
hrefstring · uriOptional

The URI for the collection of vouchers.

Example: https://api.vauchar.com/vouchers
countintegerOptional

The total number of vouchers in the data array.

Example: 2
get/vouchers
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
AuthorizationstringRequired

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

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

The unique URI for the voucher resource.

Example: https://api.vauchar.com/vouchers/vcr-150659959859cce2ae044b5
typestringOptional

The type of the object.

Example: voucher
idstringOptional

The unique identifier for the voucher.

Example: vcr-150659959859cce2ae044b5
voucher_codestringOptional

The code for the voucher.

Example: E57BBO2ASPF25
tagstringOptional

A tag associated with the voucher.

createdinteger · int64Optional

The timestamp when the voucher was created.

Example: 1506599598
start_timeinteger · int64Optional

The timestamp when the voucher becomes valid.

Example: 1506579300
expiry_timeinteger · int64Optional

The timestamp when the voucher expires.

Example: 1509474600
valuestringOptional

The value of the voucher.

Example: 50.00
value_unitstring · enumOptional

The unit of the voucher's value.

Example: percentagePossible values:
currencystringOptional

The currency of the voucher's value.

Example: USD
redeemedintegerOptional

Indicates if the voucher has been redeemed (1 for true, 0 for false).

Example: 1
redeemed_dateinteger · int64 · nullableOptional

The timestamp when the voucher was redeemed.

Example: 1506601978
teamsstring[]Optional

A list of teams associated with the voucher.

brandsstring[]Optional

A list of brands associated with the voucher.

post/vouchers
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
AuthorizationstringRequired

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

Path parameters
voucherIdstringRequired

The ID of the voucher to retrieve.

Example: vcr-150659959859cce2ae044b5
Responses
200

A successful response returning the voucher details.

application/json
hrefstring · uriOptional

The unique URI for the voucher resource.

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

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

Path parameters
voucherIdstringRequired

The ID of the voucher to delete.

Example: vcr-150676308659cf614e2f56e
Responses
204

Voucher deleted successfully. No content is returned.

No content

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

No content

Last updated