Skip to Content
Paycose Docs
Coupons

Coupons

The coupon object

A coupon is a discount, a percentage or a fixed amount off, that you apply to invoices, quotes, subscriptions and Checkout Sessions, either directly or through a promotion code a customer enters.

Attributes

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.

  • namestringRequired

    Name of the coupon. Its letters and digits also start the code of the promotion code created with the coupon.

  • activebooleanRequired

    Whether the coupon can be redeemed. An inactive coupon is refused on new invoices, quotes and checkouts.

  • durationenumRequired

    How long the discount lasts on a subscription: once, repeating or forever.

    • once

      The discount applies to the first billing period only.

    • repeating

      The discount applies for duration_in_months months from when it is first applied.

    • forever

      The discount applies to every billing period.

  • duration_in_monthsintegerRequired

    Number of months the discount lasts when duration is repeating; 0 otherwise.

  • percentagenumberRequired

    Percentage taken off, above 0 and up to 100. 0 for a fixed-amount coupon.

  • fixed_amountintegerRequired

    Amount taken off, in the smallest unit of currency (for example, 5000 is 50.00 THB). 0 for a percentage coupon.

  • currencystringRequired

    Three-letter ISO 4217 code of fixed_amount, in lowercase. Empty when no currency was set, which is usual for a percentage coupon.

  • redeem_bytimestampRequiredNullable

    Last time the coupon can be redeemed, in Unix seconds. Null when there is no deadline.

  • metadataobjectRequired

    Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

  • max_redemptionsintegerRequiredNullable

    Maximum number of times the coupon can be redeemed across all customers. Null when there is no limit.

  • times_redeemedintegerRequired

    Number of times the coupon has been redeemed.

  • once_per_customerbooleanRequired

    Whether each customer can redeem the coupon only once. When true, the document it is applied to must have a customer.

  • starts_attimestampRequiredNullable

    Earliest time the coupon can be redeemed, in Unix seconds. Null when it can be redeemed right away.

  • applies_to_productsarray of stringsRequired

    IDs of the products the discount is limited to. Only lines for these products are discounted, and a document with none of them is refused. Empty when the coupon applies to every product.