stripeapi-1.0.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

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

Constructors

PostCouponsRequestBody 

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.

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

Constructors

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 "forever"

PostCouponsRequestBodyDuration'EnumOnce

Represents the JSON value "once"

PostCouponsRequestBodyDuration'EnumRepeating

Represents the JSON value "repeating"

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

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.