Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains the different functions to run the operation postCoupons
Synopsis
- postCoupons :: forall m. MonadHTTP m => Maybe PostCouponsRequestBody -> StripeT m (Response PostCouponsResponse)
- data PostCouponsRequestBody = PostCouponsRequestBody {
- postCouponsRequestBodyAmountOff :: Maybe Int
- postCouponsRequestBodyAppliesTo :: Maybe PostCouponsRequestBodyAppliesTo'
- postCouponsRequestBodyCurrency :: Maybe Text
- postCouponsRequestBodyDuration :: Maybe PostCouponsRequestBodyDuration'
- postCouponsRequestBodyDurationInMonths :: Maybe Int
- postCouponsRequestBodyExpand :: Maybe [Text]
- postCouponsRequestBodyId :: Maybe Text
- postCouponsRequestBodyMaxRedemptions :: Maybe Int
- postCouponsRequestBodyMetadata :: Maybe PostCouponsRequestBodyMetadata'Variants
- postCouponsRequestBodyName :: Maybe Text
- postCouponsRequestBodyPercentOff :: Maybe Double
- postCouponsRequestBodyRedeemBy :: Maybe Int
- mkPostCouponsRequestBody :: PostCouponsRequestBody
- data PostCouponsRequestBodyAppliesTo' = PostCouponsRequestBodyAppliesTo' {}
- mkPostCouponsRequestBodyAppliesTo' :: PostCouponsRequestBodyAppliesTo'
- data PostCouponsRequestBodyDuration'
- data PostCouponsRequestBodyMetadata'Variants
- data PostCouponsResponse
Documentation
:: forall m. MonadHTTP m | |
=> Maybe PostCouponsRequestBody | The request body to send |
-> StripeT m (Response PostCouponsResponse) | Monadic computation which returns the result of the operation |
POST /v1/coupons
<p>You can create coupons easily via the <a href="https://dashboard.stripe.com/coupons">coupon management</a> page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.</p>
<p>A coupon has either a <code>percent_off</code> or an <code>amount_off</code> and <code>currency</code>. If you set an <code>amount_off</code>, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of <currency>100</currency> will have a final total of <currency>0</currency> if a coupon with an <code>amount_off</code> of <amount>200</amount> is applied to it and an invoice with a subtotal of <currency>300</currency> will have a final total of <currency>100</currency> if a coupon with an <code>amount_off</code> of <amount>200</amount> is applied to it.</p>
data PostCouponsRequestBody Source #
Defines the object schema located at paths./v1/coupons.POST.requestBody.content.application/x-www-form-urlencoded.schema
in the specification.
PostCouponsRequestBody | |
|
Instances
Eq PostCouponsRequestBody Source # | |
Defined in StripeAPI.Operations.PostCoupons | |
Show PostCouponsRequestBody Source # | |
Defined in StripeAPI.Operations.PostCoupons showsPrec :: Int -> PostCouponsRequestBody -> ShowS # show :: PostCouponsRequestBody -> String # showList :: [PostCouponsRequestBody] -> ShowS # | |
ToJSON PostCouponsRequestBody Source # | |
Defined in StripeAPI.Operations.PostCoupons toJSON :: PostCouponsRequestBody -> Value # toEncoding :: PostCouponsRequestBody -> Encoding # toJSONList :: [PostCouponsRequestBody] -> Value # | |
FromJSON PostCouponsRequestBody Source # | |
Defined in StripeAPI.Operations.PostCoupons |
mkPostCouponsRequestBody :: PostCouponsRequestBody Source #
Create a new PostCouponsRequestBody
with all required fields.
data PostCouponsRequestBodyAppliesTo' Source #
Defines the object schema located at paths./v1/coupons.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.applies_to
in the specification.
A hash containing directions for what this Coupon will apply discounts to.
mkPostCouponsRequestBodyAppliesTo' :: PostCouponsRequestBodyAppliesTo' Source #
Create a new PostCouponsRequestBodyAppliesTo'
with all required fields.
data PostCouponsRequestBodyDuration' Source #
Defines the enum schema located at paths./v1/coupons.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.duration
in the specification.
Specifies how long the discount will be in effect if used on a subscription. Can be `forever`, `once`, or `repeating`. Defaults to `once`.
PostCouponsRequestBodyDuration'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostCouponsRequestBodyDuration'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostCouponsRequestBodyDuration'EnumForever | Represents the JSON value |
PostCouponsRequestBodyDuration'EnumOnce | Represents the JSON value |
PostCouponsRequestBodyDuration'EnumRepeating | Represents the JSON value |
data PostCouponsRequestBodyMetadata'Variants Source #
Defines the oneOf schema located at paths./v1/coupons.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`.
PostCouponsRequestBodyMetadata'EmptyString | Represents the JSON value |
PostCouponsRequestBodyMetadata'Object Object |
data PostCouponsResponse Source #
Represents a response of the operation postCoupons
.
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), PostCouponsResponseError
is used.
PostCouponsResponseError String | Means either no matching case available or a parse error |
PostCouponsResponse200 Coupon | Successful response. |
PostCouponsResponseDefault Error | Error response. |
Instances
Eq PostCouponsResponse Source # | |
Defined in StripeAPI.Operations.PostCoupons (==) :: PostCouponsResponse -> PostCouponsResponse -> Bool # (/=) :: PostCouponsResponse -> PostCouponsResponse -> Bool # | |
Show PostCouponsResponse Source # | |
Defined in StripeAPI.Operations.PostCoupons showsPrec :: Int -> PostCouponsResponse -> ShowS # show :: PostCouponsResponse -> String # showList :: [PostCouponsResponse] -> ShowS # |