Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains the different functions to run the operation postSubscriptionItemsSubscriptionItemUsageRecords
Synopsis
- postSubscriptionItemsSubscriptionItemUsageRecords :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> m (Either HttpException (Response PostSubscriptionItemsSubscriptionItemUsageRecordsResponse))
- postSubscriptionItemsSubscriptionItemUsageRecordsRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> m (Either HttpException (Response ByteString))
- postSubscriptionItemsSubscriptionItemUsageRecordsM :: forall m s. (MonadHTTP m, SecurityScheme s) => String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response PostSubscriptionItemsSubscriptionItemUsageRecordsResponse))
- postSubscriptionItemsSubscriptionItemUsageRecordsRawM :: forall m s. (MonadHTTP m, SecurityScheme s) => String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response ByteString))
- data PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody = PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody {
- postSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction :: Maybe PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'
- postSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyExpand :: Maybe ([] String)
- postSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyQuantity :: Integer
- postSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyTimestamp :: Integer
- data PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'
- = PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'EnumOther Value
- | PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'EnumTyped String
- | PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'EnumStringIncrement
- | PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'EnumStringSet
- data PostSubscriptionItemsSubscriptionItemUsageRecordsResponse
Documentation
postSubscriptionItemsSubscriptionItemUsageRecords Source #
:: (MonadHTTP m, SecurityScheme s) | |
=> Configuration s | The configuration to use in the request |
-> String | subscription_item |
-> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody | The request body to send |
-> m (Either HttpException (Response PostSubscriptionItemsSubscriptionItemUsageRecordsResponse)) | Monad containing the result of the operation |
POST /v1/subscription_items/{subscription_item}/usage_records
<p>Creates a usage record for a specified subscription item and date, and fills it with a quantity.</p>
<p>Usage records provide <code>quantity</code> information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the <a href="https://stripe.com/docs/billing/subscriptions/metered-billing">metered billing</a> plan, Stripe helps you send accurate invoices to your customers.</p>
<p>The default calculation for usage is to add up all the <code>quantity</code> values of the usage records within a billing period. You can change this default behavior with the billing plan’s <code>aggregate_usage</code> <a href="/docs/api/plans/create#create_plan-aggregate_usage">parameter</a>. When there is more than one usage record with the same timestamp, Stripe adds the <code>quantity</code> values together. In most cases, this is the desired resolution, however, you can change this behavior with the <code>action</code> parameter.</p>
<p>The default pricing model for metered billing is <a href="/docs/api/plans/object#plan_object-billing_scheme">per-unit pricing</a>. For finer granularity, you can configure metered billing to have a <a href="https://stripe.com/docs/billing/subscriptions/tiers">tiered pricing</a> model.</p>
postSubscriptionItemsSubscriptionItemUsageRecordsRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> m (Either HttpException (Response ByteString)) Source #
POST /v1/subscription_items/{subscription_item}/usage_records
The same as postSubscriptionItemsSubscriptionItemUsageRecords
but returns the raw ByteString
postSubscriptionItemsSubscriptionItemUsageRecordsM :: forall m s. (MonadHTTP m, SecurityScheme s) => String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response PostSubscriptionItemsSubscriptionItemUsageRecordsResponse)) Source #
POST /v1/subscription_items/{subscription_item}/usage_records
Monadic version of postSubscriptionItemsSubscriptionItemUsageRecords
(use with runWithConfiguration
)
postSubscriptionItemsSubscriptionItemUsageRecordsRawM :: forall m s. (MonadHTTP m, SecurityScheme s) => String -> PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response ByteString)) Source #
POST /v1/subscription_items/{subscription_item}/usage_records
Monadic version of postSubscriptionItemsSubscriptionItemUsageRecordsRaw
(use with runWithConfiguration
)
data PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody Source #
Defines the data type for the schema postSubscriptionItemsSubscriptionItemUsageRecordsRequestBody
PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBody | |
|
Instances
data PostSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction' Source #
Defines the enum schema postSubscriptionItemsSubscriptionItemUsageRecordsRequestBodyAction'
Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has billing thresholds, `increment` is the only allowed value.
Instances
data PostSubscriptionItemsSubscriptionItemUsageRecordsResponse Source #
Represents a response of the operation postSubscriptionItemsSubscriptionItemUsageRecords
.
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), PostSubscriptionItemsSubscriptionItemUsageRecordsResponseError
is used.
PostSubscriptionItemsSubscriptionItemUsageRecordsResponseError String | Means either no matching case available or a parse error |
PostSubscriptionItemsSubscriptionItemUsageRecordsResponse200 UsageRecord | Successful response. |
PostSubscriptionItemsSubscriptionItemUsageRecordsResponseDefault Error | Error response. |
Instances
Eq PostSubscriptionItemsSubscriptionItemUsageRecordsResponse Source # | |
Show PostSubscriptionItemsSubscriptionItemUsageRecordsResponse Source # | |