{
  "coupon": {
    "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "name": "Startup Deal",
    "code": "startup_deal",
    "description": "I am a coupon description",
    "coupon_type": "fixed_amount",
    "amount_cents": 5000,
    "amount_currency": "USD",
    "reusable": true,
    "limited_plans": true,
    "plan_codes": [
      "startup_plan"
    ],
    "limited_billable_metrics": "boolean",
    "billable_metric_codes": [],
    "percentage_rate": "string",
    "frequency": "recurring",
    "frequency_duration": 6,
    "expiration": "time_limit",
    "expiration_at": "2022-08-08T23:59:59Z",
    "created_at": "2022-04-29T08:59:51Z"
  }
}

Attributes

coupon
object
lago_id
string
required

Unique identifier of the coupon, created by Lago.

name
string
required

The name of the coupon.

code
string
required

Unique code used to identify the coupon.

amount_cents
integer

The amount of the coupon in cents. This field is required only for coupon with fixed_amount type.

amount_currency
string

The currency of the coupon. This field is required only for coupon with fixed_amount type.

reusable
boolean

Indicates whether the coupon can be reused or not. If set to true, the coupon is reusable, meaning it can be applied multiple times to the same customer. If set to false, the coupon can only be used once and is not reusable. If not specified, this field is set to true by default.

expiration
string
required

Specifies the type of expiration for the coupon. It can have two possible values: time_limit or no_expiration.

  • If set to time_limit, the coupon has an expiration based on a specified time limit.
  • If set to no_expiration, the coupon does not have an expiration date and remains valid indefinitely.
expiration_at
string

The expiration date and time of the coupon. This field is required only for coupons with expiration set to time_limit. The expiration date and time should be specified in UTC format according to the ISO 8601 datetime standard. It indicates the exact moment when the coupon will expire and is no longer valid.

coupon_type
string
required

The type of the coupon. It can have two possible values: fixed_amount or percentage.

  • If set to fixed_amount, the coupon represents a fixed amount discount.
  • If set to percentage, the coupon represents a percentage-based discount.
frequency
string
required

The type of frequency for the coupon. It can have three possible values: once, recurring, or forever.

  • If set to once, the coupon is applicable only for a single use.
  • If set to recurring, the coupon can be used multiple times for recurring billing periods.
  • If set to forever, the coupon has unlimited usage and can be applied indefinitely.
frequency_duration
integer

Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a recurring frequency type

percentage_rate
float

The percentage rate of the coupon. This field is required only for coupons with a percentage coupon type.

limited_plans
boolean
required

The coupon is limited to specific plans. The possible values can be true or false.

plan_codes
array

An array of plan codes to which the coupon is applicable. By specifying the plan codes in this field, you can restrict the coupon’s usage to specific plans only.

limited_billable_metrics
boolean
required

The coupon is limited to specific billable metrics. The possible values can be true or false.

billable_metric_codes
array

An array of billable metric codes to which the coupon is applicable. By specifying the billable metric codes in this field, you can restrict the coupon’s usage to specific metrics only.

created_at
string
required

The date and time when the coupon was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the coupon was initially created.