# Coupons

# Coupon Object

The `coupon` object represents a discount coupon that can be applied to an order. It has the following properties:

## Properties

| Property | Type | Description |
| --- | --- | --- |
| `reference_name` | string | A reference name for the coupon. This is for internal use and is not shown to customers. |
| `code` | string | The code that customers can use to redeem the coupon. This should be unique and easy to remember. |
| `note` | string | A note that will be shown to customers when they apply the coupon. This can be used to explain the details of the discount. |
| `coupon_type` | string | The type of coupon. Valid values are `"direct_discount"` and `"gift"`. |
| `discount_type` | string | The type of discount. Valid values are `"flat"` and `"percent"`. |
| `discount_value` | number | The value of the discount. This can be a flat amount or a percentage, depending on the value of `discount_type`. |
| `min_amount` | number | The minimum order amount required to use the coupon. |
| `max_amount` | number | The maximum order amount that the coupon can be applied to. |
| `max_discount` | number | The maximum discount that can be applied with the coupon. |
| `max_uses` | number | The maximum number of times the coupon can be used. |
| `max_uses_user` | number | The maximum number of times a single user can use the coupon. |
| `new_user` | boolean | Indicates whether the coupon is only available to new users. |
| `start_at` | string | The start date and time when the coupon becomes available. |
| `end_at` | string | The end date and time when the coupon expires. |
| `active` | boolean | Indicates whether the coupon is currently active. |

## Example

Here is an example of a `coupon` object:

```json
{
    "coupon": {
        "reference_name": "Holiday Campaign",
        "code": "HOLIDAY",
        "note": "Great! You have received $10 disount.",
        "coupon_type": "direct_discount",
        "discount_type": "flat",
        "discount_value": 10,
        "min_amount": 100,
        "max_amount": 0,
        "max_discount": 10,
        "max_uses": 1000,
        "max_uses_user": 1,
        "new_user": true,
        "start_at": "2022-12-12 00:00:00",
        "end_at": "2022-12-31 00:00:00",
        "active": true
    }
}

```