Create a tax quote
/tax_quotesCreates a tax quote for a set of line items. The quote can later be referenced
from a charge or hold via tax_options.tax_quote. The merchant must have a default
tax configuration and a connected Stripe account.
Headers
AuthorizationstringRequiredidempotency-keystringA unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.
- A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
- If the first request is still being processed, a retry gets 409
idempotency_error(request_in_progress). - The same key on another endpoint, or with another body, gets 400
idempotency_error(invalid_parameters). - GET, PUT and PATCH requests ignore the key.
The response repeats the key in its Idempotency-Key header.
Parameters
currencystringRequiredThree-letter ISO currency code, in lowercase.
customerstringUnique identifier of an existing Customer. Mutually exclusive with customer_details. The customer's address (or shipping address) is used; it must have a country, and a US address also needs state and postal_code.
customer_detailsobjectInline customer details. Mutually exclusive with customer.
Send exactly one of address or ip_address. address_source is required with address and not allowed without it. A US address also needs state and postal_code.
Show 4 child parametersHide child parameters
addressobjectAddress details.
Show 6 child parametersHide child parameters
citystringCity, district, suburb, town, or village.
countrystringTwo-letter country code (ISO 3166-1 alpha-2).
line1stringAddress line 1 (for example, street, PO Box, or company name).
line2string or nullAddress line 2 (for example, apartment, suite, unit, or building). Responses return null when not set.
postal_codestringZIP or postal code.
statestring or nullState, county, province, or region. Null is accepted and returned when not set.
address_sourcestringType of the customer address provided. One of shipping or billing. Required when address is sent, and not allowed otherwise.
ip_addressstringThe customer's IP address (IPv4 or IPv6). Used to locate the customer when no address is sent.
tax_idsarray of objectsThe customer's tax identifiers.
Show 2 child parametersHide child parameters
typestringRequiredType of the tax identifier. One of eu_vat, gb_vat, us_ein, ca_gst_hst, ca_bn, au_abn, in_gst, or pl_nip.
valuestringRequiredValue of the tax identifier.
customer_reference_idstringYour unique identifier for the customer.
line_itemsarray of objectsRequiredLine items to be taxed.
Show 6 child parametersHide child parameters
amountintegerRequiredAmount of the line item, in the smallest currency unit.
quantityintegerQuantity of the line item.
productstringFree-form identifier of the product.
referencestringYour reference for the line item. Optional, but recommended.
tax_behaviorstringWhether the amount is exclusive or inclusive of tax. One of exclusive or inclusive. Defaults to exclusive.
tax_codestringProvider tax code, starting with txcd_. Falls back to the merchant's default tax configuration when omitted.
ship_from_detailsobjectDetails about the address the goods are shipped from.
Show 1 child parameterHide child parameters
addressobjectRequiredAddress details.
Show 6 child parametersHide child parameters
citystringCity, district, suburb, town, or village.
countrystringTwo-letter country code (ISO 3166-1 alpha-2).
line1stringAddress line 1 (for example, street, PO Box, or company name).
line2string or nullAddress line 2 (for example, apartment, suite, unit, or building). Responses return null when not set.
postal_codestringZIP or postal code.
statestring or nullState, county, province, or region. Null is accepted and returned when not set.
shipping_costobjectShipping cost supplied for tax calculation.
Show 3 child parametersHide child parameters
amountintegerRequiredShipping amount, in the smallest currency unit.
tax_behaviorstringWhether the shipping amount is exclusive or inclusive of tax. One of exclusive or inclusive.
tax_codestringProvider tax code, starting with txcd_.
tax_datestringTime at which to calculate tax, in ISO 8601 format. Must be within ±48 hours of the current time.
Returns
Returns the created tax quote object.
idstringUnique identifier for the tax quote.
resourcestringString representing the object's type.
amount_totalintegerTotal amount including tax, in the smallest currency unit.
amount_total_human_readablestringTotal amount including tax, in human-readable format.
tax_amount_exclusiveintegerTax that is added on top of the line item amounts, in the smallest currency unit.
tax_amount_inclusiveintegerTax already included in the line item amounts, in the smallest currency unit.
currencystringThree-letter ISO currency code, in lowercase.
customerstring or nullUnique identifier of the Customer this quote belongs to, if applicable.
Show 10 more attributesShow fewer attributes
customer_reference_idstring or nullYour unique identifier for the customer, if applicable.
customer_detailsobjectCustomer details used to calculate tax.
Show 4 child attributesHide child attributes
addressobject or nullAddress used for the tax calculation, if applicable.
Show 6 child attributesHide child attributes
line1string or nullAddress line 1, such as the street, PO Box, or company name.
line2string or nullAddress line 2, such as the apartment, suite, unit, or building.
citystring or nullCity, district, suburb, town, or village.
statestring or nullState, county, province, or region.
postal_codestring or nullZIP or postal code.
countrystring or nullTwo-letter country code (ISO 3166-1 alpha-2).
address_sourcestring or nullType of the customer address provided. One of shipping or billing, if applicable.
ip_addressstring or nullThe customer's IP address, if applicable.
tax_idsarray of objectsThe customer's tax identifiers.
Show 2 child attributesHide child attributes
typestringRequiredType of the tax identifier. One of eu_vat, gb_vat, us_ein, ca_gst_hst, ca_bn, au_abn, in_gst, or pl_nip.
valuestringRequiredValue of the tax identifier.
ship_from_detailsobject or nullDetails about the address the goods are shipped from, if applicable.
Show 1 child attributeHide child attributes
addressobject or nullAddress used for the tax calculation, if applicable.
Show 6 child attributesHide child attributes
line1string or nullAddress line 1, such as the street, PO Box, or company name.
line2string or nullAddress line 2, such as the apartment, suite, unit, or building.
citystring or nullCity, district, suburb, town, or village.
statestring or nullState, county, province, or region.
postal_codestring or nullZIP or postal code.
countrystring or nullTwo-letter country code (ISO 3166-1 alpha-2).
shipping_costobject or nullShipping cost details, including the tax applied to shipping, if applicable.
Show 5 child attributesHide child attributes
amountintegerShipping amount, in the smallest currency unit.
tax_amountinteger or nullTax applied to the shipping cost, in the smallest currency unit.
tax_behaviorstring or nullWhether the shipping amount is exclusive or inclusive of tax. One of exclusive or inclusive.
tax_codestring or nullProvider tax code (txcd_*) applied to the shipping cost, if applicable.
tax_breakdownarray of objectsBreakdown of the shipping tax by jurisdiction.
Show 5 child attributesHide child attributes
amountstringTax amount, in the smallest currency unit, as a numeric string.
inclusivebooleanWhether the tax is inclusive of the taxable amount.
taxable_amountstringAmount on which the tax was applied, in the smallest currency unit, as a numeric string.
tax_rate_detailsobject or nullDetails about the applied tax rate, if available.
Show 6 child attributesHide child attributes
countrystring or nullTwo-letter country code (ISO 3166-1 alpha-2).
statestring or nullState, province, or region, if applicable.
tax_typestring or nullProvider-specific tax type, such as vat or sales_tax.
rate_typestring or nullType of the tax rate. One of percentage or flat_amount.
percentage_decimalstring or nullTax rate as a decimal percentage string, if applicable.
flat_amountobject or nullFlat tax amount, if rate_type is flat_amount.
Show 2 child attributesHide child attributes
amountstringFlat tax amount, in the smallest currency unit, as a numeric string.
currencystringThree-letter ISO currency code, in lowercase.
taxability_reasonstring or nullReason the amount is taxable or not, as reported by the tax provider, if applicable.
tax_breakdownarray of objectsBreakdown of the tax amount by jurisdiction.
Show 5 child attributesHide child attributes
amountstringTax amount, in the smallest currency unit, as a numeric string.
inclusivebooleanWhether the tax is inclusive of the taxable amount.
taxable_amountstringAmount on which the tax was applied, in the smallest currency unit, as a numeric string.
tax_rate_detailsobject or nullDetails about the applied tax rate, if available.
Show 6 child attributesHide child attributes
countrystring or nullTwo-letter country code (ISO 3166-1 alpha-2).
statestring or nullState, province, or region, if applicable.
tax_typestring or nullProvider-specific tax type, such as vat or sales_tax.
rate_typestring or nullType of the tax rate. One of percentage or flat_amount.
percentage_decimalstring or nullTax rate as a decimal percentage string, if applicable.
flat_amountobject or nullFlat tax amount, if rate_type is flat_amount.
Show 2 child attributesHide child attributes
amountstringFlat tax amount, in the smallest currency unit, as a numeric string.
currencystringThree-letter ISO currency code, in lowercase.
taxability_reasonstring or nullReason the amount is taxable or not, as reported by the tax provider, if applicable.
tax_datestring or nullTime at which tax was calculated, in ISO 8601 format.
expiresstring or nullTime at which the quote expires, in ISO 8601 format.
test_modebooleanWhether the tax quote was created in the sandbox.
createdstringTime at which the object was created, in ISO 8601 format.
line_itemsarray of objectsComputed line items, including tax amounts.
Show 11 child attributesHide child attributes
idstringUnique identifier for the line item.
resourcestringString representing the object's type.
amountintegerLine item amount, in the smallest currency unit.
quantityintegerQuantity of the line item.
referencestring or nullYour reference for the line item, if applicable.
productstring or nullFree-form product identifier, if applicable.
tax_amountinteger or nullTax applied to the line item, in the smallest currency unit.
tax_behaviorstring or nullWhether the line item amount is exclusive or inclusive of tax. One of exclusive or inclusive.
tax_codestring or nullProvider tax code (txcd_*) applied to the line item, if applicable.
taxability_reasonstring or nullReason the line item is taxable or not, as reported by the tax provider, if applicable.
tax_breakdownarray of objectsBreakdown of the line item's tax by jurisdiction.
Show 5 child attributesHide child attributes
amountstringTax amount, in the smallest currency unit, as a numeric string.
inclusivebooleanWhether the tax is inclusive of the taxable amount.
taxable_amountstringAmount on which the tax was applied, in the smallest currency unit, as a numeric string.
tax_rate_detailsobject or nullDetails about the applied tax rate, if available.
Show 6 child attributesHide child attributes
countrystring or nullTwo-letter country code (ISO 3166-1 alpha-2).
statestring or nullState, province, or region, if applicable.
tax_typestring or nullProvider-specific tax type, such as vat or sales_tax.
rate_typestring or nullType of the tax rate. One of percentage or flat_amount.
percentage_decimalstring or nullTax rate as a decimal percentage string, if applicable.
flat_amountobject or nullFlat tax amount, if rate_type is flat_amount.
Show 2 child attributesHide child attributes
amountstringFlat tax amount, in the smallest currency unit, as a numeric string.
currencystringThree-letter ISO currency code, in lowercase.
taxability_reasonstring or nullReason the amount is taxable or not, as reported by the tax provider, if applicable.
Errors
400tax_configuration_required: your account has no default tax configuration.
- stripe_connection_required: your account has no connected Stripe account.
- customer_address_required: the customer has no usable address; send customer_details instead.401invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).403code says why.404customer_not_found).409idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.500503Retry-After, or after a few seconds when there's none.