HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulestripeapi-3.0.0.0Haskell2010

StripeAPI.Operations.PostPlans

Contains the different functions to run the operation postPlans

  • 14 types
  • 5 values
valuepostPlans
  1. :: MonadHTTP m
  2. => PostPlansRequestBody

    The request body to send

  3. -> ClientT m (Response PostPlansResponse)

    Monadic computation which returns the result of the operation

#
POST /v1/plans

<p>You can now model subscriptions more flexibly using the <a href="#prices">Prices API</a>. It replaces the Plans API and is backwards compatible to simplify your migration.</p>

datadata PostPlansRequestBody
#

Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema in the specification.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.aggregate_usage in the specification.

Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.billing_scheme in the specification.

Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.interval in the specification.

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

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the oneOf schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.metadata.anyOf in the specification.

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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.

Instances4Eq, Show, FromJSON, ToJSON

Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.product.anyOf in the specification.

The product whose pricing the created plan will represent. This can either be the ID of an existing product, or a dictionary containing fields used to create a service product.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the oneOf schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.product.anyOf in the specification.

Instances4Eq, Show, FromJSON, ToJSON

Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.tiers.items in the specification.

Instances4Eq, Show, FromJSON, ToJSON

Defines the oneOf schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.tiers.items.properties.up_to.anyOf in the specification.

Instances4Eq, Show, FromJSON, ToJSON

Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.tiers_mode in the specification.

Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.transform_usage in the specification.

Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`.

Instances4Eq, Show, FromJSON, ToJSON

Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.transform_usage.properties.round in the specification.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.usage_type in the specification.

Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.

Constructors

Instances4Eq, Show, FromJSON, ToJSON
datadata PostPlansResponse
#

Represents a response of the operation postPlans.

The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), PostPlansResponseError is used.

Constructors

Instances2Eq, Show