Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains the different functions to run the operation postCoupons
Synopsis
- postCoupons :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> PostCouponsRequestBody -> m (Either HttpException (Response PostCouponsResponse))
- postCouponsRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> PostCouponsRequestBody -> m (Either HttpException (Response ByteString))
- postCouponsM :: forall m s. (MonadHTTP m, SecurityScheme s) => PostCouponsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response PostCouponsResponse))
- postCouponsRawM :: forall m s. (MonadHTTP m, SecurityScheme s) => PostCouponsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response ByteString))
- data PostCouponsRequestBody = PostCouponsRequestBody {
- postCouponsRequestBodyAmountOff :: Maybe Integer
- postCouponsRequestBodyCurrency :: Maybe String
- postCouponsRequestBodyDuration :: PostCouponsRequestBodyDuration'
- postCouponsRequestBodyDurationInMonths :: Maybe Integer
- postCouponsRequestBodyExpand :: Maybe ([] String)
- postCouponsRequestBodyId :: Maybe String
- postCouponsRequestBodyMaxRedemptions :: Maybe Integer
- postCouponsRequestBodyMetadata :: Maybe PostCouponsRequestBodyMetadata'
- postCouponsRequestBodyName :: Maybe String
- postCouponsRequestBodyPercentOff :: Maybe Double
- postCouponsRequestBodyRedeemBy :: Maybe Integer
- data PostCouponsRequestBodyDuration'
- data PostCouponsRequestBodyMetadata' = PostCouponsRequestBodyMetadata' {
- data PostCouponsResponse
Documentation
:: (MonadHTTP m, SecurityScheme s) | |
=> Configuration s | The configuration to use in the request |
-> PostCouponsRequestBody | The request body to send |
-> m (Either HttpException (Response PostCouponsResponse)) | Monad containing 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>
postCouponsRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> PostCouponsRequestBody -> m (Either HttpException (Response ByteString)) Source #
POST /v1/coupons
The same as postCoupons
but returns the raw ByteString
postCouponsM :: forall m s. (MonadHTTP m, SecurityScheme s) => PostCouponsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response PostCouponsResponse)) Source #
POST /v1/coupons
Monadic version of postCoupons
(use with runWithConfiguration
)
postCouponsRawM :: forall m s. (MonadHTTP m, SecurityScheme s) => PostCouponsRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response ByteString)) Source #
POST /v1/coupons
Monadic version of postCouponsRaw
(use with runWithConfiguration
)
data PostCouponsRequestBody Source #
Defines the data type for the schema postCouponsRequestBody
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 |
data PostCouponsRequestBodyDuration' Source #
Defines the enum schema postCouponsRequestBodyDuration'
Specifies how long the discount will be in effect. Can be `forever`, `once`, or `repeating`.
data PostCouponsRequestBodyMetadata' Source #
Defines the data type for the schema postCouponsRequestBodyMetadata'
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 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 # |