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: AutomaticTax, Computed, FromQuote, InvoiceSettings, StatusDetails, StatusTransitions, SubscriptionData, SubscriptionDataOverride, SubscriptionSchedule, TotalDetails, TransferData
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.
1241 1242 1243 |
# File 'lib/stripe/resources/quote.rb', line 1241 def allow_backdated_lines @allow_backdated_lines end |
#amount_subtotal ⇒ Object (readonly)
Total before any discounts or taxes are applied.
1243 1244 1245 |
# File 'lib/stripe/resources/quote.rb', line 1243 def amount_subtotal @amount_subtotal end |
#amount_total ⇒ Object (readonly)
Total after discounts and taxes are applied.
1245 1246 1247 |
# File 'lib/stripe/resources/quote.rb', line 1245 def amount_total @amount_total end |
#application ⇒ Object (readonly)
ID of the Connect Application that created the quote.
1247 1248 1249 |
# File 'lib/stripe/resources/quote.rb', line 1247 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.
1249 1250 1251 |
# File 'lib/stripe/resources/quote.rb', line 1249 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.
1251 1252 1253 |
# File 'lib/stripe/resources/quote.rb', line 1251 def application_fee_percent @application_fee_percent end |
#automatic_tax ⇒ Object (readonly)
Attribute for field automatic_tax
1253 1254 1255 |
# File 'lib/stripe/resources/quote.rb', line 1253 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`.
1255 1256 1257 |
# File 'lib/stripe/resources/quote.rb', line 1255 def collection_method @collection_method end |
#computed ⇒ Object (readonly)
Attribute for field computed
1257 1258 1259 |
# File 'lib/stripe/resources/quote.rb', line 1257 def computed @computed end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
1259 1260 1261 |
# File 'lib/stripe/resources/quote.rb', line 1259 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).
1261 1262 1263 |
# File 'lib/stripe/resources/quote.rb', line 1261 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.
1263 1264 1265 |
# File 'lib/stripe/resources/quote.rb', line 1263 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.
1265 1266 1267 |
# File 'lib/stripe/resources/quote.rb', line 1265 def customer_account @customer_account end |
#default_tax_rates ⇒ Object (readonly)
The tax rates applied to this quote.
1267 1268 1269 |
# File 'lib/stripe/resources/quote.rb', line 1267 def default_tax_rates @default_tax_rates end |
#description ⇒ Object (readonly)
A description that will be displayed on the quote PDF.
1269 1270 1271 |
# File 'lib/stripe/resources/quote.rb', line 1269 def description @description end |
#discounts ⇒ Object (readonly)
The discounts applied to this quote.
1271 1272 1273 |
# File 'lib/stripe/resources/quote.rb', line 1271 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.
1273 1274 1275 |
# File 'lib/stripe/resources/quote.rb', line 1273 def expires_at @expires_at end |
#footer ⇒ Object (readonly)
A footer that will be displayed on the quote PDF.
1275 1276 1277 |
# File 'lib/stripe/resources/quote.rb', line 1275 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.
1277 1278 1279 |
# File 'lib/stripe/resources/quote.rb', line 1277 def from_quote @from_quote end |
#header ⇒ Object (readonly)
A header that will be displayed on the quote PDF.
1279 1280 1281 |
# File 'lib/stripe/resources/quote.rb', line 1279 def header @header end |
#id ⇒ Object (readonly)
Unique identifier for the object.
1281 1282 1283 |
# File 'lib/stripe/resources/quote.rb', line 1281 def id @id end |
#invoice ⇒ Object (readonly)
The invoice that was created from this quote.
1283 1284 1285 |
# File 'lib/stripe/resources/quote.rb', line 1283 def invoice @invoice end |
#invoice_settings ⇒ Object (readonly)
Attribute for field invoice_settings
1285 1286 1287 |
# File 'lib/stripe/resources/quote.rb', line 1285 def invoice_settings @invoice_settings end |
#line_items ⇒ Object (readonly)
A list of items the customer is being quoted for.
1287 1288 1289 |
# File 'lib/stripe/resources/quote.rb', line 1287 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.
1289 1290 1291 |
# File 'lib/stripe/resources/quote.rb', line 1289 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.
1291 1292 1293 |
# File 'lib/stripe/resources/quote.rb', line 1291 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.
1293 1294 1295 |
# File 'lib/stripe/resources/quote.rb', line 1293 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).
1295 1296 1297 |
# File 'lib/stripe/resources/quote.rb', line 1295 def number @number end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
1297 1298 1299 |
# File 'lib/stripe/resources/quote.rb', line 1297 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.
1299 1300 1301 |
# File 'lib/stripe/resources/quote.rb', line 1299 def on_behalf_of @on_behalf_of end |
#status ⇒ Object (readonly)
The status of the quote.
1301 1302 1303 |
# File 'lib/stripe/resources/quote.rb', line 1301 def status @status end |
#status_details ⇒ Object (readonly)
Details on when and why a quote has been marked as stale or canceled.
1303 1304 1305 |
# File 'lib/stripe/resources/quote.rb', line 1303 def status_details @status_details end |
#status_transitions ⇒ Object (readonly)
Attribute for field status_transitions
1305 1306 1307 |
# File 'lib/stripe/resources/quote.rb', line 1305 def status_transitions @status_transitions end |
#subscription ⇒ Object (readonly)
The subscription that was created or updated from this quote.
1307 1308 1309 |
# File 'lib/stripe/resources/quote.rb', line 1307 def subscription @subscription end |
#subscription_data ⇒ Object (readonly)
Attribute for field subscription_data
1309 1310 1311 |
# File 'lib/stripe/resources/quote.rb', line 1309 def subscription_data @subscription_data end |
#subscription_data_overrides ⇒ Object (readonly)
List representing overrides for ‘subscription_data` configurations for specific subscription schedules.
1311 1312 1313 |
# File 'lib/stripe/resources/quote.rb', line 1311 def subscription_data_overrides @subscription_data_overrides end |
#subscription_schedule ⇒ Object (readonly)
The subscription schedule that was created or updated from this quote.
1313 1314 1315 |
# File 'lib/stripe/resources/quote.rb', line 1313 def subscription_schedule @subscription_schedule end |
#subscription_schedules ⇒ Object (readonly)
The subscription schedules that were created or updated from this quote.
1315 1316 1317 |
# File 'lib/stripe/resources/quote.rb', line 1315 def subscription_schedules @subscription_schedules end |
#test_clock ⇒ Object (readonly)
ID of the test clock this quote belongs to.
1317 1318 1319 |
# File 'lib/stripe/resources/quote.rb', line 1317 def test_clock @test_clock end |
#total_details ⇒ Object (readonly)
Attribute for field total_details
1319 1320 1321 |
# File 'lib/stripe/resources/quote.rb', line 1319 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.
1321 1322 1323 |
# File 'lib/stripe/resources/quote.rb', line 1321 def transfer_data @transfer_data end |
Class Method Details
.accept(quote, params = {}, opts = {}) ⇒ Object
Accepts the specified quote.
1334 1335 1336 1337 1338 1339 1340 1341 |
# File 'lib/stripe/resources/quote.rb', line 1334 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.
1354 1355 1356 1357 1358 1359 1360 1361 |
# File 'lib/stripe/resources/quote.rb', line 1354 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).
1364 1365 1366 |
# File 'lib/stripe/resources/quote.rb', line 1364 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts) end |
.field_remappings ⇒ Object
1585 1586 1587 |
# File 'lib/stripe/resources/quote.rb', line 1585 def self.field_remappings @field_remappings = {} end |
.finalize_quote(quote, params = {}, opts = {}) ⇒ Object
Finalizes the quote.
1379 1380 1381 1382 1383 1384 1385 1386 |
# File 'lib/stripe/resources/quote.rb', line 1379 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
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 |
# File 'lib/stripe/resources/quote.rb', line 1569 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.
1389 1390 1391 |
# File 'lib/stripe/resources/quote.rb', line 1389 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.
1404 1405 1406 1407 1408 1409 1410 1411 |
# File 'lib/stripe/resources/quote.rb', line 1404 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.
1424 1425 1426 1427 1428 1429 1430 1431 |
# File 'lib/stripe/resources/quote.rb', line 1424 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.
1444 1445 1446 1447 1448 1449 1450 1451 |
# File 'lib/stripe/resources/quote.rb', line 1444 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.
1464 1465 1466 1467 1468 1469 1470 1471 |
# File 'lib/stripe/resources/quote.rb', line 1464 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.
1484 1485 1486 1487 1488 1489 1490 1491 |
# File 'lib/stripe/resources/quote.rb', line 1484 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.
1504 1505 1506 1507 1508 1509 1510 1511 |
# File 'lib/stripe/resources/quote.rb', line 1504 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)
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 |
# File 'lib/stripe/resources/quote.rb', line 1527 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.
1550 1551 1552 1553 1554 1555 1556 1557 |
# File 'lib/stripe/resources/quote.rb', line 1550 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.
1560 1561 1562 1563 1564 1565 1566 1567 |
# File 'lib/stripe/resources/quote.rb', line 1560 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.
1324 1325 1326 1327 1328 1329 1330 1331 |
# File 'lib/stripe/resources/quote.rb', line 1324 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.
1344 1345 1346 1347 1348 1349 1350 1351 |
# File 'lib/stripe/resources/quote.rb', line 1344 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.
1369 1370 1371 1372 1373 1374 1375 1376 |
# File 'lib/stripe/resources/quote.rb', line 1369 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.
1394 1395 1396 1397 1398 1399 1400 1401 |
# File 'lib/stripe/resources/quote.rb', line 1394 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.
1414 1415 1416 1417 1418 1419 1420 1421 |
# File 'lib/stripe/resources/quote.rb', line 1414 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.
1434 1435 1436 1437 1438 1439 1440 1441 |
# File 'lib/stripe/resources/quote.rb', line 1434 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.
1454 1455 1456 1457 1458 1459 1460 1461 |
# File 'lib/stripe/resources/quote.rb', line 1454 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.
1474 1475 1476 1477 1478 1479 1480 1481 |
# File 'lib/stripe/resources/quote.rb', line 1474 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.
1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'lib/stripe/resources/quote.rb', line 1494 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)
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 |
# File 'lib/stripe/resources/quote.rb', line 1514 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.
1540 1541 1542 1543 1544 1545 1546 1547 |
# File 'lib/stripe/resources/quote.rb', line 1540 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 |