Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains the different functions to run the operation getInvoicesUpcoming
Synopsis
- getInvoicesUpcoming :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> m (Either HttpException (Response GetInvoicesUpcomingResponse))
- getInvoicesUpcomingRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> m (Either HttpException (Response ByteString))
- getInvoicesUpcomingM :: forall m s. (MonadHTTP m, SecurityScheme s) => Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response GetInvoicesUpcomingResponse))
- getInvoicesUpcomingRawM :: forall m s. (MonadHTTP m, SecurityScheme s) => Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response ByteString))
- data GetInvoicesUpcomingRequestBody = GetInvoicesUpcomingRequestBody {
- data GetInvoicesUpcomingResponse
Documentation
:: (MonadHTTP m, SecurityScheme s) | |
=> Configuration s | The configuration to use in the request |
-> Maybe String | 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 String | customer: The identifier of the customer whose upcoming invoice you'd like to retrieve. | Constraints: Maximum length of 5000 |
-> Maybe String | expand: Specifies which fields in the response should be expanded. |
-> Maybe String | invoice_items: List of invoice items to add or update in the upcoming invoice preview. |
-> Maybe String | 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 String | 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 String | 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 String | 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 String | 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 String | 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 String | 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 String | 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. |
-> 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>
getInvoicesUpcomingRaw :: forall m s. (MonadHTTP m, SecurityScheme s) => Configuration s -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> m (Either HttpException (Response ByteString)) Source #
GET /v1/invoices/upcoming
The same as getInvoicesUpcoming
but returns the raw ByteString
getInvoicesUpcomingM :: forall m s. (MonadHTTP m, SecurityScheme s) => Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response GetInvoicesUpcomingResponse)) Source #
GET /v1/invoices/upcoming
Monadic version of getInvoicesUpcoming
(use with runWithConfiguration
)
getInvoicesUpcomingRawM :: forall m s. (MonadHTTP m, SecurityScheme s) => Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe String -> Maybe Bool -> Maybe String -> Maybe Integer -> Maybe Integer -> Maybe Double -> Maybe String -> Maybe Bool -> GetInvoicesUpcomingRequestBody -> ReaderT (Configuration s) m (Either HttpException (Response ByteString)) Source #
GET /v1/invoices/upcoming
Monadic version of getInvoicesUpcomingRaw
(use with runWithConfiguration
)
data GetInvoicesUpcomingRequestBody Source #
Defines the data type for the schema getInvoicesUpcomingRequestBody
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.
GetInvoicesUpcomingResponseError String | Means either no matching case available or a parse error |
GetInvoicesUpcomingResponse200 Invoice | Successful response. |
GetInvoicesUpcomingResponseDefault Error | Error response. |