HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulestripeapi-3.0.0.0Haskell2010

StripeAPI.Operations.PostCoupons

Contains the different functions to run the operation postCoupons

  • 5 types
  • 3 values
valuepostCoupons
  1. :: MonadHTTP m
  2. => Maybe PostCouponsRequestBody

    The request body to send

  3. -> ClientT 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>

Defines the object schema located at paths./v1/coupons.POST.requestBody.content.application/x-www-form-urlencoded.schema in the specification.

Constructors

Instances4Eq, Show, FromJSON, ToJSON

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.

Instances4Eq, Show, FromJSON, ToJSON

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

Instances4Eq, Show, FromJSON, ToJSON

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

Instances4Eq, Show, FromJSON, ToJSON
datadata PostCouponsResponse
#

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

Instances2Eq, Show