Skip to Content
Paycose Docs
Quotes

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

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.

  • numberstringRequired

    Sequential document number assigned when the quote is created.

  • invoice_idstringRequired

    ID 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_idstringRequired

    ID of the customer the quote is for.

  • default_payment_method_idstringRequired

    ID of the saved payment method the invoice created on acceptance uses by default. Empty when none is set.

  • payment_method_typestring

    Type of the default payment method set on the quote, such as card or promptpay. Absent when none is set.

  • collection_methodenumRequired

    How the invoice created on acceptance is collected: charge_automatically (default) or send_invoice.

    • charge_automatically

      The invoice created on acceptance is charged to the default payment method without the customer acting.

    • send_invoice

      The invoice created on acceptance is sent to the customer to pay by its due date.

  • capture_methodstringRequired

    How the payment of the invoice created on acceptance is captured: automatic (default) or manual.

    • automatic

      The payment is captured as soon as it is authorized.

    • manual

      The payment is only authorized; you capture it later.

  • auto_advancebooleanRequired

    Whether the invoice created when the quote is accepted is finalized and collected automatically. With false that invoice stays a draft until you finalize it.

  • due_datetimestampNullable

    Due date given to the invoice created on acceptance, in Unix seconds. Absent when not set.

  • customer_namestringRequired

    Customer's name, copied from the customer when the quote was created.

  • customer_emailstringRequired

    Customer's email address, copied from the customer when the quote was created.

  • customer_phonestringRequired

    Customer's phone number, copied from the customer when the quote was created.

  • addressobjectNullable

    The customer's billing address, copied from the customer when the quote was created (their billing address, else their first address). null when the customer has no address.

    Show child attributes
    • address.idstring

      Unique identifier for the object.

    • address.address_typestringRequired

      Kind of address: billing or shipping.

      • billing

        The address the quote is billed to.

      • shipping

        The address the order is shipped to.

    • address.namestringRequired

      Name of the person or business at the address.

    • address.phonestringRequired

      Phone number for the address.

    • address.line1stringRequired

      First line of the street address.

    • address.line2stringRequired

      Second line of the street address, such as a building or unit.

    • address.citystringRequired

      City, district or town.

    • address.statestringRequired

      State, province or region.

    • address.postal_codestringRequired

      Postal code.

    • address.countrystringRequired

      Country of the address, as given (for example TH).

  • shipping_addressobjectNullable

    Address the order ships to: the shipping_address sent with enable_shipping, else the customer's saved shipping address. null when there is none.

    Show child attributes
    • shipping_address.idstring

      Unique identifier for the object.

    • shipping_address.address_typestringRequired

      Kind of address: billing or shipping.

      • billing

        The address the quote is billed to.

      • shipping

        The address the order is shipped to.

    • shipping_address.namestringRequired

      Name of the person or business at the address.

    • shipping_address.phonestringRequired

      Phone number for the address.

    • shipping_address.line1stringRequired

      First line of the street address.

    • shipping_address.line2stringRequired

      Second line of the street address, such as a building or unit.

    • shipping_address.citystringRequired

      City, district or town.

    • shipping_address.statestringRequired

      State, province or region.

    • shipping_address.postal_codestringRequired

      Postal code.

    • shipping_address.countrystringRequired

      Country of the address, as given (for example TH).

  • line_itemsarray of objectsRequired

    Lines of the quote: the product lines, then one line per fee.

    Show child attributes
    • line_items.idstringRequired

      Unique identifier for the object.

    • line_items.objectstringRequired

      String naming the object's type.

    • line_items.product_idstringRequired

      ID 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_idstringRequired

      ID 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_idstring

      On 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_idstring

      On 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_orderintegerRequired

      Position of the line among the quote lines.

    • line_items.typestringRequired

      Kind of line: product or fee.

      • product

        A product billed at one of its prices.

      • fee

        A fee line, added after the product lines; its metadata.application_fee_id names the fee.

    • line_items.descriptionstringRequired

      Text shown for the line: the product name on product lines, the fee name on fee lines.

    • line_items.product_namestringRequired

      Name of the product, or of the fee on fee lines.

    • line_items.product_descriptionstringRequired

      Description of the product, or of the fee on fee lines; may be empty.

    • line_items.product_imagestringRequired

      URL of the product image; empty when the product has none or it is not known.

    • line_items.product_typestringRequired

      Cadence of the price billed: onetime, recurring or usage-based on product lines, fee on fee lines.

      • onetime

        The price is charged once.

      • recurring

        The price recurs every billing interval.

      • usage-based

        The price is charged by metered usage.

      • fee

        The line is a fee, not a product.

    • line_items.unit_amountintegerRequired

      Price of one unit, in the smallest currency unit. On a fee line, the fee amount.

    • line_items.quantityintegerRequired

      Number of units billed. Fee lines have a quantity of 1.

    • line_items.amount_discountintegerRequired

      Part of the quote discount allocated to this line, in the smallest currency unit.

    • line_items.amount_subtotalintegerRequired

      unit_amount × quantity, before discount and tax, in the smallest currency unit.

    • line_items.amount_taxintegerRequired

      Tax on this line at all its rates, in the smallest currency unit, including tax already inside inclusive prices.

    • line_items.amount_totalintegerRequired

      Line total, in the smallest currency unit: amount_subtotal minus amount_discount, plus tax that is not inclusive.

    • line_items.currencystringRequired

      Three-letter ISO 4217 currency code, in lowercase.

    • line_items.discountablebooleanRequired

      Whether a coupon discount can apply to this line; false on fee lines.

    • line_items.withholding_taxbooleanRequired

      Whether the customer withholds Thai tax on this line; such a line counts in the document's amount_withholding.

    • line_items.period_starttimestampRequiredNullable

      Unix timestamp in seconds.

    • line_items.period_endtimestampRequiredNullable

      Unix timestamp in seconds.

    • line_items.reference_idstringRequired

      The hosting provider's ID for the line; for a quote Paycose bills itself, an internal reference.

    • line_items.metadataobjectRequired

      Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

    • line_items.taxesarray of objectsRequired

      Tax rates applied to this line, one entry per rate.

      Show child attributes
      • line_items.taxes.idstringRequired

        Unique identifier for the object.

      • line_items.taxes.tax_rate_idstringRequired

        ID of the tax rate.

      • line_items.taxes.taxable_amountintegerRequired

        Amount 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_amountintegerRequired

        Tax at this rate, in the smallest currency unit.

      • line_items.taxes.inclusivebooleanRequired

        true when the tax is already included in the line amount; false when it is added on top of it.

  • discountsarray of objectsRequired

    Discounts applied to the quote; at most one, from its coupon or promotion code.

    Show child attributes
    • discounts.idstringRequired

      Unique identifier for the object.

    • discounts.coupon_idstringRequired

      ID of the coupon that gives the discount.

    • discounts.promotion_code_idstringRequired

      ID of the promotion code the coupon was redeemed through; empty when the coupon was applied directly.

    • discounts.namestringRequired

      Name of the coupon.

    • discounts.amountintegerRequired

      Discount amount, in the smallest currency unit.

  • subtotalintegerRequired

    Sum of the line amounts, product and fee lines, before discount and tax, in the smallest currency unit.

  • taxintegerRequired

    Total tax across all lines, in the smallest currency unit, including tax already inside inclusive prices.

  • totalintegerRequired

    Amount quoted to the customer, in the smallest currency unit (e.g. 49900 = 499.00 THB): subtotal minus amount_discount, plus tax that is not inclusive and amount_shipping.

  • amount_shippingintegerRequired

    Shipping amount from the quote's shipping rate, in the smallest currency unit. 0 without shipping.

  • shipping_rate_idstring

    ID of the shipping rate charged on the quote. Absent when the quote has no shipping.

  • amount_discountintegerRequired

    Total discount from the quote's coupon or promotion code, in the smallest currency unit. 0 without a discount.

  • withholding_taxobjectRequiredNullable

    Thai withholding tax the customer deducts, as {"rate": 3}; null when it withholds nothing. The invoice made on acceptance withholds the same way.

    Show child attributes
    • withholding_tax.rateintegerRequired

      Withholding percent: 1, 2, 3 or 5.

  • amount_withholdingintegerRequired

    Withholding tax in the smallest currency unit: withholding_tax.rate percent of the withheld lines' amount before VAT and after discounts, rounded half up once on their sum. Fees and shipping are never withheld.

  • amount_dueintegerRequired

    What the customer will pay: total less amount_withholding.

  • currencystringRequired

    Three-letter ISO 4217 currency code, in lowercase.

  • scaling_factorintegerRequired

    Number of smallest currency units in one unit of currency (10 to the power of the currency's decimal places), e.g. 100 for THB. Divide an amount by it to get the value in major units.

  • transfer_dataobjectRequiredNullable

    Where the funds go when the invoice created on acceptance is paid; that invoice inherits it. null when not set.

    Show child attributes
    • transfer_data.destinationstringRequired

      ID of the connected account (acct_…) the document is for.

    • transfer_data.balance_idstringRequired

      ID of the balance the document's payments are booked to.

    • transfer_data.connectedbooleanRequired

      True 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_ofstring

    ID of the connected account the payment is made on behalf of. Present only when transfer_data.destination is a connected account; the fee lines are then the application fee.

  • statusenumRequired

    Status of the quote: draft, open, accepted or canceled.

    • draft

      The quote is being prepared. Every field can change; finalize it to make it open.

    • open

      The quote is finalized and waits for the customer. Only fields that do not affect the price can change; it can be accepted or canceled.

    • accepted

      The customer accepted the quote and an invoice is created from it (invoice_id). It can no longer change.

    • canceled

      The quote was canceled before it was accepted. It can no longer change.

  • providerstringRequired

    Name of the payment provider that hosts the quote, such as stripe. Empty when Paycose bills the quote itself.

  • reference_idstringRequired

    The hosting provider's ID for the quote. Empty when Paycose bills the quote itself.

  • expires_attimestampRequiredNullable

    Expiry time set with an update, in Unix seconds; null when not set. From this time the quote can no longer be accepted, and Paycose cancels it within minutes with cancellation_reason expired (at its provider too).

  • accepted_attimestampRequiredNullable

    Time the quote was accepted, in Unix seconds; null until then.

  • accepted_byenum

    Who accepted the quote: merchant when you accepted it with the API or Dashboard, customer when the customer accepted it on its hosted link. Absent until accepted, and when its provider reported the acceptance.

    • merchant

      You accepted the quote with the API or the Dashboard.

    • customer

      The customer accepted the quote on its hosted link.

  • cancellation_reasonenum

    Why the quote was canceled: expired when it passed expires_at, declined when the customer declined it on its hosted link. Absent when you canceled it yourself, and while it is not canceled.

    • expired

      The quote passed its expires_at while still open.

    • declined

      The customer declined the quote on its hosted link.

  • cancellation_commentstring

    The reason the customer gave when declining the quote on its hosted link. Absent when they gave none.

  • metadataobjectRequired

    Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

  • default_tax_ratesarray of stringsRequired

    IDs 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 stringsRequired

    IDs 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 stringsRequired

    Payment method types the payer may use to pay the invoice created on acceptance. Empty means no restriction.

  • payment_method_providersarray of stringsRequired

    Payment providers the payer may use to pay the invoice created on acceptance. Empty means no restriction.

  • customerobject (customer)NullableExpandable

    The full customer object when you pass expand[]=customer; otherwise absent — use customer_id.

  • default_payment_methodany

    The full payment method object when you pass expand[]=default_payment_method; otherwise absent — use default_payment_method_id.

  • invoicestring | object (invoice)Expandable

    The full invoice object when you pass expand[]=invoice; otherwise absent — use invoice_id.