stripeapi-2.0.1.0: Stripe-Library
Safe HaskellNone
LanguageHaskell2010

StripeAPI.Operations.PostPlans

Description

Contains the different functions to run the operation postPlans

Synopsis

Documentation

postPlans Source #

Arguments

:: forall m. MonadHTTP m 
=> PostPlansRequestBody

The request body to send

-> 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>

data PostPlansRequestBody Source #

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

Constructors

PostPlansRequestBody 

Fields

data PostPlansRequestBodyAggregateUsage' Source #

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

PostPlansRequestBodyAggregateUsage'Other Value

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

PostPlansRequestBodyAggregateUsage'Typed Text

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

PostPlansRequestBodyAggregateUsage'EnumLastDuringPeriod

Represents the JSON value "last_during_period"

PostPlansRequestBodyAggregateUsage'EnumLastEver

Represents the JSON value "last_ever"

PostPlansRequestBodyAggregateUsage'EnumMax

Represents the JSON value "max"

PostPlansRequestBodyAggregateUsage'EnumSum

Represents the JSON value "sum"

data PostPlansRequestBodyBillingScheme' Source #

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

PostPlansRequestBodyBillingScheme'Other Value

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

PostPlansRequestBodyBillingScheme'Typed Text

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

PostPlansRequestBodyBillingScheme'EnumPerUnit

Represents the JSON value "per_unit"

PostPlansRequestBodyBillingScheme'EnumTiered

Represents the JSON value "tiered"

data PostPlansRequestBodyInterval' Source #

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

PostPlansRequestBodyInterval'Other Value

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

PostPlansRequestBodyInterval'Typed Text

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

PostPlansRequestBodyInterval'EnumDay

Represents the JSON value "day"

PostPlansRequestBodyInterval'EnumMonth

Represents the JSON value "month"

PostPlansRequestBodyInterval'EnumWeek

Represents the JSON value "week"

PostPlansRequestBodyInterval'EnumYear

Represents the JSON value "year"

data PostPlansRequestBodyMetadata'Variants Source #

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`.

data PostPlansRequestBodyProduct'OneOf1 Source #

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

PostPlansRequestBodyProduct'OneOf1 

Fields

data PostPlansRequestBodyProduct'Variants Source #

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

data PostPlansRequestBodyTiers' Source #

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

data PostPlansRequestBodyTiers'UpTo'Variants Source #

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.

data PostPlansRequestBodyTiersMode' Source #

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

PostPlansRequestBodyTiersMode'Other Value

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

PostPlansRequestBodyTiersMode'Typed Text

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

PostPlansRequestBodyTiersMode'EnumGraduated

Represents the JSON value "graduated"

PostPlansRequestBodyTiersMode'EnumVolume

Represents the JSON value "volume"

data PostPlansRequestBodyTransformUsage' Source #

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`.

data PostPlansRequestBodyTransformUsage'Round' Source #

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

PostPlansRequestBodyTransformUsage'Round'Other Value

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

PostPlansRequestBodyTransformUsage'Round'Typed Text

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

PostPlansRequestBodyTransformUsage'Round'EnumDown

Represents the JSON value "down"

PostPlansRequestBodyTransformUsage'Round'EnumUp

Represents the JSON value "up"

data PostPlansRequestBodyUsageType' Source #

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

PostPlansRequestBodyUsageType'Other Value

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

PostPlansRequestBodyUsageType'Typed Text

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

PostPlansRequestBodyUsageType'EnumLicensed

Represents the JSON value "licensed"

PostPlansRequestBodyUsageType'EnumMetered

Represents the JSON value "metered"

data PostPlansResponse Source #

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

PostPlansResponseError String

Means either no matching case available or a parse error

PostPlansResponse200 Plan

Successful response.

PostPlansResponseDefault Error

Error response.