# Coupons

## Vauchar API: Coupons

*A guide to managing and retrieving coupon resources with the Vauchar REST API.*

The Vauchar API provides a complete, RESTful interface for integrating coupon functionality into your application. This document focuses specifically on creating and managing **Coupon** resources.

A Coupon is the core object representing a discount. You can retrieve lists of all available coupons or fetch individual ones by their unique ID.

#### Quickstart Info

* **Architecture:** RESTful
* **Response Format:** JSON
* **Authentication:** HTTP Basic Auth
* **Base URL:** `https://api.vauchar.com`

#### Authentication

All requests must be authenticated using **HTTP Basic Authentication**. The API expects an `Authorization` header containing a Base64 encoded string of your `<Your_Merchant_Id>:<Your_Api_Key>`.

#### The Coupon Object

When you retrieve coupon information, you will receive a Coupon object with the following attributes:

| Attribute                    | Type    | Description                                                                         |
| ---------------------------- | ------- | ----------------------------------------------------------------------------------- |
| `id`                         | string  | The unique identifier for the coupon.                                               |
| `coupon_code`                | string  | The code that customers use to redeem the coupon.                                   |
| `active_status`              | integer | The status of the coupon (1 for active, 0 for inactive).                            |
| `value`                      | string  | The discount value of the coupon.                                                   |
| `value_unit`                 | string  | The unit of the discount (e.g., 'value' for fixed amount, 'percent').               |
| `currency`                   | string  | The currency of the coupon's value (e.g., 'USD').                                   |
| `start_time`                 | integer | The timestamp when the coupon becomes valid (Unix timestamp).                       |
| `expiry_time`                | integer | The timestamp when the coupon expires (Unix timestamp). `0` means it never expires. |
| `redemptions_limit_total`    | integer | The total number of times this coupon can be redeemed. `0` means unlimited.         |
| `redemptions_limit_per_user` | integer | The number of times a single user can redeem this coupon. `0` means unlimited.      |
| `created`                    | integer | The timestamp when the coupon was created (Unix timestamp).                         |
| `href`                       | string  | The direct URL to this specific coupon resource.                                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vauchar.gitbook.io/vauchar/api-references/coupons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
