Class: Stripe::Quote
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Quote
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/quote.rb
Overview
A Quote is a way to model prices that you’d like to provide to a customer. Once accepted, it will automatically create an invoice, subscription or subscription schedule.
Defined Under Namespace
Classes: AcceptParams, AutomaticTax, CancelParams, Computed, CreateParams, FinalizeQuoteParams, FromQuote, InvoiceSettings, ListComputedUpfrontLineItemsParams, ListLineItemsParams, ListLinesParams, ListParams, ListPreviewInvoiceLinesParams, MarkDraftParams, MarkStaleParams, PdfParams, ReestimateParams, StatusDetails, StatusTransitions, SubscriptionData, SubscriptionDataOverride, SubscriptionSchedule, TotalDetails, TransferData, UpdateParams
Constant Summary collapse
- OBJECT_NAME =
"quote"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#allow_backdated_lines ⇒ Object
readonly
Allow quote lines to have ‘starts_at` in the past if collection is paused between `starts_at` and now.
-
#amount_subtotal ⇒ Object
readonly
Total before any discounts or taxes are applied.
-
#amount_total ⇒ Object
readonly
Total after discounts and taxes are applied.
-
#application ⇒ Object
readonly
ID of the Connect Application that created the quote.
-
#application_fee_amount ⇒ Object
readonly
The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account.
-
#application_fee_percent ⇒ Object
readonly
A non-negative decimal between 0 and 100, with at most two decimal places.
-
#automatic_tax ⇒ Object
readonly
Attribute for field automatic_tax.
-
#collection_method ⇒ Object
readonly
Either ‘charge_automatically`, or `send_invoice`.
-
#computed ⇒ Object
readonly
Attribute for field computed.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#currency ⇒ Object
readonly
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#customer ⇒ Object
readonly
The customer which this quote belongs to.
-
#customer_account ⇒ Object
readonly
The account which this quote belongs to.
-
#default_tax_rates ⇒ Object
readonly
The tax rates applied to this quote.
-
#description ⇒ Object
readonly
A description that will be displayed on the quote PDF.
-
#discounts ⇒ Object
readonly
The discounts applied to this quote.
-
#expires_at ⇒ Object
readonly
The date on which the quote will be canceled if in ‘open` or `draft` status.
-
#footer ⇒ Object
readonly
A footer that will be displayed on the quote PDF.
-
#from_quote ⇒ Object
readonly
Details of the quote that was cloned.
-
#header ⇒ Object
readonly
A header that will be displayed on the quote PDF.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#invoice ⇒ Object
readonly
The invoice that was created from this quote.
-
#invoice_settings ⇒ Object
readonly
Attribute for field invoice_settings.
-
#line_items ⇒ Object
readonly
A list of items the customer is being quoted for.
-
#lines ⇒ Object
readonly
A list of [quote lines](docs.stripe.com/api/quote_lines) on the quote.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#number ⇒ Object
readonly
A unique number that identifies this particular quote.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#on_behalf_of ⇒ Object
readonly
The account on behalf of which to charge.
-
#status ⇒ Object
readonly
The status of the quote.
-
#status_details ⇒ Object
readonly
Details on when and why a quote has been marked as stale or canceled.
-
#status_transitions ⇒ Object
readonly
Attribute for field status_transitions.
-
#subscription ⇒ Object
readonly
The subscription that was created or updated from this quote.
-
#subscription_data ⇒ Object
readonly
Attribute for field subscription_data.
-
#subscription_data_overrides ⇒ Object
readonly
List representing overrides for ‘subscription_data` configurations for specific subscription schedules.
-
#subscription_schedule ⇒ Object
readonly
The subscription schedule that was created or updated from this quote.
-
#subscription_schedules ⇒ Object
readonly
The subscription schedules that were created or updated from this quote.
-
#test_clock ⇒ Object
readonly
ID of the test clock this quote belongs to.
-
#total_details ⇒ Object
readonly
Attribute for field total_details.
-
#transfer_data ⇒ Object
readonly
The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.accept(quote, params = {}, opts = {}) ⇒ Object
Accepts the specified quote.
-
.cancel(quote, params = {}, opts = {}) ⇒ Object
Cancels the quote.
-
.create(params = {}, opts = {}) ⇒ Object
A quote models prices and services for a customer.
- .field_remappings ⇒ Object
-
.finalize_quote(quote, params = {}, opts = {}) ⇒ Object
Finalizes the quote.
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of your quotes.
-
.list_computed_upfront_line_items(quote, params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable [computed.upfront.line_items](stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items.
-
.list_line_items(quote, params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable line_items property containing the first handful of those items.
-
.list_lines(quote, params = {}, opts = {}) ⇒ Object
Retrieves a paginated list of lines for a quote.
-
.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {}) ⇒ Object
Preview the invoice line items that would be generated by accepting the quote.
-
.mark_draft(quote, params = {}, opts = {}) ⇒ Object
Converts a stale quote to draft.
-
.mark_stale(quote, params = {}, opts = {}) ⇒ Object
Converts a draft or open quote to stale.
- .object_name ⇒ Object
-
.pdf(quote, params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a finalized quote.
-
.reestimate(quote, params = {}, opts = {}) ⇒ Object
Recompute the upcoming invoice estimate for the quote.
-
.update(quote, params = {}, opts = {}) ⇒ Object
A quote models prices and services for a customer.
Instance Method Summary collapse
-
#accept(params = {}, opts = {}) ⇒ Object
Accepts the specified quote.
-
#cancel(params = {}, opts = {}) ⇒ Object
Cancels the quote.
-
#finalize_quote(params = {}, opts = {}) ⇒ Object
Finalizes the quote.
-
#list_computed_upfront_line_items(params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable [computed.upfront.line_items](stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items.
-
#list_line_items(params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable line_items property containing the first handful of those items.
-
#list_lines(params = {}, opts = {}) ⇒ Object
Retrieves a paginated list of lines for a quote.
-
#list_preview_invoice_lines(preview_invoice, params = {}, opts = {}) ⇒ Object
Preview the invoice line items that would be generated by accepting the quote.
-
#mark_draft(params = {}, opts = {}) ⇒ Object
Converts a stale quote to draft.
-
#mark_stale(params = {}, opts = {}) ⇒ Object
Converts a draft or open quote to stale.
-
#pdf(params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a finalized quote.
-
#reestimate(params = {}, opts = {}) ⇒ Object
Recompute the upcoming invoice estimate for the quote.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::NestedResource
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#allow_backdated_lines ⇒ Object (readonly)
Allow quote lines to have ‘starts_at` in the past if collection is paused between `starts_at` and now.
3220 3221 3222 |
# File 'lib/stripe/resources/quote.rb', line 3220 def allow_backdated_lines @allow_backdated_lines end |
#amount_subtotal ⇒ Object (readonly)
Total before any discounts or taxes are applied.
3222 3223 3224 |
# File 'lib/stripe/resources/quote.rb', line 3222 def amount_subtotal @amount_subtotal end |
#amount_total ⇒ Object (readonly)
Total after discounts and taxes are applied.
3224 3225 3226 |
# File 'lib/stripe/resources/quote.rb', line 3224 def amount_total @amount_total end |
#application ⇒ Object (readonly)
ID of the Connect Application that created the quote.
3226 3227 3228 |
# File 'lib/stripe/resources/quote.rb', line 3226 def application @application end |
#application_fee_amount ⇒ Object (readonly)
The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. Only applicable if there are no line items with recurring prices on the quote.
3228 3229 3230 |
# File 'lib/stripe/resources/quote.rb', line 3228 def application_fee_amount @application_fee_amount end |
#application_fee_percent ⇒ Object (readonly)
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. Only applicable if there are line items with recurring prices on the quote.
3230 3231 3232 |
# File 'lib/stripe/resources/quote.rb', line 3230 def application_fee_percent @application_fee_percent end |
#automatic_tax ⇒ Object (readonly)
Attribute for field automatic_tax
3232 3233 3234 |
# File 'lib/stripe/resources/quote.rb', line 3232 def automatic_tax @automatic_tax end |
#collection_method ⇒ Object (readonly)
Either ‘charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
3234 3235 3236 |
# File 'lib/stripe/resources/quote.rb', line 3234 def collection_method @collection_method end |
#computed ⇒ Object (readonly)
Attribute for field computed
3236 3237 3238 |
# File 'lib/stripe/resources/quote.rb', line 3236 def computed @computed end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
3238 3239 3240 |
# File 'lib/stripe/resources/quote.rb', line 3238 def created @created end |
#currency ⇒ Object (readonly)
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
3240 3241 3242 |
# File 'lib/stripe/resources/quote.rb', line 3240 def currency @currency end |
#customer ⇒ Object (readonly)
The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
3242 3243 3244 |
# File 'lib/stripe/resources/quote.rb', line 3242 def customer @customer end |
#customer_account ⇒ Object (readonly)
The account which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
3244 3245 3246 |
# File 'lib/stripe/resources/quote.rb', line 3244 def customer_account @customer_account end |
#default_tax_rates ⇒ Object (readonly)
The tax rates applied to this quote.
3246 3247 3248 |
# File 'lib/stripe/resources/quote.rb', line 3246 def default_tax_rates @default_tax_rates end |
#description ⇒ Object (readonly)
A description that will be displayed on the quote PDF.
3248 3249 3250 |
# File 'lib/stripe/resources/quote.rb', line 3248 def description @description end |
#discounts ⇒ Object (readonly)
The discounts applied to this quote.
3250 3251 3252 |
# File 'lib/stripe/resources/quote.rb', line 3250 def discounts @discounts end |
#expires_at ⇒ Object (readonly)
The date on which the quote will be canceled if in ‘open` or `draft` status. Measured in seconds since the Unix epoch.
3252 3253 3254 |
# File 'lib/stripe/resources/quote.rb', line 3252 def expires_at @expires_at end |
#footer ⇒ Object (readonly)
A footer that will be displayed on the quote PDF.
3254 3255 3256 |
# File 'lib/stripe/resources/quote.rb', line 3254 def @footer end |
#from_quote ⇒ Object (readonly)
Details of the quote that was cloned. See the [cloning documentation](stripe.com/docs/quotes/clone) for more details.
3256 3257 3258 |
# File 'lib/stripe/resources/quote.rb', line 3256 def from_quote @from_quote end |
#header ⇒ Object (readonly)
A header that will be displayed on the quote PDF.
3258 3259 3260 |
# File 'lib/stripe/resources/quote.rb', line 3258 def header @header end |
#id ⇒ Object (readonly)
Unique identifier for the object.
3260 3261 3262 |
# File 'lib/stripe/resources/quote.rb', line 3260 def id @id end |
#invoice ⇒ Object (readonly)
The invoice that was created from this quote.
3262 3263 3264 |
# File 'lib/stripe/resources/quote.rb', line 3262 def invoice @invoice end |
#invoice_settings ⇒ Object (readonly)
Attribute for field invoice_settings
3264 3265 3266 |
# File 'lib/stripe/resources/quote.rb', line 3264 def invoice_settings @invoice_settings end |
#line_items ⇒ Object (readonly)
A list of items the customer is being quoted for.
3266 3267 3268 |
# File 'lib/stripe/resources/quote.rb', line 3266 def line_items @line_items end |
#lines ⇒ Object (readonly)
A list of [quote lines](docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3268 3269 3270 |
# File 'lib/stripe/resources/quote.rb', line 3268 def lines @lines end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
3270 3271 3272 |
# File 'lib/stripe/resources/quote.rb', line 3270 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
3272 3273 3274 |
# File 'lib/stripe/resources/quote.rb', line 3272 def @metadata end |
#number ⇒ Object (readonly)
A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](stripe.com/docs/quotes/overview#finalize).
3274 3275 3276 |
# File 'lib/stripe/resources/quote.rb', line 3274 def number @number end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
3276 3277 3278 |
# File 'lib/stripe/resources/quote.rb', line 3276 def object @object end |
#on_behalf_of ⇒ Object (readonly)
The account on behalf of which to charge. See the [Connect documentation](support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details.
3278 3279 3280 |
# File 'lib/stripe/resources/quote.rb', line 3278 def on_behalf_of @on_behalf_of end |
#status ⇒ Object (readonly)
The status of the quote.
3280 3281 3282 |
# File 'lib/stripe/resources/quote.rb', line 3280 def status @status end |
#status_details ⇒ Object (readonly)
Details on when and why a quote has been marked as stale or canceled.
3282 3283 3284 |
# File 'lib/stripe/resources/quote.rb', line 3282 def status_details @status_details end |
#status_transitions ⇒ Object (readonly)
Attribute for field status_transitions
3284 3285 3286 |
# File 'lib/stripe/resources/quote.rb', line 3284 def status_transitions @status_transitions end |
#subscription ⇒ Object (readonly)
The subscription that was created or updated from this quote.
3286 3287 3288 |
# File 'lib/stripe/resources/quote.rb', line 3286 def subscription @subscription end |
#subscription_data ⇒ Object (readonly)
Attribute for field subscription_data
3288 3289 3290 |
# File 'lib/stripe/resources/quote.rb', line 3288 def subscription_data @subscription_data end |
#subscription_data_overrides ⇒ Object (readonly)
List representing overrides for ‘subscription_data` configurations for specific subscription schedules.
3290 3291 3292 |
# File 'lib/stripe/resources/quote.rb', line 3290 def subscription_data_overrides @subscription_data_overrides end |
#subscription_schedule ⇒ Object (readonly)
The subscription schedule that was created or updated from this quote.
3292 3293 3294 |
# File 'lib/stripe/resources/quote.rb', line 3292 def subscription_schedule @subscription_schedule end |
#subscription_schedules ⇒ Object (readonly)
The subscription schedules that were created or updated from this quote.
3294 3295 3296 |
# File 'lib/stripe/resources/quote.rb', line 3294 def subscription_schedules @subscription_schedules end |
#test_clock ⇒ Object (readonly)
ID of the test clock this quote belongs to.
3296 3297 3298 |
# File 'lib/stripe/resources/quote.rb', line 3296 def test_clock @test_clock end |
#total_details ⇒ Object (readonly)
Attribute for field total_details
3298 3299 3300 |
# File 'lib/stripe/resources/quote.rb', line 3298 def total_details @total_details end |
#transfer_data ⇒ Object (readonly)
The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices.
3300 3301 3302 |
# File 'lib/stripe/resources/quote.rb', line 3300 def transfer_data @transfer_data end |
Class Method Details
.accept(quote, params = {}, opts = {}) ⇒ Object
Accepts the specified quote.
3313 3314 3315 3316 3317 3318 3319 3320 |
# File 'lib/stripe/resources/quote.rb', line 3313 def self.accept(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.cancel(quote, params = {}, opts = {}) ⇒ Object
Cancels the quote.
3333 3334 3335 3336 3337 3338 3339 3340 |
# File 'lib/stripe/resources/quote.rb', line 3333 def self.cancel(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](dashboard.stripe.com/settings/billing/quote).
3343 3344 3345 |
# File 'lib/stripe/resources/quote.rb', line 3343 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts) end |
.field_remappings ⇒ Object
3564 3565 3566 |
# File 'lib/stripe/resources/quote.rb', line 3564 def self.field_remappings @field_remappings = {} end |
.finalize_quote(quote, params = {}, opts = {}) ⇒ Object
Finalizes the quote.
3358 3359 3360 3361 3362 3363 3364 3365 |
# File 'lib/stripe/resources/quote.rb', line 3358 def self.finalize_quote(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.inner_class_types ⇒ Object
3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 |
# File 'lib/stripe/resources/quote.rb', line 3548 def self.inner_class_types @inner_class_types = { automatic_tax: AutomaticTax, computed: Computed, from_quote: FromQuote, invoice_settings: InvoiceSettings, status_details: StatusDetails, status_transitions: StatusTransitions, subscription_data: SubscriptionData, subscription_data_overrides: SubscriptionDataOverride, subscription_schedules: SubscriptionSchedule, total_details: TotalDetails, transfer_data: TransferData, } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of your quotes.
3368 3369 3370 |
# File 'lib/stripe/resources/quote.rb', line 3368 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/quotes", params: params, opts: opts) end |
.list_computed_upfront_line_items(quote, params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable [computed.upfront.line_items](stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
3383 3384 3385 3386 3387 3388 3389 3390 |
# File 'lib/stripe/resources/quote.rb', line 3383 def self.list_computed_upfront_line_items(quote, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.list_line_items(quote, params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
3403 3404 3405 3406 3407 3408 3409 3410 |
# File 'lib/stripe/resources/quote.rb', line 3403 def self.list_line_items(quote, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.list_lines(quote, params = {}, opts = {}) ⇒ Object
Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3423 3424 3425 3426 3427 3428 3429 3430 |
# File 'lib/stripe/resources/quote.rb', line 3423 def self.list_lines(quote, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {}) ⇒ Object
Preview the invoice line items that would be generated by accepting the quote.
3443 3444 3445 3446 3447 3448 3449 3450 |
# File 'lib/stripe/resources/quote.rb', line 3443 def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }), params: params, opts: opts ) end |
.mark_draft(quote, params = {}, opts = {}) ⇒ Object
Converts a stale quote to draft.
3463 3464 3465 3466 3467 3468 3469 3470 |
# File 'lib/stripe/resources/quote.rb', line 3463 def self.mark_draft(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.mark_stale(quote, params = {}, opts = {}) ⇒ Object
Converts a draft or open quote to stale.
3483 3484 3485 3486 3487 3488 3489 3490 |
# File 'lib/stripe/resources/quote.rb', line 3483 def self.mark_stale(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.object_name ⇒ Object
14 15 16 |
# File 'lib/stripe/resources/quote.rb', line 14 def self.object_name "quote" end |
.pdf(quote, params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a finalized quote. Explanation for special handling can be found [here](docs.stripe.com/quotes/overview#quote_pdf)
3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 |
# File 'lib/stripe/resources/quote.rb', line 3506 def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block) opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts) execute_resource_request_stream( :get, format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(quote) }), :files, params, opts, &read_body_chunk_block ) end |
.reestimate(quote, params = {}, opts = {}) ⇒ Object
Recompute the upcoming invoice estimate for the quote.
3529 3530 3531 3532 3533 3534 3535 3536 |
# File 'lib/stripe/resources/quote.rb', line 3529 def self.reestimate(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
.update(quote, params = {}, opts = {}) ⇒ Object
A quote models prices and services for a customer.
3539 3540 3541 3542 3543 3544 3545 3546 |
# File 'lib/stripe/resources/quote.rb', line 3539 def self.update(quote, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s", { quote: CGI.escape(quote) }), params: params, opts: opts ) end |
Instance Method Details
#accept(params = {}, opts = {}) ⇒ Object
Accepts the specified quote.
3303 3304 3305 3306 3307 3308 3309 3310 |
# File 'lib/stripe/resources/quote.rb', line 3303 def accept(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#cancel(params = {}, opts = {}) ⇒ Object
Cancels the quote.
3323 3324 3325 3326 3327 3328 3329 3330 |
# File 'lib/stripe/resources/quote.rb', line 3323 def cancel(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#finalize_quote(params = {}, opts = {}) ⇒ Object
Finalizes the quote.
3348 3349 3350 3351 3352 3353 3354 3355 |
# File 'lib/stripe/resources/quote.rb', line 3348 def finalize_quote(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#list_computed_upfront_line_items(params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable [computed.upfront.line_items](stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
3373 3374 3375 3376 3377 3378 3379 3380 |
# File 'lib/stripe/resources/quote.rb', line 3373 def list_computed_upfront_line_items(params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#list_line_items(params = {}, opts = {}) ⇒ Object
When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
3393 3394 3395 3396 3397 3398 3399 3400 |
# File 'lib/stripe/resources/quote.rb', line 3393 def list_line_items(params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#list_lines(params = {}, opts = {}) ⇒ Object
Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3413 3414 3415 3416 3417 3418 3419 3420 |
# File 'lib/stripe/resources/quote.rb', line 3413 def list_lines(params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#list_preview_invoice_lines(preview_invoice, params = {}, opts = {}) ⇒ Object
Preview the invoice line items that would be generated by accepting the quote.
3433 3434 3435 3436 3437 3438 3439 3440 |
# File 'lib/stripe/resources/quote.rb', line 3433 def list_preview_invoice_lines(preview_invoice, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }), params: params, opts: opts ) end |
#mark_draft(params = {}, opts = {}) ⇒ Object
Converts a stale quote to draft.
3453 3454 3455 3456 3457 3458 3459 3460 |
# File 'lib/stripe/resources/quote.rb', line 3453 def mark_draft(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#mark_stale(params = {}, opts = {}) ⇒ Object
Converts a draft or open quote to stale.
3473 3474 3475 3476 3477 3478 3479 3480 |
# File 'lib/stripe/resources/quote.rb', line 3473 def mark_stale(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#pdf(params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a finalized quote. Explanation for special handling can be found [here](docs.stripe.com/quotes/overview#quote_pdf)
3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 |
# File 'lib/stripe/resources/quote.rb', line 3493 def pdf(params = {}, opts = {}, &read_body_chunk_block) opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts) request_stream( method: :get, path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }), params: params, opts: opts, base_address: :files, &read_body_chunk_block ) end |
#reestimate(params = {}, opts = {}) ⇒ Object
Recompute the upcoming invoice estimate for the quote.
3519 3520 3521 3522 3523 3524 3525 3526 |
# File 'lib/stripe/resources/quote.rb', line 3519 def reestimate(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }), params: params, opts: opts ) end |