View Source ExOAPI.Stripe.Schemas.PromotionCode (exoapi_stripe v0.1.4)

description: A Promotion Code represents a customer-redeemable code for a coupon. It can be used to create multiple codes for a single coupon.

:active :: :boolean

Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.

:code :: :string

The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.

:coupon :: ExOAPI.Stripe.Schemas.Coupon

:created :: :integer

Time at which the object was created. Measured in seconds since the Unix epoch.

:customer :: ExOAPI.Stripe.Schemas.DeletedCustomer | ExOAPI.Stripe.Schemas.Customer | :string

The customer that this promotion code can be used by.

:expires_at :: :integer

Date at which the promotion code can no longer be redeemed.

:id :: :string

Unique identifier for the object.

:livemode :: :boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

:max_redemptions :: :integer

Maximum number of times this promotion code can be redeemed.

:metadata :: :map

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

:object :: :string

String representing the object's type. Objects of the same type share the same value.

:restrictions :: ExOAPI.Stripe.Schemas.PromotionCodesResourceRestrictions

:times_redeemed :: :integer

Number of times this promotion code has been used.

Link to this section Summary

Link to this section Types

@type params() :: map()
@type t() :: %ExOAPI.Stripe.Schemas.PromotionCode{
  active: boolean() | nil,
  code: String.t() | nil,
  coupon: ExOAPI.Stripe.Schemas.Coupon.t() | nil,
  created: integer() | nil,
  customer: ExOAPI.EctoTypes.AnyOf.t() | nil,
  expires_at: integer() | nil,
  id: String.t() | nil,
  livemode: boolean() | nil,
  max_redemptions: integer() | nil,
  metadata: map() | nil,
  object: :promotion_code | nil,
  restrictions:
    ExOAPI.Stripe.Schemas.PromotionCodesResourceRestrictions.t() | nil,
  times_redeemed: integer() | nil
}

Link to this section Functions

Link to this function

changeset(struct \\ %__MODULE__{}, params)

View Source
@spec changeset(t(), params()) :: Ecto.Changeset.t()