Quotes
Creates, updates, and queries the quotes available.
Table Specific Information
Select
The driver uses the Stripe API to filter the results by the following columns and operators:
- Id supports the following operator: =.
- CustomerId supports the following operator: =.
- Status supports the following operator: =.
- TestClock supports the following operator: =.
The rest of the filter is executed client-side within the driver.
You can select from the Quotes table with the following queries:
SELECT * FROM Quotes WHERE Id = '123124' SELECT * FROM Quotes WHERE CustomerId = 'cus_NVasad' SELECT * FROM Quotes WHERE Status = 'draft' SELECT * FROM Quotes WHERE TestClock = 'clock_id'
Insert
To create a quote for the invoice:
INSERT INTO Quotes (AutomaticTaxEnabled, CollectionMethod, CustomerId, Description, InvoiceSettingsDaysUntilDue, Metadata, SubscriptionDataTrialPeriodDays) values ('false', 'send_invoice', 'cus_NBs3z63zmfCJy1', 'Thanks for using YMBusiness!!', 25, '{"name":"test name 2", "surname":"test surname", "age" : "23"}', 20)
INSERT INTO Quotes (DefaultTaxRates, FromQuote, Discounts, TransferData, LineItems) VALUES ('[\"txr_1OL7oy2eZvKYlo2CLylDtkiI\",\"txr_1OL7oo2eZvKYlo2CHliiOEZT\"]', '{\"quote\":\"qt_1N6vEL2eZvKYlo2CwySMFZbA\",\"is_revision\":\"true\"}', '{\"coupon\":\"test1\"}', '{\"destination\":\"acc_123566677\",\"amount\":\"440\",\"amount_percent\":\"23\"}', '[{\"price\":\"price_1OM02h2eZvKYlo2CiiTU7dCm\",\"quantity\":\"10\"}]')
Update
To modify a quote, specify the quote Id:
UPDATE Quotes SET InvoiceSettingsDaysUntilDue = 20 WHERE Id='123124'
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | String | True |
The Id of the quotes. | |
AmountSubtotal | Integer | True |
The total before any discounts or taxes are applied. | |
AmountTotal | Integer | True |
The total after discounts and taxes are applied. | |
Application | String | True |
The Id of the Connect Application that created the quote. | |
ApplicationFeeAmount | Integer | False |
The amount of the application fee. | |
ApplicationFeePercent | Double | False |
A non-negative decimal between 0 and 100, with at most two decimal places. | |
AutomaticTaxEnabled | Boolean | False |
Automatically calculates taxes. | |
AutomaticTaxStatus | String | True |
The status of the most recent automated tax calculation for this quote. | |
CollectionMethod | String | False |
The method to collect charge money, either charge_automatically or send_invoice. | |
ComputedRecurring | String | True |
The definitive totals and line items the customer is charged on a recurring basis. | |
ComputedUpfrontAmountSubtotal | Integer | True |
The total before any discounts or taxes are applied. | |
ComputedUpfrontAmountTotal | Integer | True |
The total after discounts and taxes are applied. | |
ComputedUpfrontTotalDetailsAmountDiscount | Integer | True |
The sum of all the discounts. | |
ComputedUpfrontTotalDetailsAmountShipping | Integer | True |
The sum of all the shipping amounts. | |
ComputedUpfrontTotalDetailsAmountTax | Integer | True |
The sum of all the tax amounts. | |
Created | Datetime | True |
The time at which the object was created. Measured in seconds since the Unix epoch. | |
Currency | String | True |
A three-letter ISO currency code, in lowercase. | |
CustomerId | String | False |
The Id of the customer. | |
DefaultTaxRates | String | False |
The tax rates applied to this quote. | |
Description | String | False |
A description that is displayed on the quote PDF. | |
Discounts | String | False |
The discounts applied to this quote. | |
ExpiresAt | Datetime | False |
The date on which the quote is canceled if in open or draft status. | |
Footer | String | False |
A footer that is displayed on the quote PDF. | |
FromQuote | String | False |
Details of the quote that was cloned. | |
Header | String | False |
A header that is displayed on the quote PDF. | |
InvoiceId | String | True |
The Id of the invoice that was created from this quote. | |
InvoiceSettingsDaysUntilDue | Integer | False |
The number of days within which a customer must pay invoices generated by this quote. | |
Livemode | Boolean | True |
true if the object is in live mode andfalse if in test mode. | |
LineItems | String | False |
The line items representing what is being sold. Each line item represents an item being sold. | |
Metadata | String | False |
The set of key/value pairs that you can attach to a value list object. | |
Number | String | True |
A unique number that identifies this particular quote. | |
OnBehalfOf | String | False |
The account on behalf of which to charge. | |
Status | String | True |
The status of the quote. | |
StatusTransitionsAcceptedAt | Datetime | True |
The time that the quote was accepted. | |
StatusTransitionsCanceledAt | Datetime | True |
The time that the quote was canceled. | |
StatusTransitionsFinalizedAt | Datetime | True |
The time that the quote was finalized. | |
Subscription | String | True |
The subscription that was created or updated from this quote. | |
SubscriptionDataDescription | String | False |
The subscription's description, meant to be displayable to the customer. | |
SubscriptionDataEffectiveDate | Datetime | False |
When creating a new subscription, the date of which the subscription schedule starts after the quote is accepted. | |
SubscriptionDataTrialPeriodDays | Integer | False |
An integer representing the number of trial period days before the customer is charged for the first time. | |
SubscriptionSchedule | String | True |
The subscription schedule that was created or updated from this quote. | |
TestClock | String | False |
The Id of the test clock this quote belongs to. | |
TotalDetailsAmountDiscount | Integer | True |
The sum of all the discounts. | |
TotalDetailsAmountShipping | Integer | True |
The sum of all the shipping amounts. | |
TotalDetailsAmountTax | Integer | True |
The sum of all the tax amounts. | |
TransferData | String | False |
The account (if any) the payments are attributed to for tax reporting, and where funds from each payment are transferred to for each of the invoices. | |
AutomaticTaxLiabilityAccount | String | False |
The connected account being referenced when type is account. | |
AutomaticTaxLiabilityType | String | False |
Type of the account referenced. | |
InvoiceSettingsIssuerAccount | String | False |
The connected account being referenced when type is account. | |
InvoiceSettingsIssuerType | String | False |
Type of the account referenced. The allowed values are account, self. | |
SubscriptionDataMetadata | String | False |
Set of key-value pairs that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in line_items, this field will be passed to the resulting subscription’s metadata field. If subscription_data.effective_date is used, this field will be passed to the resulting subscription schedule’s phases.metadata field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
AccountId | String |
The Id of the connected account for which to get a quote. |