stripeapi-2.0.0.1: Stripe-Library
Safe HaskellNone
LanguageHaskell2010

StripeAPI.Types.Subscription

Description

Contains the types generated from the schema Subscription

Synopsis

Documentation

data Subscription Source #

Defines the object schema located at components.schemas.subscription in the specification.

Subscriptions allow you to charge a customer on a recurring basis.

Related guide: Creating Subscriptions.

Constructors

Subscription 

Fields

data SubscriptionBillingThresholds' Source #

Defines the object schema located at components.schemas.subscription.properties.billing_thresholds.anyOf in the specification.

Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period

Constructors

SubscriptionBillingThresholds' 

Fields

  • subscriptionBillingThresholds'AmountGte :: Maybe Int

    amount_gte: Monetary threshold that triggers the subscription to create an invoice

  • subscriptionBillingThresholds'ResetBillingCycleAnchor :: Maybe Bool

    reset_billing_cycle_anchor: Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.

data SubscriptionCollectionMethod' Source #

Defines the enum schema located at components.schemas.subscription.properties.collection_method in the specification.

Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.

Constructors

SubscriptionCollectionMethod'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

SubscriptionCollectionMethod'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

SubscriptionCollectionMethod'EnumChargeAutomatically

Represents the JSON value "charge_automatically"

SubscriptionCollectionMethod'EnumSendInvoice

Represents the JSON value "send_invoice"

data SubscriptionDefaultPaymentMethod'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.default_payment_method.anyOf in the specification.

ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source.

data SubscriptionDefaultSource'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.default_source.anyOf in the specification.

ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source.

data SubscriptionDiscount' Source #

Defines the object schema located at components.schemas.subscription.properties.discount.anyOf in the specification.

Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.

Constructors

SubscriptionDiscount' 

Fields

data SubscriptionDiscount'Customer'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.discount.anyOf.properties.customer.anyOf in the specification.

The ID of the customer associated with this discount.

data SubscriptionDiscount'Object' Source #

Defines the enum schema located at components.schemas.subscription.properties.discount.anyOf.properties.object in the specification.

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

Constructors

SubscriptionDiscount'Object'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

SubscriptionDiscount'Object'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

SubscriptionDiscount'Object'EnumDiscount

Represents the JSON value "discount"

data SubscriptionDiscount'PromotionCode'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.discount.anyOf.properties.promotion_code.anyOf in the specification.

The promotion code applied to create this discount.

data SubscriptionItems' Source #

Defines the object schema located at components.schemas.subscription.properties.items in the specification.

List of subscription items, each with an attached price.

Constructors

SubscriptionItems' 

Fields

data SubscriptionLatestInvoice'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.latest_invoice.anyOf in the specification.

The most recent invoice this subscription has generated.

data SubscriptionPauseCollection' Source #

Defines the object schema located at components.schemas.subscription.properties.pause_collection.anyOf in the specification.

If specified, payment collection for this subscription will be paused.

Constructors

SubscriptionPauseCollection' 

Fields

data SubscriptionPauseCollection'Behavior' Source #

Defines the enum schema located at components.schemas.subscription.properties.pause_collection.anyOf.properties.behavior in the specification.

The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.

Constructors

SubscriptionPauseCollection'Behavior'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

SubscriptionPauseCollection'Behavior'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

SubscriptionPauseCollection'Behavior'EnumKeepAsDraft

Represents the JSON value "keep_as_draft"

SubscriptionPauseCollection'Behavior'EnumMarkUncollectible

Represents the JSON value "mark_uncollectible"

SubscriptionPauseCollection'Behavior'EnumVoid

Represents the JSON value "void"

data SubscriptionPendingInvoiceItemInterval' Source #

Defines the object schema located at components.schemas.subscription.properties.pending_invoice_item_interval.anyOf in the specification.

Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval.

Constructors

SubscriptionPendingInvoiceItemInterval' 

Fields

data SubscriptionPendingInvoiceItemInterval'Interval' Source #

Defines the enum schema located at components.schemas.subscription.properties.pending_invoice_item_interval.anyOf.properties.interval in the specification.

Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.

Constructors

SubscriptionPendingInvoiceItemInterval'Interval'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

SubscriptionPendingInvoiceItemInterval'Interval'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

SubscriptionPendingInvoiceItemInterval'Interval'EnumDay

Represents the JSON value "day"

SubscriptionPendingInvoiceItemInterval'Interval'EnumMonth

Represents the JSON value "month"

SubscriptionPendingInvoiceItemInterval'Interval'EnumWeek

Represents the JSON value "week"

SubscriptionPendingInvoiceItemInterval'Interval'EnumYear

Represents the JSON value "year"

data SubscriptionPendingSetupIntent'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.pending_setup_intent.anyOf in the specification.

You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide.

data SubscriptionPendingUpdate' Source #

Defines the object schema located at components.schemas.subscription.properties.pending_update.anyOf in the specification.

If specified, pending updates that will be applied to the subscription once the \`latest_invoice\` has been paid.

Constructors

SubscriptionPendingUpdate' 

Fields

data SubscriptionStatus' Source #

Defines the enum schema located at components.schemas.subscription.properties.status in the specification.

Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`.

For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated.

A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over.

If subscription `collection_method=charge_automatically` it becomes `past_due` when payment to renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.

If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

Constructors

SubscriptionStatus'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

SubscriptionStatus'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

SubscriptionStatus'EnumActive

Represents the JSON value "active"

SubscriptionStatus'EnumCanceled

Represents the JSON value "canceled"

SubscriptionStatus'EnumIncomplete

Represents the JSON value "incomplete"

SubscriptionStatus'EnumIncompleteExpired

Represents the JSON value "incomplete_expired"

SubscriptionStatus'EnumPastDue

Represents the JSON value "past_due"

SubscriptionStatus'EnumTrialing

Represents the JSON value "trialing"

SubscriptionStatus'EnumUnpaid

Represents the JSON value "unpaid"

data SubscriptionTransferData' Source #

Defines the object schema located at components.schemas.subscription.properties.transfer_data.anyOf in the specification.

The account (if any) the subscription\'s payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription\'s invoices.

Constructors

SubscriptionTransferData' 

Fields

data SubscriptionTransferData'Destination'Variants Source #

Defines the oneOf schema located at components.schemas.subscription.properties.transfer_data.anyOf.properties.destination.anyOf in the specification.

The account where funds from the payment will be transferred to upon payment success.