PolarExpress.Schemas.DiscountFixedOnceForeverDurationCreate (polar_express v0.1.5)

Copy Markdown View Source

DiscountFixedOnceForeverDurationCreate

Schema to create a fixed amount discount that is applied once or forever.

Summary

Types

t()

@type t() :: %PolarExpress.Schemas.DiscountFixedOnceForeverDurationCreate{
  amount: integer() | nil,
  code: String.t() | nil,
  currency: PolarExpress.Schemas.PresentmentCurrency.t() | nil,
  duration: PolarExpress.Schemas.DiscountDuration.t() | nil,
  ends_at: DateTime.t() | nil,
  max_redemptions: integer() | nil,
  metadata:
    %{
      required(String.t()) => String.t() | integer() | float() | boolean() | nil
    }
    | nil,
  name: String.t() | nil,
  organization_id: String.t() | nil,
  products: [String.t()] | nil,
  starts_at: DateTime.t() | nil,
  type: PolarExpress.Schemas.DiscountType.t() | nil
}
  • amount - Fixed amount to discount from the invoice total.
  • code - Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API. Nullable.
  • currency - The currency of the fixed amount discount.
  • duration
  • ends_at - Optional timestamp after which the discount is no longer redeemable. Nullable.
  • max_redemptions - Optional maximum number of times the discount can be redeemed. Nullable.
  • metadata - Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

  • name - Name of the discount. Will be displayed to the customer when the discount is applied.
  • organization_id - The ID of the organization owning the discount. Required unless you use an organization token. Nullable.
  • products - Nullable.
  • starts_at - Optional timestamp after which the discount is redeemable. Nullable.
  • type - Type of the discount.

Functions

schema_name()