Quotes
The quote object
A quote is a priced offer to a customer, built like an invoice from products, tax rates, fees, a coupon and shipping. It starts as a draft, is finalized to open, and when accepted becomes an invoice (invoice_id); it can be canceled until then.
Attributes
idstringRequiredUnique identifier for the object.
objectstringRequiredString naming the object's type.
livemodebooleanRequiredtruewhen the object exists in live mode,falsein test mode.createdtimestampRequiredTime the object was created, in Unix seconds.
updatedtimestampRequiredTime the object last changed, in Unix seconds.
numberstringRequiredSequential document number assigned when the quote is created.
invoice_idstringRequiredID of the invoice created when the quote was accepted; empty until then. For a quote hosted by a provider it is set when the provider's invoice reaches Paycose.
customer_idstringRequiredID of the customer the quote is for.
default_payment_method_idstringRequiredID of the saved payment method the invoice created on acceptance uses by default. Empty when none is set.
payment_method_typestringType of the default payment method set on the quote, such as
cardorpromptpay. Absent when none is set.collection_methodenumRequiredHow the invoice created on acceptance is collected:
charge_automatically(default) orsend_invoice.charge_automaticallyThe invoice created on acceptance is charged to the default payment method without the customer acting.
send_invoiceThe invoice created on acceptance is sent to the customer to pay by its due date.
capture_methodstringRequiredHow the payment of the invoice created on acceptance is captured:
automatic(default) ormanual.automaticThe payment is captured as soon as it is authorized.
manualThe payment is only authorized; you capture it later.
auto_advancebooleanRequiredWhether the invoice created when the quote is accepted is finalized and collected automatically. With
falsethat invoice stays a draft until you finalize it.due_datetimestampNullableDue date given to the invoice created on acceptance, in Unix seconds. Absent when not set.
customer_namestringRequiredCustomer's name, copied from the customer when the quote was created.
customer_emailstringRequiredCustomer's email address, copied from the customer when the quote was created.
customer_phonestringRequiredCustomer's phone number, copied from the customer when the quote was created.
addressobjectNullableThe customer's billing address, copied from the customer when the quote was created (their
billingaddress, else their first address).nullwhen the customer has no address.Show child attributes
address.idstringUnique identifier for the object.
address.address_typestringRequiredKind of address:
billingorshipping.billingThe address the quote is billed to.
shippingThe address the order is shipped to.
address.namestringRequiredName of the person or business at the address.
address.phonestringRequiredPhone number for the address.
address.line1stringRequiredFirst line of the street address.
address.line2stringRequiredSecond line of the street address, such as a building or unit.
address.citystringRequiredCity, district or town.
address.statestringRequiredState, province or region.
address.postal_codestringRequiredPostal code.
address.countrystringRequiredCountry of the address, as given (for example
TH).
shipping_addressobjectNullableAddress the order ships to: the
shipping_addresssent withenable_shipping, else the customer's saved shipping address.nullwhen there is none.Show child attributes
shipping_address.idstringUnique identifier for the object.
shipping_address.address_typestringRequiredKind of address:
billingorshipping.billingThe address the quote is billed to.
shippingThe address the order is shipped to.
shipping_address.namestringRequiredName of the person or business at the address.
shipping_address.phonestringRequiredPhone number for the address.
shipping_address.line1stringRequiredFirst line of the street address.
shipping_address.line2stringRequiredSecond line of the street address, such as a building or unit.
shipping_address.citystringRequiredCity, district or town.
shipping_address.statestringRequiredState, province or region.
shipping_address.postal_codestringRequiredPostal code.
shipping_address.countrystringRequiredCountry of the address, as given (for example
TH).
line_itemsarray of objectsRequiredLines of the quote: the product lines, then one line per fee.
Show child attributes
line_items.idstringRequiredUnique identifier for the object.
line_items.objectstringRequiredString naming the object's type.
line_items.product_idstringRequiredID of the product. On fee lines, the hosting provider's ID for the fee's product, empty when Paycose bills the quote itself.
line_items.product_price_idstringRequiredID of the price billed. On fee lines, the hosting provider's ID for the fee's price, empty when Paycose bills the quote itself.
line_items.product_reference_idstringOn product lines, the hosting provider's ID for the product; for a quote Paycose bills itself, an internal reference. Absent on fee lines.
line_items.price_reference_idstringOn product lines, the hosting provider's ID for the price; for a quote Paycose bills itself, the Paycose price ID. Absent on fee lines.
line_items.sort_orderintegerRequiredPosition of the line among the quote lines.
line_items.typestringRequiredKind of line:
productorfee.productA product billed at one of its prices.
feeA fee line, added after the product lines; its
metadata.application_fee_idnames the fee.
line_items.descriptionstringRequiredText shown for the line: the product name on product lines, the fee name on fee lines.
line_items.product_namestringRequiredName of the product, or of the fee on fee lines.
line_items.product_descriptionstringRequiredDescription of the product, or of the fee on fee lines; may be empty.
line_items.product_imagestringRequiredURL of the product image; empty when the product has none or it is not known.
line_items.product_typestringRequiredCadence of the price billed:
onetime,recurringorusage-basedon product lines,feeon fee lines.onetimeThe price is charged once.
recurringThe price recurs every billing interval.
usage-basedThe price is charged by metered usage.
feeThe line is a fee, not a product.
line_items.unit_amountintegerRequiredPrice of one unit, in the smallest currency unit. On a fee line, the fee amount.
line_items.quantityintegerRequiredNumber of units billed. Fee lines have a quantity of
1.line_items.amount_discountintegerRequiredPart of the quote discount allocated to this line, in the smallest currency unit.
line_items.amount_subtotalintegerRequiredunit_amount×quantity, before discount and tax, in the smallest currency unit.line_items.amount_taxintegerRequiredTax on this line at all its rates, in the smallest currency unit, including tax already inside inclusive prices.
line_items.amount_totalintegerRequiredLine total, in the smallest currency unit:
amount_subtotalminusamount_discount, plus tax that is not inclusive.line_items.currencystringRequiredThree-letter ISO 4217 currency code, in lowercase.
line_items.discountablebooleanRequiredWhether a coupon discount can apply to this line;
falseon fee lines.line_items.withholding_taxbooleanRequiredWhether the customer withholds Thai tax on this line; such a line counts in the document's
amount_withholding.line_items.period_starttimestampRequiredNullableUnix timestamp in seconds.
line_items.period_endtimestampRequiredNullableUnix timestamp in seconds.
line_items.reference_idstringRequiredThe hosting provider's ID for the line; for a quote Paycose bills itself, an internal reference.
line_items.metadataobjectRequiredKey-value pairs you attach to the object for your own use. Paycose never reads or changes them.
line_items.taxesarray of objectsRequiredTax rates applied to this line, one entry per rate.
Show child attributes
line_items.taxes.idstringRequiredUnique identifier for the object.
line_items.taxes.tax_rate_idstringRequiredID of the tax rate.
line_items.taxes.taxable_amountintegerRequiredAmount the rate applies to, in the smallest currency unit. For an inclusive rate this is the line amount without the tax inside it.
line_items.taxes.tax_amountintegerRequiredTax at this rate, in the smallest currency unit.
line_items.taxes.inclusivebooleanRequiredtruewhen the tax is already included in the line amount;falsewhen it is added on top of it.
discountsarray of objectsRequiredDiscounts applied to the quote; at most one, from its coupon or promotion code.
Show child attributes
discounts.idstringRequiredUnique identifier for the object.
discounts.coupon_idstringRequiredID of the coupon that gives the discount.
discounts.promotion_code_idstringRequiredID of the promotion code the coupon was redeemed through; empty when the coupon was applied directly.
discounts.namestringRequiredName of the coupon.
discounts.amountintegerRequiredDiscount amount, in the smallest currency unit.
subtotalintegerRequiredSum of the line amounts, product and fee lines, before discount and tax, in the smallest currency unit.
taxintegerRequiredTotal tax across all lines, in the smallest currency unit, including tax already inside inclusive prices.
totalintegerRequiredAmount quoted to the customer, in the smallest currency unit (e.g.
49900= 499.00 THB):subtotalminusamount_discount, plus tax that is not inclusive andamount_shipping.amount_shippingintegerRequiredShipping amount from the quote's shipping rate, in the smallest currency unit.
0without shipping.shipping_rate_idstringID of the shipping rate charged on the quote. Absent when the quote has no shipping.
amount_discountintegerRequiredTotal discount from the quote's coupon or promotion code, in the smallest currency unit.
0without a discount.withholding_taxobjectRequiredNullableThai withholding tax the customer deducts, as
{"rate": 3};nullwhen it withholds nothing. The invoice made on acceptance withholds the same way.Show child attributes
withholding_tax.rateintegerRequiredWithholding percent: 1, 2, 3 or 5.
amount_withholdingintegerRequiredWithholding tax in the smallest currency unit:
withholding_tax.ratepercent of the withheld lines' amount before VAT and after discounts, rounded half up once on their sum. Fees and shipping are never withheld.amount_dueintegerRequiredWhat the customer will pay:
totallessamount_withholding.currencystringRequiredThree-letter ISO 4217 currency code, in lowercase.
scaling_factorintegerRequiredNumber of smallest currency units in one unit of
currency(10 to the power of the currency's decimal places), e.g.100for THB. Divide an amount by it to get the value in major units.transfer_dataobjectRequiredNullableWhere the funds go when the invoice created on acceptance is paid; that invoice inherits it.
nullwhen not set.Show child attributes
transfer_data.destinationstringRequiredID of the connected account (
acct_…) the document is for.transfer_data.balance_idstringRequiredID of the balance the document's payments are booked to.
transfer_data.connectedbooleanRequiredTrue when the destination is a connected account paid under Connect: what you owe it and your application fee are recorded on your ledger. False for a legacy destination.
on_behalf_ofstringID of the connected account the payment is made on behalf of. Present only when
transfer_data.destinationis a connected account; the fee lines are then the application fee.statusenumRequiredStatus of the quote:
draft,open,acceptedorcanceled.draftThe quote is being prepared. Every field can change; finalize it to make it
open.openThe quote is finalized and waits for the customer. Only fields that do not affect the price can change; it can be accepted or canceled.
acceptedThe customer accepted the quote and an invoice is created from it (
invoice_id). It can no longer change.canceledThe quote was canceled before it was accepted. It can no longer change.
providerstringRequiredName of the payment provider that hosts the quote, such as
stripe. Empty when Paycose bills the quote itself.reference_idstringRequiredThe hosting provider's ID for the quote. Empty when Paycose bills the quote itself.
expires_attimestampRequiredNullableExpiry time set with an update, in Unix seconds;
nullwhen not set. From this time the quote can no longer be accepted, and Paycose cancels it within minutes withcancellation_reasonexpired(at its provider too).accepted_attimestampRequiredNullableTime the quote was accepted, in Unix seconds;
nulluntil then.accepted_byenumWho accepted the quote:
merchantwhen you accepted it with the API or Dashboard,customerwhen the customer accepted it on its hosted link. Absent until accepted, and when its provider reported the acceptance.merchantYou accepted the quote with the API or the Dashboard.
customerThe customer accepted the quote on its hosted link.
cancellation_reasonenumWhy the quote was canceled:
expiredwhen it passedexpires_at,declinedwhen the customer declined it on its hosted link. Absent when you canceled it yourself, and while it is not canceled.expiredThe quote passed its
expires_atwhile still open.declinedThe customer declined the quote on its hosted link.
cancellation_commentstringThe reason the customer gave when declining the quote on its hosted link. Absent when they gave none.
metadataobjectRequiredKey-value pairs you attach to the object for your own use. Paycose never reads or changes them.
default_tax_ratesarray of stringsRequiredIDs of the quote's default tax rates, derived from its lines: the rates on the fee lines if there are any, otherwise the rates every product line has in common.
account_tax_idsarray of stringsRequiredIDs of your own business tax IDs to show on the quote, as sent on create or update. For a quote hosted by a provider they are passed to it unchanged.
payment_method_typesarray of stringsRequiredPayment method types the payer may use to pay the invoice created on acceptance. Empty means no restriction.
payment_method_providersarray of stringsRequiredPayment providers the payer may use to pay the invoice created on acceptance. Empty means no restriction.
The full customer object when you pass
expand[]=customer; otherwise absent — usecustomer_id.default_payment_methodanyThe full payment method object when you pass
expand[]=default_payment_method; otherwise absent — usedefault_payment_method_id.The full invoice object when you pass
expand[]=invoice; otherwise absent — useinvoice_id.