stripeapi-2.0.1.0: Stripe-Library
Safe HaskellNone
LanguageHaskell2010

StripeAPI.Operations.PostCreditNotes

Description

Contains the different functions to run the operation postCreditNotes

Synopsis

Documentation

postCreditNotes Source #

Arguments

:: forall m. MonadHTTP m 
=> PostCreditNotesRequestBody

The request body to send

-> ClientT m (Response PostCreditNotesResponse)

Monadic computation which returns the result of the operation

POST /v1/credit_notes

<p>Issue a credit note to adjust the amount of a finalized invoice. For a <code>status=open</code> invoice, a credit note reduces its <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note does not affect its <code>amount_due</code>. Instead, it can result in any combination of the following:</p>

<ul> <li>Refund: create a new refund (using <code>refund_amount</code>) or link an existing refund (using <code>refund</code>).</li> <li>Customer balance credit: credit the customer’s balance (using <code>credit_amount</code>) which will be automatically applied to their next invoice when it’s finalized.</li> <li>Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using <code>out_of_band_amount</code>).</li> </ul>

<p>For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.</p>

<p>You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s <code>pre_payment_credit_notes_amount</code> or <code>post_payment_credit_notes_amount</code> depending on its <code>status</code> at the time of credit note creation.</p>

data PostCreditNotesRequestBody Source #

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

Constructors

PostCreditNotesRequestBody 

Fields

data PostCreditNotesRequestBodyLines' Source #

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

data PostCreditNotesRequestBodyLines'TaxRates'Variants Source #

Defines the oneOf schema located at paths./v1/credit_notes.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.lines.items.properties.tax_rates.anyOf in the specification.

Instances

Instances details
Eq PostCreditNotesRequestBodyLines'TaxRates'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostCreditNotes

Show PostCreditNotesRequestBodyLines'TaxRates'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostCreditNotes

ToJSON PostCreditNotesRequestBodyLines'TaxRates'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostCreditNotes

FromJSON PostCreditNotesRequestBodyLines'TaxRates'Variants Source # 
Instance details

Defined in StripeAPI.Operations.PostCreditNotes

data PostCreditNotesRequestBodyLines'Type' Source #

Defines the enum schema located at paths./v1/credit_notes.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.lines.items.properties.type in the specification.

Constructors

PostCreditNotesRequestBodyLines'Type'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

PostCreditNotesRequestBodyLines'Type'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

PostCreditNotesRequestBodyLines'Type'EnumCustomLineItem

Represents the JSON value "custom_line_item"

PostCreditNotesRequestBodyLines'Type'EnumInvoiceLineItem

Represents the JSON value "invoice_line_item"

data PostCreditNotesRequestBodyReason' Source #

Defines the enum schema located at paths./v1/credit_notes.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.reason in the specification.

Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`

Constructors

PostCreditNotesRequestBodyReason'Other Value

This case is used if the value encountered during decoding does not match any of the provided cases in the specification.

PostCreditNotesRequestBodyReason'Typed Text

This constructor can be used to send values to the server which are not present in the specification yet.

PostCreditNotesRequestBodyReason'EnumDuplicate

Represents the JSON value "duplicate"

PostCreditNotesRequestBodyReason'EnumFraudulent

Represents the JSON value "fraudulent"

PostCreditNotesRequestBodyReason'EnumOrderChange

Represents the JSON value "order_change"

PostCreditNotesRequestBodyReason'EnumProductUnsatisfactory

Represents the JSON value "product_unsatisfactory"

data PostCreditNotesResponse Source #

Represents a response of the operation postCreditNotes.

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), PostCreditNotesResponseError is used.

Constructors

PostCreditNotesResponseError String

Means either no matching case available or a parse error

PostCreditNotesResponse200 CreditNote

Successful response.

PostCreditNotesResponseDefault Error

Error response.