The coupon object

A coupon contains information about an amount-based or percentage-based discount which can be applied to a customer order through promotion codes.

<div class="APISectionHeader">
  <strong>Attributes</strong>
</div>

<div class="attributes">
  <dl>
    <dt>
      <span class="label">id</span>
      <span class="type">string</span>
    </dt>
    <dd>Unique identifier for the Coupon object.</dd>

    <dt>
      <span class="label">object</span>
      <span class="type">string, value is "coupon"</span>
    </dt>
    <dd>A string representing the object’s type. Objects of the same type share the same value.</dd>

    <dt>
      <span class="label">active</span>
      <span class="type">boolean</span>
    </dt>
    <dd>Has the value <code>true</code> if the coupon is active and can be used, or the value <code>false</code> if it is not.</dd>

    <dt>
      <span class="label">createdAt</span>
      <span class="type">timestamp</span>
    </dt>
    <dd>Time at which the object was created. Measured in milliseconds since the Unix epoch.</dd>

    <dt>
      <span class="label">currency</span>
      <span class="type">string</span>
    </dt>
    <dd>If the discountType is <code>amount</code>, three-letter ISO currency code, in lowercase. Must be a supported currency.</dd>

    <dt>
      <span class="label">discountAmount</span>
      <span class="type">positive number</span>
    </dt>
    <dd>If the discountType is <code>amount</code>, the discount amount of this coupon object.</dd>

    <dt>
      <span class="label">discountPercentage</span>
      <span class="type">number</span>
    </dt>
    <dd>If the discountType is <code>percentage</code>, the discount percentage of this coupon object.</dd>

    <dt>
      <span class="label">discountType</span>
      <span class="type">enum</span>
    </dt>
    <dd>
      The type of discount of this coupon.
      <div class="values-list-container">
        <div class="values-list-header">Possible enum values</div>
        <ul class="values-list">
          <li class="values-list-item">
            <span class="values-list-item-value"><code>amount</code></span>
            <p class="values-list-item-description">A coupon for a fixed amount</p>
          </li>
          <li class="values-list-item">
            <span class="values-list-item-value"><code>percentage</code></span>
            <p class="values-list-item-description">A coupon for a percentage of the amount</p>
          </li>
        </ul>
      </div>
    </dd>

    <dt>
      <span class="label">expiresAt</span>
      <span class="type">timestamp</span>
      <span class="required">or null</span>
    </dt>
    <dd>Time at which the Coupon expires. Measured in milliseconds since the Unix epoch.</dd>

    <dt>
      <span class="label">maxRedemptionCount</span>
      <span class="type">positive integer</span>
      <span class="required">or null</span>
    </dt>
    <dd>Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.</dd>

    <dt>
      <span class="label">metadata</span>
      <span class="type">object</span>
    </dt>
    <dd>Set of <a target="_self" href="/reference/metadata">key-value pairs</a> that you can attach to the Coupon object.</dd>

    <dt>
      <span class="label">name</span>
      <span class="type">string</span>
    </dt>
    <dd>The coupon's name, meant to be displayable to the customer.</dd>

    <dt>
      <span class="label">redemptionCount</span>
      <span class="type">positive integer</span>
    </dt>
    <dd>Number of times this coupon has been applied to an order.</dd>

    <dt>
      <span class="label">sponsored</span>
      <span class="type">boolean</span>
    </dt>
    <dd>Has the value <code>true</code> if the coupon is Smartpay funded, or the value <code>false</code> if it is not.</dd>

    <dt>
      <span class="label">test</span>
      <span class="type">boolean</span>
    </dt>
    <dd>A flag with a value <code>false</code> if the object exists in live mode or <code>true</code> if the object exists in test mode.</dd>

    <dt>
      <span class="label">updatedAt</span>
      <span class="type">timestamp</span>
    </dt>
    <dd>Time at which the object was last updated. Measured in milliseconds since the Unix epoch.</dd>
  </dl>
</div>