API reference
Quotes
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.
https://api.knoxapi.comCreate a quote
POST/v1/quotes
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.
Body parameters
application_fee_amountintegerThe 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. There cannot be any line items with recurring prices when using this field.
application_fee_percentnumberA 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. There must be at least 1 line item with a recurring price to use this field.
automatic_taxobjectSettings for automatic tax lookup for this quote and resulting invoices and subscriptions.
Show 2 child parameters
enabledbooleanRequiredliabilityobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
collection_methodstringEither
charge_automatically, orsend_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice 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 asactive. Defaults tocharge_automatically.Possible valuescharge_automaticallysend_invoice
customerstringThe customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
customer_accountstringThe account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
default_tax_ratesarray of stringsThe tax rates that will apply to any line item that does not have
tax_ratesset.descriptionstringA description that will be displayed on the quote PDF. If no value is passed, the default description configured in your quote template settings will be used.
discountsarray of objectsThe discounts applied to the quote.
Show 3 child parameters
couponstringdiscountstringpromotion_codestring
expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atintegerA future timestamp on which the quote will be canceled if in
openordraftstatus. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your quote template settings will be used.footerstringA footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your quote template settings will be used.
from_quoteobjectClone an existing quote. The new quote will be created in
status=draft. When using this parameter, you cannot specify any other parameters except forexpires_at.Show 2 child parameters
quotestringRequiredis_revisionboolean
headerstringA header that will be displayed on the quote PDF. If no value is passed, the default header configured in your quote template settings will be used.
invoice_settingsobjectAll invoices will be billed using the specified settings.
Show 5 child parameters
custom_fieldsarray of objectsShow 2 child parameters
namestringRequiredvaluestringRequired
days_until_dueintegerdescriptionstringfooterstringissuerobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
line_itemsarray of objectsA list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
Show 5 child parameters
discountsarray of objectsShow 3 child parameters
couponstringdiscountstringpromotion_codestring
pricestringprice_dataobjectShow 6 child parameters
currencystringRequiredproductstringRequiredrecurringobjectChild parameters are listed in the OpenAPI document.
tax_behaviorstringPossible valuesexclusiveinclusiveunspecified
unit_amountintegerunit_amount_decimalstring
quantityintegertax_ratesarray of strings
metadataobjectSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.on_behalf_ofstringThe account on behalf of which to charge.
subscription_dataobjectWhen creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if
subscription_data[effective_date]is present and in the future, otherwise a subscription is created.Show 5 child parameters
billing_modeobjectShow 2 child parameters
typestringRequiredPossible valuesclassicflexible
flexibleobjectChild parameters are listed in the OpenAPI document.
descriptionstringeffective_datestring | integerPossible valuescurrent_period_end
metadataobjecttrial_period_daysinteger
test_clockstringID of the test clock to attach to the quote.
transfer_dataobjectThe data with which to automatically create a Transfer for each of the invoices.
Show 3 child parameters
destinationstringRequiredamountintegeramount_percentnumber
Returns
The quote object.
curl -X POST https://api.knoxapi.com/v1/quotes \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const quote = await stripe.quotes.create();import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
quote = client.v1.quotes.create()require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
quote = Stripe::Quote.create(){
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}List all quotes
GET/v1/quotes
Returns a list of your quotes.
Query parameters
customerstringThe ID of the customer whose quotes you're retrieving.
customer_accountstringThe ID of the account representing the customer whose quotes you're retrieving.
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.statusstringThe status of the quote.
Possible valuesacceptedcanceleddraftopen
test_clockstringProvides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set.
Returns
A list of quote objects.
curl -G https://api.knoxapi.com/v1/quotes \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const page = await stripe.quotes.list({
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
page = client.v1.quotes.list(params={
"limit": 3,
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
page = Stripe::Quote.list({
limit: 3,
}){
"object": "list",
"url": "/v1/quotes",
"has_more": false,
"data": [
{
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}
]
}Update a quote
POST/v1/quotes/{quote}
A quote models prices and services for a customer.
Path parameters
quotestringRequired
Body parameters
application_fee_amountintegerThe 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. There cannot be any line items with recurring prices when using this field.
application_fee_percentnumberA 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. There must be at least 1 line item with a recurring price to use this field.
automatic_taxobjectSettings for automatic tax lookup for this quote and resulting invoices and subscriptions.
Show 2 child parameters
enabledbooleanRequiredliabilityobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
collection_methodstringEither
charge_automatically, orsend_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice 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 asactive. Defaults tocharge_automatically.Possible valuescharge_automaticallysend_invoice
customerstringThe customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
customer_accountstringThe account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
default_tax_ratesarray of stringsThe tax rates that will apply to any line item that does not have
tax_ratesset.descriptionstringA description that will be displayed on the quote PDF.
discountsarray of objectsThe discounts applied to the quote.
Show 3 child parameters
couponstringdiscountstringpromotion_codestring
expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atintegerA future timestamp on which the quote will be canceled if in
openordraftstatus. Measured in seconds since the Unix epoch.footerstringA footer that will be displayed on the quote PDF.
headerstringA header that will be displayed on the quote PDF.
invoice_settingsobjectAll invoices will be billed using the specified settings.
Show 5 child parameters
custom_fieldsarray of objectsShow 2 child parameters
namestringRequiredvaluestringRequired
days_until_dueintegerdescriptionstringfooterstringissuerobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
line_itemsarray of objectsA list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
Show 6 child parameters
discountsarray of objectsShow 3 child parameters
couponstringdiscountstringpromotion_codestring
idstringpricestringprice_dataobjectShow 6 child parameters
currencystringRequiredproductstringRequiredrecurringobjectChild parameters are listed in the OpenAPI document.
tax_behaviorstringPossible valuesexclusiveinclusiveunspecified
unit_amountintegerunit_amount_decimalstring
quantityintegertax_ratesarray of strings
metadataobjectSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.on_behalf_ofstringThe account on behalf of which to charge.
subscription_dataobjectWhen creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if
subscription_data[effective_date]is present and in the future, otherwise a subscription is created.Show 4 child parameters
descriptionstringeffective_datestring | integerPossible valuescurrent_period_end
metadataobjecttrial_period_daysinteger
transfer_dataobjectThe data with which to automatically create a Transfer for each of the invoices.
Show 3 child parameters
destinationstringRequiredamountintegeramount_percentnumber
Returns
The quote object.
curl https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "metadata[order_id]=6735"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const quote = await stripe.quotes.update('qt_1Pgc79B7WZ01zgkWHyj9Adwl', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
quote = client.v1.quotes.update("qt_1Pgc79B7WZ01zgkWHyj9Adwl", params={
"metadata": {
"order_id": "6735",
},
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
quote = Stripe::Quote.update('qt_1Pgc79B7WZ01zgkWHyj9Adwl', {
metadata: {
order_id: '6735',
},
}){
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}Retrieve a quote
GET/v1/quotes/{quote}
Retrieves the quote with the given ID.
Path parameters
quotestringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The quote object.
curl https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const quote = await stripe.quotes.retrieve('qt_1Pgc79B7WZ01zgkWHyj9Adwl');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
quote = client.v1.quotes.retrieve("qt_1Pgc79B7WZ01zgkWHyj9Adwl")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
quote = Stripe::Quote.retrieve('qt_1Pgc79B7WZ01zgkWHyj9Adwl'){
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}Accept a quote
POST/v1/quotes/{quote}/accept
Accepts the specified quote.
Path parameters
quotestringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The quote object.
curl -X POST https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/accept \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const quote = await stripe.quotes.accept('qt_1Pgc79B7WZ01zgkWHyj9Adwl');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
quote = client.v1.quotes.accept("qt_1Pgc79B7WZ01zgkWHyj9Adwl")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
quote = Stripe::Quote.accept('qt_1Pgc79B7WZ01zgkWHyj9Adwl'){
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}Cancel a quote
POST/v1/quotes/{quote}/cancel
Cancels the quote.
Path parameters
quotestringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The quote object.
curl -X POST https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/cancel \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const quote = await stripe.quotes.cancel('qt_1Pgc79B7WZ01zgkWHyj9Adwl');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
quote = client.v1.quotes.cancel("qt_1Pgc79B7WZ01zgkWHyj9Adwl")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
quote = Stripe::Quote.cancel('qt_1Pgc79B7WZ01zgkWHyj9Adwl'){
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}Retrieve a quote's upfront line items
GET/v1/quotes/{quote}/computed_upfront_line_items
When retrieving a quote, there is an includable 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.
Path parameters
quotestringRequired
Query parameters
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of item objects.
curl -G https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/computed_upfront_line_items \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/computed_upfront_line_items', {
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/computed_upfront_line_items", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/computed_upfront_line_items', {
limit: 3,
}){
"object": "list",
"url": "/v1/quotes",
"has_more": false,
"data": [
{
"amount_discount": 0,
"amount_subtotal": 0,
"amount_tax": 0,
"amount_total": 0,
"currency": "usd",
"description": "T-shirt",
"id": "li_1Pgc73B7WZ01zgkWx8kcmZPK",
"object": "item",
"price": {
"active": true,
"billing_scheme": "per_unit",
"created": 1721948530,
"currency": "usd",
"custom_unit_amount": {
"maximum": null,
"minimum": null,
"preset": null
},
"id": "price_1PgafmB7WZ01zgkW02Hf9z6c",
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"object": "price",
"product": "prod_QXg1hqf4jFNsqG",
"recurring": {
"interval": "month",
"interval_count": 797691627,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": {
"divide_by": 1592560163,
"round": "down"
},
"type": "one_time",
"unit_amount": 1000,
"unit_amount_decimal": "1000"
},
"quantity": 1,
"metadata": null,
"adjustable_quantity": {
"enabled": true,
"maximum": null,
"minimum": null
}
}
]
}Finalize a quote
POST/v1/quotes/{quote}/finalize
Finalizes the quote.
Path parameters
quotestringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atintegerA future timestamp on which the quote will be canceled if in
openordraftstatus. Measured in seconds since the Unix epoch.
Returns
The quote object.
curl -X POST https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/finalize \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const quote = await stripe.quotes.finalizeQuote('qt_1Pgc79B7WZ01zgkWHyj9Adwl');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
quote = client.v1.quotes.finalize_quote("qt_1Pgc79B7WZ01zgkWHyj9Adwl")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
quote = Stripe::Quote.finalize_quote('qt_1Pgc79B7WZ01zgkWHyj9Adwl'){
"amount_subtotal": 0,
"amount_total": 0,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"collection_method": "charge_automatically",
"computed": {
"recurring": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"interval": "month",
"interval_count": 797691627,
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
}
},
"upfront": {
"amount_subtotal": 0,
"amount_total": 0,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
}
}
},
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"default_tax_rates": [],
"description": null,
"discounts": [],
"expires_at": 1234567890,
"footer": null,
"from_quote": {
"is_revision": true,
"quote": "quote"
},
"header": null,
"id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
"invoice": null,
"invoice_settings": {
"days_until_due": null,
"issuer": {
"type": "self"
},
"custom_fields": null,
"description": null,
"footer": null
},
"livemode": false,
"metadata": {},
"number": null,
"object": "quote",
"on_behalf_of": null,
"status": "draft",
"status_transitions": {
"accepted_at": null,
"canceled_at": null,
"finalized_at": null
},
"subscription": null,
"subscription_data": {
"description": null,
"effective_date": null,
"metadata": null,
"trial_period_days": null,
"billing_mode": {
"type": "classic"
}
},
"subscription_schedule": null,
"test_clock": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"transfer_data": {
"amount": null,
"amount_percent": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"customer_account": null
}Retrieve a quote's line items
GET/v1/quotes/{quote}/line_items
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.
Path parameters
quotestringRequired
Query parameters
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of item objects.
curl -G https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/line_items \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/line_items', {
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/line_items", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/line_items', {
limit: 3,
}){
"object": "list",
"url": "/v1/quotes",
"has_more": false,
"data": [
{
"amount_discount": 0,
"amount_subtotal": 0,
"amount_tax": 0,
"amount_total": 0,
"currency": "usd",
"description": "T-shirt",
"id": "li_1Pgc73B7WZ01zgkWx8kcmZPK",
"object": "item",
"price": {
"active": true,
"billing_scheme": "per_unit",
"created": 1721948530,
"currency": "usd",
"custom_unit_amount": {
"maximum": null,
"minimum": null,
"preset": null
},
"id": "price_1PgafmB7WZ01zgkW02Hf9z6c",
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"object": "price",
"product": "prod_QXg1hqf4jFNsqG",
"recurring": {
"interval": "month",
"interval_count": 797691627,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": {
"divide_by": 1592560163,
"round": "down"
},
"type": "one_time",
"unit_amount": 1000,
"unit_amount_decimal": "1000"
},
"quantity": 1,
"metadata": null,
"adjustable_quantity": {
"enabled": true,
"maximum": null,
"minimum": null
}
}
]
}Download quote PDF
GET/v1/quotes/{quote}/pdf
Download the PDF for a finalized quote. Explanation for special handling can be found here
Path parameters
quotestringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
Successful response.
curl https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/pdf \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/pdf');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/pdf")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/pdf')Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.