stripeapi-0.1.0.0: Stripe-Library

Safe HaskellNone
LanguageHaskell2010

StripeAPI.Operations.PostCoupons

Description

Contains the different functions to run the operation postCoupons

Synopsis

Documentation

postCoupons Source #

Arguments

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

data PostCouponsRequestBody Source #

Defines the data type for the schema postCouponsRequestBody

Constructors

PostCouponsRequestBody 

Fields

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.

Constructors

PostCouponsResponseError String

Means either no matching case available or a parse error

PostCouponsResponse200 Coupon

Successful response.

PostCouponsResponseDefault Error

Error response.