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.
1131 1132 1133 |
# File 'lib/stripe/resources/quote.rb', line 1131 def allow_backdated_lines @allow_backdated_lines end |
#amount_subtotal ⇒ Object (readonly)
Total before any discounts or taxes are applied.
1133 1134 1135 |
# File 'lib/stripe/resources/quote.rb', line 1133 def amount_subtotal @amount_subtotal end |
#amount_total ⇒ Object (readonly)
Total after discounts and taxes are applied.
1135 1136 1137 |
# File 'lib/stripe/resources/quote.rb', line 1135 def amount_total @amount_total end |
#application ⇒ Object (readonly)
ID of the Connect Application that created the quote.
1137 1138 1139 |
# File 'lib/stripe/resources/quote.rb', line 1137 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.
1139 1140 1141 |
# File 'lib/stripe/resources/quote.rb', line 1139 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.
1141 1142 1143 |
# File 'lib/stripe/resources/quote.rb', line 1141 def application_fee_percent @application_fee_percent end |
#automatic_tax ⇒ Object (readonly)
Attribute for field automatic_tax
1143 1144 1145 |
# File 'lib/stripe/resources/quote.rb', line 1143 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`.
1145 1146 1147 |
# File 'lib/stripe/resources/quote.rb', line 1145 def collection_method @collection_method end |
#computed ⇒ Object (readonly)
Attribute for field computed
1147 1148 1149 |
# File 'lib/stripe/resources/quote.rb', line 1147 def computed @computed end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
1149 1150 1151 |
# File 'lib/stripe/resources/quote.rb', line 1149 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).
1151 1152 1153 |
# File 'lib/stripe/resources/quote.rb', line 1151 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.
1153 1154 1155 |
# File 'lib/stripe/resources/quote.rb', line 1153 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.
1155 1156 1157 |
# File 'lib/stripe/resources/quote.rb', line 1155 def customer_account @customer_account end |
#default_tax_rates ⇒ Object (readonly)
The tax rates applied to this quote.
1157 1158 1159 |
# File 'lib/stripe/resources/quote.rb', line 1157 def default_tax_rates @default_tax_rates end |
#description ⇒ Object (readonly)
A description that will be displayed on the quote PDF.
1159 1160 1161 |
# File 'lib/stripe/resources/quote.rb', line 1159 def description @description end |
#discounts ⇒ Object (readonly)
The discounts applied to this quote.
1161 1162 1163 |
# File 'lib/stripe/resources/quote.rb', line 1161 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.
1163 1164 1165 |
# File 'lib/stripe/resources/quote.rb', line 1163 def expires_at @expires_at end |
#footer ⇒ Object (readonly)
A footer that will be displayed on the quote PDF.
1165 1166 1167 |
# File 'lib/stripe/resources/quote.rb', line 1165 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.
1167 1168 1169 |
# File 'lib/stripe/resources/quote.rb', line 1167 def from_quote @from_quote end |
#header ⇒ Object (readonly)
A header that will be displayed on the quote PDF.
1169 1170 1171 |
# File 'lib/stripe/resources/quote.rb', line 1169 def header @header end |
#id ⇒ Object (readonly)
Unique identifier for the object.
1171 1172 1173 |
# File 'lib/stripe/resources/quote.rb', line 1171 def id @id end |
#invoice ⇒ Object (readonly)
The invoice that was created from this quote.
1173 1174 1175 |
# File 'lib/stripe/resources/quote.rb', line 1173 def invoice @invoice end |
#invoice_settings ⇒ Object (readonly)
Attribute for field invoice_settings
1175 1176 1177 |
# File 'lib/stripe/resources/quote.rb', line 1175 def invoice_settings @invoice_settings end |
#line_items ⇒ Object (readonly)
A list of items the customer is being quoted for.
1177 1178 1179 |
# File 'lib/stripe/resources/quote.rb', line 1177 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.
1179 1180 1181 |
# File 'lib/stripe/resources/quote.rb', line 1179 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.
1181 1182 1183 |
# File 'lib/stripe/resources/quote.rb', line 1181 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.
1183 1184 1185 |
# File 'lib/stripe/resources/quote.rb', line 1183 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).
1185 1186 1187 |
# File 'lib/stripe/resources/quote.rb', line 1185 def number @number end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
1187 1188 1189 |
# File 'lib/stripe/resources/quote.rb', line 1187 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.
1189 1190 1191 |
# File 'lib/stripe/resources/quote.rb', line 1189 def on_behalf_of @on_behalf_of end |
#status ⇒ Object (readonly)
The status of the quote.
1191 1192 1193 |
# File 'lib/stripe/resources/quote.rb', line 1191 def status @status end |
#status_details ⇒ Object (readonly)
Details on when and why a quote has been marked as stale or canceled.
1193 1194 1195 |
# File 'lib/stripe/resources/quote.rb', line 1193 def status_details @status_details end |
#status_transitions ⇒ Object (readonly)
Attribute for field status_transitions
1195 1196 1197 |
# File 'lib/stripe/resources/quote.rb', line 1195 def status_transitions @status_transitions end |
#subscription ⇒ Object (readonly)
The subscription that was created or updated from this quote.
1197 1198 1199 |
# File 'lib/stripe/resources/quote.rb', line 1197 def subscription @subscription end |
#subscription_data ⇒ Object (readonly)
Attribute for field subscription_data
1199 1200 1201 |
# File 'lib/stripe/resources/quote.rb', line 1199 def subscription_data @subscription_data end |
#subscription_data_overrides ⇒ Object (readonly)
List representing overrides for ‘subscription_data` configurations for specific subscription schedules.
1201 1202 1203 |
# File 'lib/stripe/resources/quote.rb', line 1201 def subscription_data_overrides @subscription_data_overrides end |
#subscription_schedule ⇒ Object (readonly)
The subscription schedule that was created or updated from this quote.
1203 1204 1205 |
# File 'lib/stripe/resources/quote.rb', line 1203 def subscription_schedule @subscription_schedule end |
#subscription_schedules ⇒ Object (readonly)
The subscription schedules that were created or updated from this quote.
1205 1206 1207 |
# File 'lib/stripe/resources/quote.rb', line 1205 def subscription_schedules @subscription_schedules end |
#test_clock ⇒ Object (readonly)
ID of the test clock this quote belongs to.
1207 1208 1209 |
# File 'lib/stripe/resources/quote.rb', line 1207 def test_clock @test_clock end |
#total_details ⇒ Object (readonly)
Attribute for field total_details
1209 1210 1211 |
# File 'lib/stripe/resources/quote.rb', line 1209 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.
1211 1212 1213 |
# File 'lib/stripe/resources/quote.rb', line 1211 def transfer_data @transfer_data end |
Class Method Details
.accept(quote, params = {}, opts = {}) ⇒ Object
Accepts the specified quote.
1224 1225 1226 1227 1228 1229 1230 1231 |
# File 'lib/stripe/resources/quote.rb', line 1224 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.
1244 1245 1246 1247 1248 1249 1250 1251 |
# File 'lib/stripe/resources/quote.rb', line 1244 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).
1254 1255 1256 |
# File 'lib/stripe/resources/quote.rb', line 1254 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts) end |
.field_remappings ⇒ Object
1475 1476 1477 |
# File 'lib/stripe/resources/quote.rb', line 1475 def self.field_remappings @field_remappings = {} end |
.finalize_quote(quote, params = {}, opts = {}) ⇒ Object
Finalizes the quote.
1269 1270 1271 1272 1273 1274 1275 1276 |
# File 'lib/stripe/resources/quote.rb', line 1269 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
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 |
# File 'lib/stripe/resources/quote.rb', line 1459 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.
1279 1280 1281 |
# File 'lib/stripe/resources/quote.rb', line 1279 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.
1294 1295 1296 1297 1298 1299 1300 1301 |
# File 'lib/stripe/resources/quote.rb', line 1294 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.
1314 1315 1316 1317 1318 1319 1320 1321 |
# File 'lib/stripe/resources/quote.rb', line 1314 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.
1334 1335 1336 1337 1338 1339 1340 1341 |
# File 'lib/stripe/resources/quote.rb', line 1334 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.
1354 1355 1356 1357 1358 1359 1360 1361 |
# File 'lib/stripe/resources/quote.rb', line 1354 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.
1374 1375 1376 1377 1378 1379 1380 1381 |
# File 'lib/stripe/resources/quote.rb', line 1374 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.
1394 1395 1396 1397 1398 1399 1400 1401 |
# File 'lib/stripe/resources/quote.rb', line 1394 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)
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 |
# File 'lib/stripe/resources/quote.rb', line 1417 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.
1440 1441 1442 1443 1444 1445 1446 1447 |
# File 'lib/stripe/resources/quote.rb', line 1440 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.
1450 1451 1452 1453 1454 1455 1456 1457 |
# File 'lib/stripe/resources/quote.rb', line 1450 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.
1214 1215 1216 1217 1218 1219 1220 1221 |
# File 'lib/stripe/resources/quote.rb', line 1214 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.
1234 1235 1236 1237 1238 1239 1240 1241 |
# File 'lib/stripe/resources/quote.rb', line 1234 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.
1259 1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/stripe/resources/quote.rb', line 1259 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.
1284 1285 1286 1287 1288 1289 1290 1291 |
# File 'lib/stripe/resources/quote.rb', line 1284 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.
1304 1305 1306 1307 1308 1309 1310 1311 |
# File 'lib/stripe/resources/quote.rb', line 1304 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.
1324 1325 1326 1327 1328 1329 1330 1331 |
# File 'lib/stripe/resources/quote.rb', line 1324 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.
1344 1345 1346 1347 1348 1349 1350 1351 |
# File 'lib/stripe/resources/quote.rb', line 1344 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.
1364 1365 1366 1367 1368 1369 1370 1371 |
# File 'lib/stripe/resources/quote.rb', line 1364 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.
1384 1385 1386 1387 1388 1389 1390 1391 |
# File 'lib/stripe/resources/quote.rb', line 1384 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)
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 |
# File 'lib/stripe/resources/quote.rb', line 1404 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.
1430 1431 1432 1433 1434 1435 1436 1437 |
# File 'lib/stripe/resources/quote.rb', line 1430 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 |