stripeapi-0.1.0.2: Stripe-Library

Safe HaskellNone
LanguageHaskell2010

StripeAPI.Operations.GetInvoicesUpcoming

Description

Contains the different functions to run the operation getInvoicesUpcoming

Synopsis

Documentation

getInvoicesUpcoming Source #

Arguments

:: (MonadHTTP m, SecurityScheme s) 
=> Configuration s

The configuration to use in the request

-> Maybe Text

coupon: The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. | Constraints: Maximum length of 5000

-> Maybe Text

customer: The identifier of the customer whose upcoming invoice you'd like to retrieve. | Constraints: Maximum length of 5000

-> Maybe Text

expand: Specifies which fields in the response should be expanded.

-> Maybe Text

invoice_items: List of invoice items to add or update in the upcoming invoice preview.

-> Maybe Text

schedule: The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. | Constraints: Maximum length of 5000

-> Maybe Text

subscription: The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. | Constraints: Maximum length of 5000

-> Maybe Text

subscription_billing_cycle_anchor: For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.

-> Maybe Text

subscription_cancel_at: Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled using `proration_behavior`.`

-> Maybe Bool

subscription_cancel_at_period_end: Boolean indicating whether this subscription should cancel at the end of the current period.

-> Maybe Bool

subscription_cancel_now: This simulates the subscription being canceled or expired immediately.

-> Maybe Text

subscription_default_tax_rates: If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.

-> Maybe Text

subscription_items: List of subscription items, each with an attached plan.

-> Maybe Bool

subscription_prorate: If previewing an update to a subscription, this decides whether the preview will show the result of applying prorations or not. If set, one of `subscription_items` or `subscription`, and one of `subscription_items` or `subscription_trial_end` are required.

-> Maybe Text

subscription_proration_behavior: Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under certain conditions. In order to always invoice immediately for prorations, pass `always_invoice`. Prorations can be disabled by passing `none`.

-> Maybe Integer

subscription_proration_date: If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration` cannot be set to false.

-> Maybe Integer

subscription_start_date: Date a subscription is intended to start (can be future or past)

-> Maybe Double

subscription_tax_percent: If provided, the invoice returned will preview updating or creating a subscription with that tax percent. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version, for further information view the migration docs for `tax_rates`.

-> Maybe Text

subscription_trial_end: If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required.

-> Maybe Bool

subscription_trial_from_plan: Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed.

-> Maybe GetInvoicesUpcomingRequestBody

The request body to send

-> m (Either HttpException (Response GetInvoicesUpcomingResponse))

Monad containing the result of the operation

GET /v1/invoices/upcoming

<p>At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discount that is applicable to the customer.</p>

<p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.</p>

<p>You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a <code>proration_date</code> parameter when doing the actual subscription update. The value passed in should be the same as the <code>subscription_proration_date</code> returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where <code>period[start]</code> is equal to the <code>subscription_proration_date</code> on the upcoming invoice resource.</p>

data GetInvoicesUpcomingResponse Source #

Represents a response of the operation getInvoicesUpcoming.

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

Constructors

GetInvoicesUpcomingResponseError String

Means either no matching case available or a parse error

GetInvoicesUpcomingResponse200 Invoice

Successful response.

GetInvoicesUpcomingResponseDefault Error

Error response.