stripeapi-0.1.0.2: Stripe-Library

Safe HaskellNone
LanguageHaskell2010

StripeAPI.Operations.PostPlans

Description

Contains the different functions to run the operation postPlans

Synopsis

Documentation

postPlans Source #

Arguments

:: (MonadHTTP m, SecurityScheme s) 
=> Configuration s

The configuration to use in the request

-> PostPlansRequestBody

The request body to send

-> m (Either HttpException (Response PostPlansResponse))

Monad containing the result of the operation

POST /v1/plans

<p>You can create plans using the API, or in the Stripe <a href="https://dashboard.stripe.com/subscriptions/products">Dashboard</a>.</p>

postPlansRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> PostPlansRequestBody -> m (Either HttpException (Response ByteString)) Source #

POST /v1/plans

The same as postPlans but returns the raw ByteString

data PostPlansRequestBody Source #

Defines the data type for the schema postPlansRequestBody

Constructors

PostPlansRequestBody 

Fields

data PostPlansRequestBodyAggregateUsage' Source #

Defines the enum schema postPlansRequestBodyAggregate_usage'

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

data PostPlansRequestBodyBillingScheme' Source #

Defines the enum schema postPlansRequestBodyBilling_scheme'

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.

data PostPlansRequestBodyInterval' Source #

Defines the enum schema postPlansRequestBodyInterval'

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

data PostPlansRequestBodyMetadata' Source #

Defines the data type for the schema postPlansRequestBodyMetadata'

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'OneOf2 Source #

Defines the data type for the schema postPlansRequestBodyProduct'OneOf2

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.

data PostPlansRequestBodyProduct'OneOf2Metadata' Source #

Defines the data type for the schema postPlansRequestBodyProduct'OneOf2Metadata'

data PostPlansRequestBodyProduct'Variants Source #

Define the one-of schema postPlansRequestBodyProduct'

Instances
Eq PostPlansRequestBodyProduct'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

Show PostPlansRequestBodyProduct'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

Generic PostPlansRequestBodyProduct'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

ToJSON PostPlansRequestBodyProduct'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

FromJSON PostPlansRequestBodyProduct'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

type Rep PostPlansRequestBodyProduct'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

type Rep PostPlansRequestBodyProduct'Variants = D1 (MetaData "PostPlansRequestBodyProduct'Variants" "StripeAPI.Operations.PostPlans" "stripeapi-0.1.0.2-D0ebvtj6l9B4TLqRwmHKaP" False) (C1 (MetaCons "PostPlansRequestBodyProduct'Text" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :+: C1 (MetaCons "PostPlansRequestBodyProduct'PostPlansRequestBodyProduct'OneOf2" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PostPlansRequestBodyProduct'OneOf2)))

data PostPlansRequestBodyTiers' Source #

Defines the data type for the schema postPlansRequestBodyTiers'

data PostPlansRequestBodyTiers'UpTo'OneOf1 Source #

Defines the enum schema postPlansRequestBodyTiers'Up_to'OneOf1

data PostPlansRequestBodyTiers'UpTo'Variants Source #

Define the one-of schema postPlansRequestBodyTiers'Up_to'

Instances
Eq PostPlansRequestBodyTiers'UpTo'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

Show PostPlansRequestBodyTiers'UpTo'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

Generic PostPlansRequestBodyTiers'UpTo'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

ToJSON PostPlansRequestBodyTiers'UpTo'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

FromJSON PostPlansRequestBodyTiers'UpTo'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

type Rep PostPlansRequestBodyTiers'UpTo'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostPlans

type Rep PostPlansRequestBodyTiers'UpTo'Variants = D1 (MetaData "PostPlansRequestBodyTiers'UpTo'Variants" "StripeAPI.Operations.PostPlans" "stripeapi-0.1.0.2-D0ebvtj6l9B4TLqRwmHKaP" False) (C1 (MetaCons "PostPlansRequestBodyTiers'UpTo'PostPlansRequestBodyTiers'UpTo'OneOf1" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PostPlansRequestBodyTiers'UpTo'OneOf1)) :+: C1 (MetaCons "PostPlansRequestBodyTiers'UpTo'Integer" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer)))

data PostPlansRequestBodyTiersMode' Source #

Defines the enum schema postPlansRequestBodyTiers_mode'

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.

data PostPlansRequestBodyTransformUsage' Source #

Defines the data type for the schema postPlansRequestBodyTransform_usage'

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 postPlansRequestBodyTransform_usage'Round'

data PostPlansRequestBodyUsageType' Source #

Defines the enum schema postPlansRequestBodyUsage_type'

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

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.