class Stripe::InvoicesApi

Defined in:

stripe/api/invoices_api.cr

Constant Summary

DELETE_INVOICES_INVOICE_MAX_LENGTH_FOR_INVOICE = 5000
GET_INVOICES_INVOICE_LINES_MAX_LENGTH_FOR_ENDING_BEFORE = 5000
GET_INVOICES_INVOICE_LINES_MAX_LENGTH_FOR_INVOICE = 5000
GET_INVOICES_INVOICE_LINES_MAX_LENGTH_FOR_STARTING_AFTER = 5000
GET_INVOICES_INVOICE_MAX_LENGTH_FOR_INVOICE = 5000
GET_INVOICES_MAX_LENGTH_FOR_CUSTOMER = 5000
GET_INVOICES_MAX_LENGTH_FOR_ENDING_BEFORE = 5000
GET_INVOICES_MAX_LENGTH_FOR_STARTING_AFTER = 5000
GET_INVOICES_MAX_LENGTH_FOR_SUBSCRIPTION = 5000
GET_INVOICES_SEARCH_MAX_LENGTH_FOR_PAGE = 5000
GET_INVOICES_SEARCH_MAX_LENGTH_FOR_QUERY = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_COUPON = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_CUSTOMER = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_ENDING_BEFORE = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_SCHEDULE = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_STARTING_AFTER = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_SUBSCRIPTION = 5000
GET_INVOICES_UPCOMING_LINES_MAX_LENGTH_FOR_SUBSCRIPTION_RESUME_AT = 5000
GET_INVOICES_UPCOMING_LINES_VALID_VALUES_FOR_PREVIEW_MODE = String.static_array("next", "recurring")
GET_INVOICES_UPCOMING_LINES_VALID_VALUES_FOR_SUBSCRIPTION_PRORATION_BEHAVIOR = String.static_array("always_invoice", "create_prorations", "none")
GET_INVOICES_UPCOMING_LINES_VALID_VALUES_FOR_SUBSCRIPTION_RESUME_AT = String.static_array("now")
GET_INVOICES_UPCOMING_MAX_LENGTH_FOR_COUPON = 5000
GET_INVOICES_UPCOMING_MAX_LENGTH_FOR_CUSTOMER = 5000
GET_INVOICES_UPCOMING_MAX_LENGTH_FOR_SCHEDULE = 5000
GET_INVOICES_UPCOMING_MAX_LENGTH_FOR_SUBSCRIPTION = 5000
GET_INVOICES_UPCOMING_MAX_LENGTH_FOR_SUBSCRIPTION_RESUME_AT = 5000
GET_INVOICES_UPCOMING_VALID_VALUES_FOR_PREVIEW_MODE = String.static_array("next", "recurring")
GET_INVOICES_UPCOMING_VALID_VALUES_FOR_SUBSCRIPTION_PRORATION_BEHAVIOR = String.static_array("always_invoice", "create_prorations", "none")
GET_INVOICES_UPCOMING_VALID_VALUES_FOR_SUBSCRIPTION_RESUME_AT = String.static_array("now")
GET_INVOICES_VALID_VALUES_FOR_COLLECTION_METHOD = String.static_array("charge_automatically", "send_invoice")
GET_INVOICES_VALID_VALUES_FOR_STATUS = String.static_array("draft", "open", "paid", "uncollectible", "void")
POST_INVOICES_INVOICE_FINALIZE_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_INVOICE_LINES_LINE_ITEM_ID_MAX_LENGTH_FOR_DESCRIPTION = 5000
POST_INVOICES_INVOICE_LINES_LINE_ITEM_ID_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_INVOICE_LINES_LINE_ITEM_ID_MAX_LENGTH_FOR_LINE_ITEM_ID = 5000
POST_INVOICES_INVOICE_LINES_LINE_ITEM_ID_MAX_LENGTH_FOR_PRICE = 5000
POST_INVOICES_INVOICE_MARK_UNCOLLECTIBLE_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_INVOICE_MAX_LENGTH_FOR_DEFAULT_PAYMENT_METHOD = 5000
POST_INVOICES_INVOICE_MAX_LENGTH_FOR_DESCRIPTION = 1500
POST_INVOICES_INVOICE_MAX_LENGTH_FOR_FOOTER = 5000
POST_INVOICES_INVOICE_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_INVOICE_MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 22
POST_INVOICES_INVOICE_PAY_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_INVOICE_PAY_MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
POST_INVOICES_INVOICE_PAY_MAX_LENGTH_FOR_SOURCE = 5000
POST_INVOICES_INVOICE_SEND_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_INVOICE_VALID_VALUES_FOR_COLLECTION_METHOD = String.static_array("charge_automatically", "send_invoice")
POST_INVOICES_INVOICE_VOID_MAX_LENGTH_FOR_INVOICE = 5000
POST_INVOICES_MAX_LENGTH_FOR_CUSTOMER = 5000
POST_INVOICES_MAX_LENGTH_FOR_DEFAULT_PAYMENT_METHOD = 5000
POST_INVOICES_MAX_LENGTH_FOR_DEFAULT_SOURCE = 5000
POST_INVOICES_MAX_LENGTH_FOR_DESCRIPTION = 1500
POST_INVOICES_MAX_LENGTH_FOR_FOOTER = 5000
POST_INVOICES_MAX_LENGTH_FOR_NUMBER = 26
POST_INVOICES_MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 22
POST_INVOICES_MAX_LENGTH_FOR_SUBSCRIPTION = 5000
POST_INVOICES_VALID_VALUES_FOR_COLLECTION_METHOD = String.static_array("charge_automatically", "send_invoice")
POST_INVOICES_VALID_VALUES_FOR_PENDING_INVOICE_ITEMS_BEHAVIOR = String.static_array("exclude", "include")

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_client : Stripe::ApiClient = ApiClient.default) #

[View source]

Instance Method Detail

def api_client : ApiClient #

[View source]
def api_client=(api_client : ApiClient) #

[View source]
def build_api_request_for_delete_invoices_invoice(*, invoice : String | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_invoices(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, subscription : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil, collection_method : String | Nil = nil, status : String | Nil = nil, due_date : Stripe::GetAccountsCreatedParameter | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_invoices_invoice(*, invoice : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_invoices_invoice_lines(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_invoices_search(*, query : String | Nil = nil, page : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_invoices_upcoming(*, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_invoices_upcoming_lines(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices(*, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, currency : String | Nil = nil, custom_fields : Stripe::PostInvoicesRequestCustomFields | Nil = nil, customer : String | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : String | Nil = nil, default_tax_rates : Array(String) | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, from_invoice : Stripe::FromInvoice | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : String | Nil = nil, on_behalf_of : String | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, pending_invoice_items_behavior : String | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::ShippingCost | Nil = nil, shipping_details : Stripe::RecipientShippingWithOptionalFieldsAddress | Nil = nil, statement_descriptor : String | Nil = nil, subscription : String | Nil = nil, transfer_data : Stripe::TransferDataSpecs | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice(*, invoice : String | Nil = nil, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, custom_fields : Stripe::PostInvoicesInvoiceRequestCustomFields | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : Stripe::PostInvoicesInvoiceRequestDefaultSource | Nil = nil, default_tax_rates : Stripe::PostInvoicesInvoiceRequestDefaultTaxRates | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesInvoiceRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Stripe::PostInvoicesInvoiceRequestEffectiveAt | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : Stripe::PostInvoicesInvoiceRequestNumber | Nil = nil, on_behalf_of : Stripe::PostInvoicesInvoiceRequestOnBehalfOf | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::PostInvoicesInvoiceRequestShippingCost | Nil = nil, shipping_details : Stripe::PostInvoicesInvoiceRequestShippingDetails | Nil = nil, statement_descriptor : String | Nil = nil, transfer_data : Stripe::PostInvoicesInvoiceRequestTransferData | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice_finalize(*, invoice : String | Nil = nil, auto_advance : Bool | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice_lines_line_item_id(*, invoice : String | Nil = nil, line_item_id : String | Nil = nil, amount : Int64 | Nil = nil, description : String | Nil = nil, discountable : Bool | Nil = nil, discounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts | Nil = nil, expand : Array(String) | Nil = nil, metadata : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata | Nil = nil, period : Stripe::Period | Nil = nil, price : String | Nil = nil, price_data : Stripe::OneTimePriceDataWithProductData | Nil = nil, quantity : Int64 | Nil = nil, tax_amounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts | Nil = nil, tax_rates : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice_mark_uncollectible(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice_pay(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, forgive : Bool | Nil = nil, mandate : Stripe::PostInvoicesInvoicePayRequestMandate | Nil = nil, off_session : Bool | Nil = nil, paid_out_of_band : Bool | Nil = nil, payment_method : String | Nil = nil, source : String | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice_send(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_invoices_invoice_void(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def client_side_validation?(*args, **options) #

[View source]
def client_side_validation?(*args, **options, &) #

[View source]
def debugging?(*args, **options) #

[View source]
def debugging?(*args, **options, &) #

[View source]
def delete_invoices_invoice(*, invoice : String | Nil = nil) : Stripe::DeletedInvoice #

Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.

@required @param invoice [String?] @return [Stripe::DeletedInvoice]

[View source]
def delete_invoices_invoice(*, invoice : String | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be <a href=&quot;#void_invoice&quot;>voided</a>.</p> @required @param invoice [String?] @return nil


[View source]
def delete_invoices_invoice_with_http_info(*, invoice : String | Nil = nil) : Tuple(Stripe::DeletedInvoice, Int32, Hash(String, Array(String) | String)) #

<p>Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be <a href=&quot;#void_invoice&quot;>voided</a>.</p> @required @param invoice [String?] @return [Tuple(Stripe::DeletedInvoice, Integer, Hash)] Stripe::DeletedInvoice, response status code and response headers


[View source]
def get_invoices(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, subscription : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil, collection_method : String | Nil = nil, status : String | Nil = nil, due_date : Stripe::GetAccountsCreatedParameter | Nil = nil) : Stripe::InvoicesResourceList #

You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.

@optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param customer [String?] Only return invoices for the customer specified by this customer ID. @optional @param subscription [String?] Only return invoices for the subscription specified by this subscription ID. @optional @param created [Stripe::GetAccountsCreatedParameter?] Only return invoices that were created during the given date interval. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param collection_method [String?] The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. @optional @param status [String?] The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) @optional @param due_date [Stripe::GetAccountsCreatedParameter?] @return [Stripe::InvoicesResourceList]

[View source]
def get_invoices(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, subscription : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil, collection_method : String | Nil = nil, status : String | Nil = nil, due_date : Stripe::GetAccountsCreatedParameter | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param customer [String?] Only return invoices for the customer specified by this customer ID. @optional @param subscription [String?] Only return invoices for the subscription specified by this subscription ID. @optional @param created [Stripe::GetAccountsCreatedParameter?] Only return invoices that were created during the given date interval. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param collection_method [String?] The collection method of the invoice to retrieve. Either charge_automatically or send_invoice. @optional @param status [String?] The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more @optional @param due_date [Stripe::GetAccountsCreatedParameter?] @return nil


[View source]
def get_invoices_invoice(*, invoice : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::Invoice #

Retrieves the invoice with the given ID.

@required @param invoice [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::Invoice]

[View source]
def get_invoices_invoice(*, invoice : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Retrieves the invoice with the given ID.</p> @required @param invoice [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_invoices_invoice_lines(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::InvoiceLinesList #

When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

@required @param invoice [String?] @optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::InvoiceLinesList]

[View source]
def get_invoices_invoice_lines(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>When retrieving an invoice, you’ll get a <strong>lines</strong> property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p> @required @param invoice [String?] @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_invoices_invoice_lines_with_http_info(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::InvoiceLinesList, Int32, Hash(String, Array(String) | String)) #

<p>When retrieving an invoice, you’ll get a <strong>lines</strong> property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p> @required @param invoice [String?] @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::InvoiceLinesList, Integer, Hash)] Stripe::InvoiceLinesList, response status code and response headers


[View source]
def get_invoices_invoice_with_http_info(*, invoice : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Retrieves the invoice with the given ID.</p> @required @param invoice [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def get_invoices_search(*, query : String | Nil = nil, page : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::SearchResult #

Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

@required @param query [String?] The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). @optional @param page [String?] A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::SearchResult]

[View source]
def get_invoices_search(*, query : String | Nil = nil, page : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Search for invoices you’ve previously created using Stripe’s <a href=&quot;/docs/search#search-query-language&quot;>Search Query Language</a>. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.</p> @required @param query [String?] The search query string. See search query language and the list of supported query fields for invoices. @optional @param page [String?] A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_invoices_search_with_http_info(*, query : String | Nil = nil, page : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::SearchResult, Int32, Hash(String, Array(String) | String)) #

<p>Search for invoices you’ve previously created using Stripe’s <a href=&quot;/docs/search#search-query-language&quot;>Search Query Language</a>. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.</p> @required @param query [String?] The search query string. See search query language and the list of supported query fields for invoices. @optional @param page [String?] A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::SearchResult, Integer, Hash)] Stripe::SearchResult, response status code and response headers


[View source]
def get_invoices_upcoming(*, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil) : Stripe::Invoice #

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 discounts that are applicable to the invoice.

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.

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 the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

@optional @param subscription_items [Array(Array(SubscriptionItemUpdateParams))?] A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. @optional @param subscription_cancel_at [Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter?] A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. @optional @param preview_mode [String?] Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. @optional @param subscription_start_date [Int32?] Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. @optional @param customer_details [Stripe::CustomerDetailsParam?] Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. @optional @param subscription_proration_behavior [String?] Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/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. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. @optional @param subscription_billing_cycle_anchor [Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter?] For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/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`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. @optional @param subscription_resume_at [String?] For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. @optional @param subscription_proration_date [Int32?] 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 within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. @optional @param subscription_trial_end [Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter?] 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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. @optional @param subscription_default_tax_rates [Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter?] 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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. @optional @param subscription_cancel_at_period_end [Bool?] Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. @optional @param subscription_trial_from_plan [Bool?] 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. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. @optional @param invoice_items [Array(Array(InvoiceItemPreviewParams))?] List of invoice items to add or update in the upcoming invoice preview (up to 250). @optional @param automatic_tax [Stripe::AutomaticTaxParam?] Settings for automatic tax lookup for this invoice preview. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param coupon [String?] The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. @optional @param on_behalf_of [Stripe::GetInvoicesUpcomingOnBehalfOfParameter?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @optional @param issuer [Stripe::ConnectAccountReference?] The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @optional @param discounts [Stripe::GetInvoicesUpcomingDiscountsParameter?] The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. @optional @param currency [String?] The currency to preview this invoice in. Defaults to that of `customer` if not specified. @optional @param customer [String?] The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. @optional @param schedule [String?] The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @optional @param subscription [String?] The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @optional @param schedule_details [Stripe::ScheduleDetailsParams?] The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. @optional @param subscription_details [Stripe::SubscriptionDetailsParams?] The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. @optional @param subscription_cancel_now [Bool?] This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. @return [Stripe::Invoice]

[View source]
def get_invoices_upcoming(*, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil, &block : Crest::Response -> ) : Nil #

<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 discounts that are applicable to the invoice.</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 the <code>subscription_details.proration_date</code> parameter when doing the actual subscription update. 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_details.proration_date</code> value passed in the request.</p> <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. <a href=&quot;https://docs.stripe.com/currencies/conversions&quot;>Learn more</a></p> @optional @param subscription_items [Array(Array(SubscriptionItemUpdateParams))?] A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use subscription_details.items instead. @optional @param subscription_cancel_at [Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter?] A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using proration_behavior. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at instead. @optional @param preview_mode [String?] Customizes the types of values to include when calculating the invoice. Defaults to next if unspecified. @optional @param subscription_start_date [Int32?] Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use subscription_details.start_date instead. @optional @param customer_details [Stripe::CustomerDetailsParam?] Details about the customer you want to invoice or overrides for an existing customer. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param subscription_proration_behavior [String?] 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. The default value is create_prorations. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_behavior instead. @optional @param subscription_billing_cycle_anchor [Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.billing_cycle_anchor instead. @optional @param subscription_resume_at [String?] For paused subscriptions, setting subscription_resume_at to now will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use subscription_details.resume_at instead. @optional @param subscription_proration_date [Int32?] 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 within the current phase of the schedule backing this subscription, if the schedule exists. If set, subscription, and one of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_date instead. @optional @param subscription_trial_end [Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.trial_end instead. @optional @param subscription_default_tax_rates [Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.default_tax_rates instead. @optional @param subscription_cancel_at_period_end [Bool?] Indicate whether this subscription should cancel at the end of the current period (current_period_end). Defaults to false. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at_period_end instead. @optional @param subscription_trial_from_plan [Bool?] 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. See Using trial periods on subscriptions to learn more. @optional @param invoice_items [Array(Array(InvoiceItemPreviewParams))?] List of invoice items to add or update in the upcoming invoice preview (up to 250). @optional @param automatic_tax [Stripe::AutomaticTaxParam?] Settings for automatic tax lookup for this invoice preview. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param coupon [String?] The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use discounts instead. @optional @param on_behalf_of [Stripe::GetInvoicesUpcomingOnBehalfOfParameter?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. @optional @param issuer [Stripe::ConnectAccountReference?] The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @optional @param discounts [Stripe::GetInvoicesUpcomingDiscountsParameter?] The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. @optional @param currency [String?] The currency to preview this invoice in. Defaults to that of customer if not specified. @optional @param customer [String?] The identifier of the customer whose upcoming invoice you'd like to retrieve. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param schedule [String?] The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @optional @param subscription [String?] The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a subscription_details.items is provided, you will preview creating a subscription with those items. If neither subscription nor subscription_details.items is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @optional @param schedule_details [Stripe::ScheduleDetailsParams?] The schedule creation or modification params to apply as a preview. Cannot be used with subscription or subscription_ prefixed fields. @optional @param subscription_details [Stripe::SubscriptionDetailsParams?] The subscription creation or modification params to apply as a preview. Cannot be used with schedule or schedule_details fields. @optional @param subscription_cancel_now [Bool?] This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_now instead. @return nil


[View source]
def get_invoices_upcoming_lines(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil) : Stripe::InvoiceLinesList #

When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

@optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param subscription_items [Array(Array(SubscriptionItemUpdateParams))?] A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. @optional @param subscription_cancel_at [Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter?] A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. @optional @param preview_mode [String?] Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. @optional @param subscription_start_date [Int32?] Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. @optional @param customer_details [Stripe::CustomerDetailsParam?] Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. @optional @param subscription_proration_behavior [String?] Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/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. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. @optional @param subscription_billing_cycle_anchor [Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter?] For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/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`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. @optional @param subscription_resume_at [String?] For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. @optional @param subscription_proration_date [Int32?] 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 within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. @optional @param subscription_trial_end [Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter?] 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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. @optional @param subscription_default_tax_rates [Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter?] 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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. @optional @param subscription_cancel_at_period_end [Bool?] Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. @optional @param subscription_trial_from_plan [Bool?] 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. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. @optional @param invoice_items [Array(Array(InvoiceItemPreviewParams))?] List of invoice items to add or update in the upcoming invoice preview (up to 250). @optional @param automatic_tax [Stripe::AutomaticTaxParam?] Settings for automatic tax lookup for this invoice preview. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param coupon [String?] The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. @optional @param on_behalf_of [Stripe::GetInvoicesUpcomingOnBehalfOfParameter?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @optional @param issuer [Stripe::ConnectAccountReference?] The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @optional @param discounts [Stripe::GetInvoicesUpcomingDiscountsParameter?] The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. @optional @param currency [String?] The currency to preview this invoice in. Defaults to that of `customer` if not specified. @optional @param customer [String?] The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. @optional @param schedule [String?] The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @optional @param subscription [String?] The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @optional @param schedule_details [Stripe::ScheduleDetailsParams?] The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. @optional @param subscription_details [Stripe::SubscriptionDetailsParams?] The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. @optional @param subscription_cancel_now [Bool?] This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. @return [Stripe::InvoiceLinesList]

[View source]
def get_invoices_upcoming_lines(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param subscription_items [Array(Array(SubscriptionItemUpdateParams))?] A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use subscription_details.items instead. @optional @param subscription_cancel_at [Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter?] A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using proration_behavior. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at instead. @optional @param preview_mode [String?] Customizes the types of values to include when calculating the invoice. Defaults to next if unspecified. @optional @param subscription_start_date [Int32?] Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use subscription_details.start_date instead. @optional @param customer_details [Stripe::CustomerDetailsParam?] Details about the customer you want to invoice or overrides for an existing customer. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param subscription_proration_behavior [String?] 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. The default value is create_prorations. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_behavior instead. @optional @param subscription_billing_cycle_anchor [Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.billing_cycle_anchor instead. @optional @param subscription_resume_at [String?] For paused subscriptions, setting subscription_resume_at to now will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use subscription_details.resume_at instead. @optional @param subscription_proration_date [Int32?] 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 within the current phase of the schedule backing this subscription, if the schedule exists. If set, subscription, and one of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_date instead. @optional @param subscription_trial_end [Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.trial_end instead. @optional @param subscription_default_tax_rates [Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.default_tax_rates instead. @optional @param subscription_cancel_at_period_end [Bool?] Indicate whether this subscription should cancel at the end of the current period (current_period_end). Defaults to false. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at_period_end instead. @optional @param subscription_trial_from_plan [Bool?] 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. See Using trial periods on subscriptions to learn more. @optional @param invoice_items [Array(Array(InvoiceItemPreviewParams))?] List of invoice items to add or update in the upcoming invoice preview (up to 250). @optional @param automatic_tax [Stripe::AutomaticTaxParam?] Settings for automatic tax lookup for this invoice preview. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param coupon [String?] The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use discounts instead. @optional @param on_behalf_of [Stripe::GetInvoicesUpcomingOnBehalfOfParameter?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. @optional @param issuer [Stripe::ConnectAccountReference?] The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @optional @param discounts [Stripe::GetInvoicesUpcomingDiscountsParameter?] The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. @optional @param currency [String?] The currency to preview this invoice in. Defaults to that of customer if not specified. @optional @param customer [String?] The identifier of the customer whose upcoming invoice you'd like to retrieve. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param schedule [String?] The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @optional @param subscription [String?] The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a subscription_details.items is provided, you will preview creating a subscription with those items. If neither subscription nor subscription_details.items is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @optional @param schedule_details [Stripe::ScheduleDetailsParams?] The schedule creation or modification params to apply as a preview. Cannot be used with subscription or subscription_ prefixed fields. @optional @param subscription_details [Stripe::SubscriptionDetailsParams?] The subscription creation or modification params to apply as a preview. Cannot be used with schedule or schedule_details fields. @optional @param subscription_cancel_now [Bool?] This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_now instead. @return nil


[View source]
def get_invoices_upcoming_lines_with_http_info(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil) : Tuple(Stripe::InvoiceLinesList, Int32, Hash(String, Array(String) | String)) #

<p>When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param subscription_items [Array(Array(SubscriptionItemUpdateParams))?] A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use subscription_details.items instead. @optional @param subscription_cancel_at [Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter?] A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using proration_behavior. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at instead. @optional @param preview_mode [String?] Customizes the types of values to include when calculating the invoice. Defaults to next if unspecified. @optional @param subscription_start_date [Int32?] Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use subscription_details.start_date instead. @optional @param customer_details [Stripe::CustomerDetailsParam?] Details about the customer you want to invoice or overrides for an existing customer. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param subscription_proration_behavior [String?] 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. The default value is create_prorations. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_behavior instead. @optional @param subscription_billing_cycle_anchor [Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.billing_cycle_anchor instead. @optional @param subscription_resume_at [String?] For paused subscriptions, setting subscription_resume_at to now will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use subscription_details.resume_at instead. @optional @param subscription_proration_date [Int32?] 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 within the current phase of the schedule backing this subscription, if the schedule exists. If set, subscription, and one of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_date instead. @optional @param subscription_trial_end [Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.trial_end instead. @optional @param subscription_default_tax_rates [Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.default_tax_rates instead. @optional @param subscription_cancel_at_period_end [Bool?] Indicate whether this subscription should cancel at the end of the current period (current_period_end). Defaults to false. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at_period_end instead. @optional @param subscription_trial_from_plan [Bool?] 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. See Using trial periods on subscriptions to learn more. @optional @param invoice_items [Array(Array(InvoiceItemPreviewParams))?] List of invoice items to add or update in the upcoming invoice preview (up to 250). @optional @param automatic_tax [Stripe::AutomaticTaxParam?] Settings for automatic tax lookup for this invoice preview. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param coupon [String?] The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use discounts instead. @optional @param on_behalf_of [Stripe::GetInvoicesUpcomingOnBehalfOfParameter?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. @optional @param issuer [Stripe::ConnectAccountReference?] The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @optional @param discounts [Stripe::GetInvoicesUpcomingDiscountsParameter?] The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. @optional @param currency [String?] The currency to preview this invoice in. Defaults to that of customer if not specified. @optional @param customer [String?] The identifier of the customer whose upcoming invoice you'd like to retrieve. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param schedule [String?] The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @optional @param subscription [String?] The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a subscription_details.items is provided, you will preview creating a subscription with those items. If neither subscription nor subscription_details.items is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @optional @param schedule_details [Stripe::ScheduleDetailsParams?] The schedule creation or modification params to apply as a preview. Cannot be used with subscription or subscription_ prefixed fields. @optional @param subscription_details [Stripe::SubscriptionDetailsParams?] The subscription creation or modification params to apply as a preview. Cannot be used with schedule or schedule_details fields. @optional @param subscription_cancel_now [Bool?] This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_now instead. @return [Tuple(Stripe::InvoiceLinesList, Integer, Hash)] Stripe::InvoiceLinesList, response status code and response headers


[View source]
def get_invoices_upcoming_with_http_info(*, subscription_items : Array(Array(SubscriptionItemUpdateParams)) | Nil = nil, subscription_cancel_at : Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter | Nil = nil, preview_mode : String | Nil = nil, subscription_start_date : Int64 | Nil = nil, customer_details : Stripe::CustomerDetailsParam | Nil = nil, subscription_proration_behavior : String | Nil = nil, subscription_billing_cycle_anchor : Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter | Nil = nil, subscription_resume_at : String | Nil = nil, subscription_proration_date : Int64 | Nil = nil, subscription_trial_end : Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter | Nil = nil, subscription_default_tax_rates : Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter | Nil = nil, subscription_cancel_at_period_end : Bool | Nil = nil, subscription_trial_from_plan : Bool | Nil = nil, invoice_items : Array(Array(InvoiceItemPreviewParams)) | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, expand : Array(Array(String)) | Nil = nil, coupon : String | Nil = nil, on_behalf_of : Stripe::GetInvoicesUpcomingOnBehalfOfParameter | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, discounts : Stripe::GetInvoicesUpcomingDiscountsParameter | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, schedule : String | Nil = nil, subscription : String | Nil = nil, schedule_details : Stripe::ScheduleDetailsParams | Nil = nil, subscription_details : Stripe::SubscriptionDetailsParams | Nil = nil, subscription_cancel_now : Bool | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<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 discounts that are applicable to the invoice.</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 the <code>subscription_details.proration_date</code> parameter when doing the actual subscription update. 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_details.proration_date</code> value passed in the request.</p> <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. <a href=&quot;https://docs.stripe.com/currencies/conversions&quot;>Learn more</a></p> @optional @param subscription_items [Array(Array(SubscriptionItemUpdateParams))?] A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use subscription_details.items instead. @optional @param subscription_cancel_at [Stripe::GetInvoicesUpcomingSubscriptionCancelAtParameter?] A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using proration_behavior. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at instead. @optional @param preview_mode [String?] Customizes the types of values to include when calculating the invoice. Defaults to next if unspecified. @optional @param subscription_start_date [Int32?] Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use subscription_details.start_date instead. @optional @param customer_details [Stripe::CustomerDetailsParam?] Details about the customer you want to invoice or overrides for an existing customer. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param subscription_proration_behavior [String?] 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. The default value is create_prorations. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_behavior instead. @optional @param subscription_billing_cycle_anchor [Stripe::GetInvoicesUpcomingSubscriptionBillingCycleAnchorParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.billing_cycle_anchor instead. @optional @param subscription_resume_at [String?] For paused subscriptions, setting subscription_resume_at to now will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use subscription_details.resume_at instead. @optional @param subscription_proration_date [Int32?] 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 within the current phase of the schedule backing this subscription, if the schedule exists. If set, subscription, and one of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_date instead. @optional @param subscription_trial_end [Stripe::GetInvoicesUpcomingSubscriptionTrialEndParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.trial_end instead. @optional @param subscription_default_tax_rates [Stripe::GetInvoicesUpcomingSubscriptionDefaultTaxRatesParameter?] 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.default_tax_rates instead. @optional @param subscription_cancel_at_period_end [Bool?] Indicate whether this subscription should cancel at the end of the current period (current_period_end). Defaults to false. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at_period_end instead. @optional @param subscription_trial_from_plan [Bool?] 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. See Using trial periods on subscriptions to learn more. @optional @param invoice_items [Array(Array(InvoiceItemPreviewParams))?] List of invoice items to add or update in the upcoming invoice preview (up to 250). @optional @param automatic_tax [Stripe::AutomaticTaxParam?] Settings for automatic tax lookup for this invoice preview. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param coupon [String?] The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use discounts instead. @optional @param on_behalf_of [Stripe::GetInvoicesUpcomingOnBehalfOfParameter?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. @optional @param issuer [Stripe::ConnectAccountReference?] The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @optional @param discounts [Stripe::GetInvoicesUpcomingDiscountsParameter?] The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. @optional @param currency [String?] The currency to preview this invoice in. Defaults to that of customer if not specified. @optional @param customer [String?] The identifier of the customer whose upcoming invoice you'd like to retrieve. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set. @optional @param schedule [String?] The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @optional @param subscription [String?] The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a subscription_details.items is provided, you will preview creating a subscription with those items. If neither subscription nor subscription_details.items is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. @optional @param schedule_details [Stripe::ScheduleDetailsParams?] The schedule creation or modification params to apply as a preview. Cannot be used with subscription or subscription_ prefixed fields. @optional @param subscription_details [Stripe::SubscriptionDetailsParams?] The subscription creation or modification params to apply as a preview. Cannot be used with schedule or schedule_details fields. @optional @param subscription_cancel_now [Bool?] This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_now instead. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def get_invoices_with_http_info(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, subscription : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil, collection_method : String | Nil = nil, status : String | Nil = nil, due_date : Stripe::GetAccountsCreatedParameter | Nil = nil) : Tuple(Stripe::InvoicesResourceList, Int32, Hash(String, Array(String) | String)) #

<p>You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param customer [String?] Only return invoices for the customer specified by this customer ID. @optional @param subscription [String?] Only return invoices for the subscription specified by this subscription ID. @optional @param created [Stripe::GetAccountsCreatedParameter?] Only return invoices that were created during the given date interval. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param collection_method [String?] The collection method of the invoice to retrieve. Either charge_automatically or send_invoice. @optional @param status [String?] The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more @optional @param due_date [Stripe::GetAccountsCreatedParameter?] @return [Tuple(Stripe::InvoicesResourceList, Integer, Hash)] Stripe::InvoicesResourceList, response status code and response headers


[View source]
def post_invoices(*, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, currency : String | Nil = nil, custom_fields : Stripe::PostInvoicesRequestCustomFields | Nil = nil, customer : String | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : String | Nil = nil, default_tax_rates : Array(String) | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, from_invoice : Stripe::FromInvoice | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : String | Nil = nil, on_behalf_of : String | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, pending_invoice_items_behavior : String | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::ShippingCost | Nil = nil, shipping_details : Stripe::RecipientShippingWithOptionalFieldsAddress | Nil = nil, statement_descriptor : String | Nil = nil, subscription : String | Nil = nil, transfer_data : Stripe::TransferDataSpecs | Nil = nil) : Stripe::Invoice #

This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.

@optional @param account_tax_ids [Stripe::PostInvoicesRequestAccountTaxIds?] @optional @param application_fee_amount [Int32?] A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). @optional @param auto_advance [Bool?] Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. @optional @param automatic_tax [Stripe::AutomaticTaxParam?] @optional @param collection_method [String?] Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. @optional @param currency [String?] The currency to create this invoice in. Defaults to that of `customer` if not specified. @optional @param custom_fields [Stripe::PostInvoicesRequestCustomFields?] @optional @param customer [String?] The ID of the customer who will be billed. @optional @param days_until_due [Int32?] The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. @optional @param default_payment_method [String?] ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @optional @param default_source [String?] ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. @optional @param default_tax_rates [Array(String)?] The tax rates that will apply to any line item that does not have `tax_rates` set. @optional @param description [String?] An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @optional @param discounts [Stripe::PostInvoicesRequestDiscounts?] @optional @param due_date [Int32?] The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. @optional @param effective_at [Int32?] The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param footer [String?] Footer to be displayed on the invoice. @optional @param from_invoice [Stripe::FromInvoice?] @optional @param issuer [Stripe::ConnectAccountReference?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param number [String?] Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. @optional @param on_behalf_of [String?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @optional @param payment_settings [Stripe::PaymentSettings?] @optional @param pending_invoice_items_behavior [String?] How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. @optional @param rendering [Stripe::RenderingParam?] @optional @param shipping_cost [Stripe::ShippingCost?] @optional @param shipping_details [Stripe::RecipientShippingWithOptionalFieldsAddress?] @optional @param statement_descriptor [String?] Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. @optional @param subscription [String?] The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. @optional @param transfer_data [Stripe::TransferDataSpecs?] @return [Stripe::Invoice]

[View source]
def post_invoices(*, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, currency : String | Nil = nil, custom_fields : Stripe::PostInvoicesRequestCustomFields | Nil = nil, customer : String | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : String | Nil = nil, default_tax_rates : Array(String) | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, from_invoice : Stripe::FromInvoice | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : String | Nil = nil, on_behalf_of : String | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, pending_invoice_items_behavior : String | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::ShippingCost | Nil = nil, shipping_details : Stripe::RecipientShippingWithOptionalFieldsAddress | Nil = nil, statement_descriptor : String | Nil = nil, subscription : String | Nil = nil, transfer_data : Stripe::TransferDataSpecs | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you <a href=&quot;#finalize_invoice&quot;>finalize</a> the invoice, which allows you to <a href=&quot;#pay_invoice&quot;>pay</a> or <a href=&quot;#send_invoice&quot;>send</a> the invoice to your customers.</p> @optional @param account_tax_ids [Stripe::PostInvoicesRequestAccountTaxIds?] @optional @param application_fee_amount [Int32?] A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. @optional @param auto_advance [Bool?] Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action. @optional @param automatic_tax [Stripe::AutomaticTaxParam?] @optional @param collection_method [String?] Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to charge_automatically. @optional @param currency [String?] The currency to create this invoice in. Defaults to that of customer if not specified. @optional @param custom_fields [Stripe::PostInvoicesRequestCustomFields?] @optional @param customer [String?] The ID of the customer who will be billed. @optional @param days_until_due [Int32?] The number of days from when the invoice is created until it is due. Valid only for invoices where collection_method=send_invoice. @optional @param default_payment_method [String?] ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @optional @param default_source [String?] ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. @optional @param default_tax_rates [Array(String)?] The tax rates that will apply to any line item that does not have tax_rates set. @optional @param description [String?] An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @optional @param discounts [Stripe::PostInvoicesRequestDiscounts?] @optional @param due_date [Int32?] The date on which payment for this invoice is due. Valid only for invoices where collection_method=send_invoice. @optional @param effective_at [Int32?] The date when this invoice is in effect. Same as finalized_at unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param footer [String?] Footer to be displayed on the invoice. @optional @param from_invoice [Stripe::FromInvoice?] @optional @param issuer [Stripe::ConnectAccountReference?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param number [String?] Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. @optional @param on_behalf_of [String?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. @optional @param payment_settings [Stripe::PaymentSettings?] @optional @param pending_invoice_items_behavior [String?] How to handle pending invoice items on invoice creation. Defaults to exclude if the parameter is omitted. @optional @param rendering [Stripe::RenderingParam?] @optional @param shipping_cost [Stripe::ShippingCost?] @optional @param shipping_details [Stripe::RecipientShippingWithOptionalFieldsAddress?] @optional @param statement_descriptor [String?] Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default statement_descriptor will be set to the first subscription item's product's statement_descriptor. @optional @param subscription [String?] The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. @optional @param transfer_data [Stripe::TransferDataSpecs?] @return nil


[View source]
def post_invoices_invoice(*, invoice : String | Nil = nil, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, custom_fields : Stripe::PostInvoicesInvoiceRequestCustomFields | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : Stripe::PostInvoicesInvoiceRequestDefaultSource | Nil = nil, default_tax_rates : Stripe::PostInvoicesInvoiceRequestDefaultTaxRates | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesInvoiceRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Stripe::PostInvoicesInvoiceRequestEffectiveAt | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : Stripe::PostInvoicesInvoiceRequestNumber | Nil = nil, on_behalf_of : Stripe::PostInvoicesInvoiceRequestOnBehalfOf | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::PostInvoicesInvoiceRequestShippingCost | Nil = nil, shipping_details : Stripe::PostInvoicesInvoiceRequestShippingDetails | Nil = nil, statement_descriptor : String | Nil = nil, transfer_data : Stripe::PostInvoicesInvoiceRequestTransferData | Nil = nil) : Stripe::Invoice #

Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well as collection_method, become uneditable.

If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.

@required @param invoice [String?] @optional @param account_tax_ids [Stripe::PostInvoicesRequestAccountTaxIds?] @optional @param application_fee_amount [Int32?] A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). @optional @param auto_advance [Bool?] Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. @optional @param automatic_tax [Stripe::AutomaticTaxParam?] @optional @param collection_method [String?] Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. @optional @param custom_fields [Stripe::PostInvoicesInvoiceRequestCustomFields?] @optional @param days_until_due [Int32?] The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. @optional @param default_payment_method [String?] ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @optional @param default_source [Stripe::PostInvoicesInvoiceRequestDefaultSource?] @optional @param default_tax_rates [Stripe::PostInvoicesInvoiceRequestDefaultTaxRates?] @optional @param description [String?] An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @optional @param discounts [Stripe::PostInvoicesInvoiceRequestDiscounts?] @optional @param due_date [Int32?] The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. @optional @param effective_at [Stripe::PostInvoicesInvoiceRequestEffectiveAt?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param footer [String?] Footer to be displayed on the invoice. @optional @param issuer [Stripe::ConnectAccountReference?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param number [Stripe::PostInvoicesInvoiceRequestNumber?] @optional @param on_behalf_of [Stripe::PostInvoicesInvoiceRequestOnBehalfOf?] @optional @param payment_settings [Stripe::PaymentSettings?] @optional @param rendering [Stripe::RenderingParam?] @optional @param shipping_cost [Stripe::PostInvoicesInvoiceRequestShippingCost?] @optional @param shipping_details [Stripe::PostInvoicesInvoiceRequestShippingDetails?] @optional @param statement_descriptor [String?] Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. @optional @param transfer_data [Stripe::PostInvoicesInvoiceRequestTransferData?] @return [Stripe::Invoice]

[View source]
def post_invoices_invoice(*, invoice : String | Nil = nil, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, custom_fields : Stripe::PostInvoicesInvoiceRequestCustomFields | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : Stripe::PostInvoicesInvoiceRequestDefaultSource | Nil = nil, default_tax_rates : Stripe::PostInvoicesInvoiceRequestDefaultTaxRates | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesInvoiceRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Stripe::PostInvoicesInvoiceRequestEffectiveAt | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : Stripe::PostInvoicesInvoiceRequestNumber | Nil = nil, on_behalf_of : Stripe::PostInvoicesInvoiceRequestOnBehalfOf | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::PostInvoicesInvoiceRequestShippingCost | Nil = nil, shipping_details : Stripe::PostInvoicesInvoiceRequestShippingDetails | Nil = nil, statement_descriptor : String | Nil = nil, transfer_data : Stripe::PostInvoicesInvoiceRequestTransferData | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Draft invoices are fully editable. Once an invoice is <a href=&quot;/docs/billing/invoices/workflow#finalized&quot;>finalized</a>, monetary values, as well as <code>collection_method</code>, become uneditable.</p> <p>If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or <a href=&quot;/docs/billing/invoices/reconciliation&quot;>automatically reconciling</a> invoices, pass <code>auto_advance=false</code>.</p> @required @param invoice [String?] @optional @param account_tax_ids [Stripe::PostInvoicesRequestAccountTaxIds?] @optional @param application_fee_amount [Int32?] A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. @optional @param auto_advance [Bool?] Controls whether Stripe performs automatic collection of the invoice. @optional @param automatic_tax [Stripe::AutomaticTaxParam?] @optional @param collection_method [String?] Either charge_automatically or send_invoice. This field can be updated only on draft invoices. @optional @param custom_fields [Stripe::PostInvoicesInvoiceRequestCustomFields?] @optional @param days_until_due [Int32?] The number of days from which the invoice is created until it is due. Only valid for invoices where collection_method=send_invoice. This field can only be updated on draft invoices. @optional @param default_payment_method [String?] ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @optional @param default_source [Stripe::PostInvoicesInvoiceRequestDefaultSource?] @optional @param default_tax_rates [Stripe::PostInvoicesInvoiceRequestDefaultTaxRates?] @optional @param description [String?] An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @optional @param discounts [Stripe::PostInvoicesInvoiceRequestDiscounts?] @optional @param due_date [Int32?] The date on which payment for this invoice is due. Only valid for invoices where collection_method=send_invoice. This field can only be updated on draft invoices. @optional @param effective_at [Stripe::PostInvoicesInvoiceRequestEffectiveAt?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param footer [String?] Footer to be displayed on the invoice. @optional @param issuer [Stripe::ConnectAccountReference?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param number [Stripe::PostInvoicesInvoiceRequestNumber?] @optional @param on_behalf_of [Stripe::PostInvoicesInvoiceRequestOnBehalfOf?] @optional @param payment_settings [Stripe::PaymentSettings?] @optional @param rendering [Stripe::RenderingParam?] @optional @param shipping_cost [Stripe::PostInvoicesInvoiceRequestShippingCost?] @optional @param shipping_details [Stripe::PostInvoicesInvoiceRequestShippingDetails?] @optional @param statement_descriptor [String?] Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default statement_descriptor will be set to the first subscription item's product's statement_descriptor. @optional @param transfer_data [Stripe::PostInvoicesInvoiceRequestTransferData?] @return nil


[View source]
def post_invoices_invoice_finalize(*, invoice : String | Nil = nil, auto_advance : Bool | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::Invoice #

Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.

@required @param invoice [String?] @optional @param auto_advance [Bool?] Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::Invoice]

[View source]
def post_invoices_invoice_finalize(*, invoice : String | Nil = nil, auto_advance : Bool | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.</p> @required @param invoice [String?] @optional @param auto_advance [Bool?] Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_invoices_invoice_finalize_with_http_info(*, invoice : String | Nil = nil, auto_advance : Bool | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.</p> @required @param invoice [String?] @optional @param auto_advance [Bool?] Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def post_invoices_invoice_lines_line_item_id(*, invoice : String | Nil = nil, line_item_id : String | Nil = nil, amount : Int64 | Nil = nil, description : String | Nil = nil, discountable : Bool | Nil = nil, discounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts | Nil = nil, expand : Array(String) | Nil = nil, metadata : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata | Nil = nil, period : Stripe::Period | Nil = nil, price : String | Nil = nil, price_data : Stripe::OneTimePriceDataWithProductData | Nil = nil, quantity : Int64 | Nil = nil, tax_amounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts | Nil = nil, tax_rates : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates | Nil = nil) : Stripe::LineItem #

Updates an invoice’s line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.

@required @param invoice [String?] Invoice ID of line item @required @param line_item_id [String?] Invoice line item ID @optional @param amount [Int32?] The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. @optional @param description [String?] An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. @optional @param discountable [Bool?] Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. @optional @param discounts [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param metadata [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata?] @optional @param period [Stripe::Period?] @optional @param price [String?] The ID of the price object. One of `price` or `price_data` is required. @optional @param price_data [Stripe::OneTimePriceDataWithProductData?] @optional @param quantity [Int32?] Non-negative integer. The quantity of units for the line item. @optional @param tax_amounts [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts?] @optional @param tax_rates [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates?] @return [Stripe::LineItem]

[View source]
def post_invoices_invoice_lines_line_item_id(*, invoice : String | Nil = nil, line_item_id : String | Nil = nil, amount : Int64 | Nil = nil, description : String | Nil = nil, discountable : Bool | Nil = nil, discounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts | Nil = nil, expand : Array(String) | Nil = nil, metadata : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata | Nil = nil, period : Stripe::Period | Nil = nil, price : String | Nil = nil, price_data : Stripe::OneTimePriceDataWithProductData | Nil = nil, quantity : Int64 | Nil = nil, tax_amounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts | Nil = nil, tax_rates : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Updates an invoice’s line item. Some fields, such as <code>tax_amounts</code>, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as <code>amount</code>, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.</p> @required @param invoice [String?] Invoice ID of line item @required @param line_item_id [String?] Invoice line item ID @optional @param amount [Int32?] The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. @optional @param description [String?] An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. @optional @param discountable [Bool?] Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. @optional @param discounts [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param metadata [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata?] @optional @param period [Stripe::Period?] @optional @param price [String?] The ID of the price object. One of price or price_data is required. @optional @param price_data [Stripe::OneTimePriceDataWithProductData?] @optional @param quantity [Int32?] Non-negative integer. The quantity of units for the line item. @optional @param tax_amounts [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts?] @optional @param tax_rates [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates?] @return nil


[View source]
def post_invoices_invoice_lines_line_item_id_with_http_info(*, invoice : String | Nil = nil, line_item_id : String | Nil = nil, amount : Int64 | Nil = nil, description : String | Nil = nil, discountable : Bool | Nil = nil, discounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts | Nil = nil, expand : Array(String) | Nil = nil, metadata : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata | Nil = nil, period : Stripe::Period | Nil = nil, price : String | Nil = nil, price_data : Stripe::OneTimePriceDataWithProductData | Nil = nil, quantity : Int64 | Nil = nil, tax_amounts : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts | Nil = nil, tax_rates : Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates | Nil = nil) : Tuple(Stripe::LineItem, Int32, Hash(String, Array(String) | String)) #

<p>Updates an invoice’s line item. Some fields, such as <code>tax_amounts</code>, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as <code>amount</code>, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.</p> @required @param invoice [String?] Invoice ID of line item @required @param line_item_id [String?] Invoice line item ID @optional @param amount [Int32?] The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. @optional @param description [String?] An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. @optional @param discountable [Bool?] Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. @optional @param discounts [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestDiscounts?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param metadata [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestMetadata?] @optional @param period [Stripe::Period?] @optional @param price [String?] The ID of the price object. One of price or price_data is required. @optional @param price_data [Stripe::OneTimePriceDataWithProductData?] @optional @param quantity [Int32?] Non-negative integer. The quantity of units for the line item. @optional @param tax_amounts [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxAmounts?] @optional @param tax_rates [Stripe::PostInvoicesInvoiceLinesLineItemIdRequestTaxRates?] @return [Tuple(Stripe::LineItem, Integer, Hash)] Stripe::LineItem, response status code and response headers


[View source]
def post_invoices_invoice_mark_uncollectible(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::Invoice #

Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.

@required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::Invoice]

[View source]
def post_invoices_invoice_mark_uncollectible(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_invoices_invoice_mark_uncollectible_with_http_info(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def post_invoices_invoice_pay(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, forgive : Bool | Nil = nil, mandate : Stripe::PostInvoicesInvoicePayRequestMandate | Nil = nil, off_session : Bool | Nil = nil, paid_out_of_band : Bool | Nil = nil, payment_method : String | Nil = nil, source : String | Nil = nil) : Stripe::Invoice #

Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.

@required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param forgive [Bool?] In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. @optional @param mandate [Stripe::PostInvoicesInvoicePayRequestMandate?] @optional @param off_session [Bool?] Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). @optional @param paid_out_of_band [Bool?] Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. @optional @param payment_method [String?] A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. @optional @param source [String?] A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. @return [Stripe::Invoice]

[View source]
def post_invoices_invoice_pay(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, forgive : Bool | Nil = nil, mandate : Stripe::PostInvoicesInvoicePayRequestMandate | Nil = nil, off_session : Bool | Nil = nil, paid_out_of_band : Bool | Nil = nil, payment_method : String | Nil = nil, source : String | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your <a href=&quot;https://dashboard.stripe.com/account/billing/automatic&quot;>subscriptions settings</a>. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param forgive [Bool?] In cases where the source used to pay the invoice has insufficient funds, passing forgive=true controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing forgive=false will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to false. @optional @param mandate [Stripe::PostInvoicesInvoicePayRequestMandate?] @optional @param off_session [Bool?] Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to true (off-session). @optional @param paid_out_of_band [Bool?] Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to false. @optional @param payment_method [String?] A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. @optional @param source [String?] A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. @return nil


[View source]
def post_invoices_invoice_pay_with_http_info(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, forgive : Bool | Nil = nil, mandate : Stripe::PostInvoicesInvoicePayRequestMandate | Nil = nil, off_session : Bool | Nil = nil, paid_out_of_band : Bool | Nil = nil, payment_method : String | Nil = nil, source : String | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your <a href=&quot;https://dashboard.stripe.com/account/billing/automatic&quot;>subscriptions settings</a>. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param forgive [Bool?] In cases where the source used to pay the invoice has insufficient funds, passing forgive=true controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing forgive=false will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to false. @optional @param mandate [Stripe::PostInvoicesInvoicePayRequestMandate?] @optional @param off_session [Bool?] Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to true (off-session). @optional @param paid_out_of_band [Bool?] Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to false. @optional @param payment_method [String?] A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. @optional @param source [String?] A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def post_invoices_invoice_send(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::Invoice #

Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

@required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::Invoice]

[View source]
def post_invoices_invoice_send(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Stripe will automatically send invoices to customers according to your <a href=&quot;https://dashboard.stripe.com/account/billing/automatic&quot;>subscriptions settings</a>. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.</p> <p>Requests made in test-mode result in no emails being sent, despite sending an <code>invoice.sent</code> event.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_invoices_invoice_send_with_http_info(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Stripe will automatically send invoices to customers according to your <a href=&quot;https://dashboard.stripe.com/account/billing/automatic&quot;>subscriptions settings</a>. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.</p> <p>Requests made in test-mode result in no emails being sent, despite sending an <code>invoice.sent</code> event.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def post_invoices_invoice_void(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::Invoice #

Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

@required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::Invoice]

[View source]
def post_invoices_invoice_void(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a href=&quot;#delete_invoice&quot;>deletion</a>, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.</p> <p>Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to <a href=&quot;#create_invoice&quot;>issue another invoice</a> or <a href=&quot;#create_credit_note&quot;>credit note</a> instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_invoices_invoice_void_with_http_info(*, invoice : String | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a href=&quot;#delete_invoice&quot;>deletion</a>, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.</p> <p>Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to <a href=&quot;#create_invoice&quot;>issue another invoice</a> or <a href=&quot;#create_credit_note&quot;>credit note</a> instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.</p> @required @param invoice [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def post_invoices_invoice_with_http_info(*, invoice : String | Nil = nil, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, custom_fields : Stripe::PostInvoicesInvoiceRequestCustomFields | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : Stripe::PostInvoicesInvoiceRequestDefaultSource | Nil = nil, default_tax_rates : Stripe::PostInvoicesInvoiceRequestDefaultTaxRates | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesInvoiceRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Stripe::PostInvoicesInvoiceRequestEffectiveAt | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : Stripe::PostInvoicesInvoiceRequestNumber | Nil = nil, on_behalf_of : Stripe::PostInvoicesInvoiceRequestOnBehalfOf | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::PostInvoicesInvoiceRequestShippingCost | Nil = nil, shipping_details : Stripe::PostInvoicesInvoiceRequestShippingDetails | Nil = nil, statement_descriptor : String | Nil = nil, transfer_data : Stripe::PostInvoicesInvoiceRequestTransferData | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>Draft invoices are fully editable. Once an invoice is <a href=&quot;/docs/billing/invoices/workflow#finalized&quot;>finalized</a>, monetary values, as well as <code>collection_method</code>, become uneditable.</p> <p>If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or <a href=&quot;/docs/billing/invoices/reconciliation&quot;>automatically reconciling</a> invoices, pass <code>auto_advance=false</code>.</p> @required @param invoice [String?] @optional @param account_tax_ids [Stripe::PostInvoicesRequestAccountTaxIds?] @optional @param application_fee_amount [Int32?] A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. @optional @param auto_advance [Bool?] Controls whether Stripe performs automatic collection of the invoice. @optional @param automatic_tax [Stripe::AutomaticTaxParam?] @optional @param collection_method [String?] Either charge_automatically or send_invoice. This field can be updated only on draft invoices. @optional @param custom_fields [Stripe::PostInvoicesInvoiceRequestCustomFields?] @optional @param days_until_due [Int32?] The number of days from which the invoice is created until it is due. Only valid for invoices where collection_method=send_invoice. This field can only be updated on draft invoices. @optional @param default_payment_method [String?] ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @optional @param default_source [Stripe::PostInvoicesInvoiceRequestDefaultSource?] @optional @param default_tax_rates [Stripe::PostInvoicesInvoiceRequestDefaultTaxRates?] @optional @param description [String?] An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @optional @param discounts [Stripe::PostInvoicesInvoiceRequestDiscounts?] @optional @param due_date [Int32?] The date on which payment for this invoice is due. Only valid for invoices where collection_method=send_invoice. This field can only be updated on draft invoices. @optional @param effective_at [Stripe::PostInvoicesInvoiceRequestEffectiveAt?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param footer [String?] Footer to be displayed on the invoice. @optional @param issuer [Stripe::ConnectAccountReference?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param number [Stripe::PostInvoicesInvoiceRequestNumber?] @optional @param on_behalf_of [Stripe::PostInvoicesInvoiceRequestOnBehalfOf?] @optional @param payment_settings [Stripe::PaymentSettings?] @optional @param rendering [Stripe::RenderingParam?] @optional @param shipping_cost [Stripe::PostInvoicesInvoiceRequestShippingCost?] @optional @param shipping_details [Stripe::PostInvoicesInvoiceRequestShippingDetails?] @optional @param statement_descriptor [String?] Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default statement_descriptor will be set to the first subscription item's product's statement_descriptor. @optional @param transfer_data [Stripe::PostInvoicesInvoiceRequestTransferData?] @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]
def post_invoices_with_http_info(*, account_tax_ids : Stripe::PostInvoicesRequestAccountTaxIds | Nil = nil, application_fee_amount : Int64 | Nil = nil, auto_advance : Bool | Nil = nil, automatic_tax : Stripe::AutomaticTaxParam | Nil = nil, collection_method : String | Nil = nil, currency : String | Nil = nil, custom_fields : Stripe::PostInvoicesRequestCustomFields | Nil = nil, customer : String | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : String | Nil = nil, default_source : String | Nil = nil, default_tax_rates : Array(String) | Nil = nil, description : String | Nil = nil, discounts : Stripe::PostInvoicesRequestDiscounts | Nil = nil, due_date : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, expand : Array(String) | Nil = nil, footer : String | Nil = nil, from_invoice : Stripe::FromInvoice | Nil = nil, issuer : Stripe::ConnectAccountReference | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, number : String | Nil = nil, on_behalf_of : String | Nil = nil, payment_settings : Stripe::PaymentSettings | Nil = nil, pending_invoice_items_behavior : String | Nil = nil, rendering : Stripe::RenderingParam | Nil = nil, shipping_cost : Stripe::ShippingCost | Nil = nil, shipping_details : Stripe::RecipientShippingWithOptionalFieldsAddress | Nil = nil, statement_descriptor : String | Nil = nil, subscription : String | Nil = nil, transfer_data : Stripe::TransferDataSpecs | Nil = nil) : Tuple(Stripe::Invoice, Int32, Hash(String, Array(String) | String)) #

<p>This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you <a href=&quot;#finalize_invoice&quot;>finalize</a> the invoice, which allows you to <a href=&quot;#pay_invoice&quot;>pay</a> or <a href=&quot;#send_invoice&quot;>send</a> the invoice to your customers.</p> @optional @param account_tax_ids [Stripe::PostInvoicesRequestAccountTaxIds?] @optional @param application_fee_amount [Int32?] A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. @optional @param auto_advance [Bool?] Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action. @optional @param automatic_tax [Stripe::AutomaticTaxParam?] @optional @param collection_method [String?] Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to charge_automatically. @optional @param currency [String?] The currency to create this invoice in. Defaults to that of customer if not specified. @optional @param custom_fields [Stripe::PostInvoicesRequestCustomFields?] @optional @param customer [String?] The ID of the customer who will be billed. @optional @param days_until_due [Int32?] The number of days from when the invoice is created until it is due. Valid only for invoices where collection_method=send_invoice. @optional @param default_payment_method [String?] ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @optional @param default_source [String?] ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. @optional @param default_tax_rates [Array(String)?] The tax rates that will apply to any line item that does not have tax_rates set. @optional @param description [String?] An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @optional @param discounts [Stripe::PostInvoicesRequestDiscounts?] @optional @param due_date [Int32?] The date on which payment for this invoice is due. Valid only for invoices where collection_method=send_invoice. @optional @param effective_at [Int32?] The date when this invoice is in effect. Same as finalized_at unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param footer [String?] Footer to be displayed on the invoice. @optional @param from_invoice [Stripe::FromInvoice?] @optional @param issuer [Stripe::ConnectAccountReference?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param number [String?] Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. @optional @param on_behalf_of [String?] The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. @optional @param payment_settings [Stripe::PaymentSettings?] @optional @param pending_invoice_items_behavior [String?] How to handle pending invoice items on invoice creation. Defaults to exclude if the parameter is omitted. @optional @param rendering [Stripe::RenderingParam?] @optional @param shipping_cost [Stripe::ShippingCost?] @optional @param shipping_details [Stripe::RecipientShippingWithOptionalFieldsAddress?] @optional @param statement_descriptor [String?] Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default statement_descriptor will be set to the first subscription item's product's statement_descriptor. @optional @param subscription [String?] The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. @optional @param transfer_data [Stripe::TransferDataSpecs?] @return [Tuple(Stripe::Invoice, Integer, Hash)] Stripe::Invoice, response status code and response headers


[View source]