Skip to Content
Docs
Tax quotes

Create a tax quote

POST/tax_quotes

Creates 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

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A 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

currencystringRequired

Three-letter ISO currency code, in lowercase.

customerstring

Unique 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_detailsobject

Inline 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
addressobject

Address details.

Show 6 child parametersHide child parameters
citystring

City, district, suburb, town, or village.

countrystring

Two-letter country code (ISO 3166-1 alpha-2).

line1string

Address line 1 (for example, street, PO Box, or company name).

line2string or null

Address line 2 (for example, apartment, suite, unit, or building). Responses return null when not set.

postal_codestring

ZIP or postal code.

statestring or null

State, county, province, or region. Null is accepted and returned when not set.

address_sourcestring

Type of the customer address provided. One of shipping or billing. Required when address is sent, and not allowed otherwise.

One of shipping or billing.

ip_addressstring

The customer's IP address (IPv4 or IPv6). Used to locate the customer when no address is sent.

tax_idsarray of objects

The customer's tax identifiers.

Show 2 child parametersHide child parameters
typestringRequired

Type of the tax identifier. One of eu_vat, gb_vat, us_ein, ca_gst_hst, ca_bn, au_abn, in_gst, or pl_nip.

One of eu_vat, gb_vat, us_ein, ca_gst_hst, ca_bn, au_abn, in_gst or pl_nip.

valuestringRequired

Value of the tax identifier.

customer_reference_idstring

Your unique identifier for the customer.

line_itemsarray of objectsRequired

Line items to be taxed.

Show 6 child parametersHide child parameters
amountintegerRequired

Amount of the line item, in the smallest currency unit.

quantityinteger

Quantity of the line item.

Default: 1

productstring

Free-form identifier of the product.

referencestring

Your reference for the line item. Optional, but recommended.

tax_behaviorstring

Whether the amount is exclusive or inclusive of tax. One of exclusive or inclusive. Defaults to exclusive.

One of exclusive or inclusive.

Default: exclusive

tax_codestring

Provider tax code, starting with txcd_. Falls back to the merchant's default tax configuration when omitted.

ship_from_detailsobject

Details about the address the goods are shipped from.

Show 1 child parameterHide child parameters
addressobjectRequired

Address details.

Show 6 child parametersHide child parameters
citystring

City, district, suburb, town, or village.

countrystring

Two-letter country code (ISO 3166-1 alpha-2).

line1string

Address line 1 (for example, street, PO Box, or company name).

line2string or null

Address line 2 (for example, apartment, suite, unit, or building). Responses return null when not set.

postal_codestring

ZIP or postal code.

statestring or null

State, county, province, or region. Null is accepted and returned when not set.

shipping_costobject

Shipping cost supplied for tax calculation.

Show 3 child parametersHide child parameters
amountintegerRequired

Shipping amount, in the smallest currency unit.

tax_behaviorstring

Whether the shipping amount is exclusive or inclusive of tax. One of exclusive or inclusive.

One of exclusive or inclusive.

Default: exclusive

tax_codestring

Provider tax code, starting with txcd_.

tax_datestring

Time 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.

idstring

Unique identifier for the tax quote.

resourcestring

String representing the object's type.

One of tax_quote.

amount_totalinteger

Total amount including tax, in the smallest currency unit.

amount_total_human_readablestring

Total amount including tax, in human-readable format.

tax_amount_exclusiveinteger

Tax that is added on top of the line item amounts, in the smallest currency unit.

tax_amount_inclusiveinteger

Tax already included in the line item amounts, in the smallest currency unit.

currencystring

Three-letter ISO currency code, in lowercase.

customerstring or null

Unique identifier of the Customer this quote belongs to, if applicable.

Show 10 more attributesShow fewer attributes
customer_reference_idstring or null

Your unique identifier for the customer, if applicable.

customer_detailsobject

Customer details used to calculate tax.

Show 4 child attributesHide child attributes
addressobject or null

Address used for the tax calculation, if applicable.

Show 6 child attributesHide child attributes
line1string or null

Address line 1, such as the street, PO Box, or company name.

line2string or null

Address line 2, such as the apartment, suite, unit, or building.

citystring or null

City, district, suburb, town, or village.

statestring or null

State, county, province, or region.

postal_codestring or null

ZIP or postal code.

countrystring or null

Two-letter country code (ISO 3166-1 alpha-2).

address_sourcestring or null

Type of the customer address provided. One of shipping or billing, if applicable.

One of shipping or billing.

ip_addressstring or null

The customer's IP address, if applicable.

tax_idsarray of objects

The customer's tax identifiers.

Show 2 child attributesHide child attributes
typestringRequired

Type of the tax identifier. One of eu_vat, gb_vat, us_ein, ca_gst_hst, ca_bn, au_abn, in_gst, or pl_nip.

One of eu_vat, gb_vat, us_ein, ca_gst_hst, ca_bn, au_abn, in_gst or pl_nip.

valuestringRequired

Value of the tax identifier.

ship_from_detailsobject or null

Details about the address the goods are shipped from, if applicable.

Show 1 child attributeHide child attributes
addressobject or null

Address used for the tax calculation, if applicable.

Show 6 child attributesHide child attributes
line1string or null

Address line 1, such as the street, PO Box, or company name.

line2string or null

Address line 2, such as the apartment, suite, unit, or building.

citystring or null

City, district, suburb, town, or village.

statestring or null

State, county, province, or region.

postal_codestring or null

ZIP or postal code.

countrystring or null

Two-letter country code (ISO 3166-1 alpha-2).

shipping_costobject or null

Shipping cost details, including the tax applied to shipping, if applicable.

Show 5 child attributesHide child attributes
amountinteger

Shipping amount, in the smallest currency unit.

tax_amountinteger or null

Tax applied to the shipping cost, in the smallest currency unit.

tax_behaviorstring or null

Whether the shipping amount is exclusive or inclusive of tax. One of exclusive or inclusive.

One of exclusive or inclusive.

tax_codestring or null

Provider tax code (txcd_*) applied to the shipping cost, if applicable.

tax_breakdownarray of objects

Breakdown of the shipping tax by jurisdiction.

Show 5 child attributesHide child attributes
amountstring

Tax amount, in the smallest currency unit, as a numeric string.

inclusiveboolean

Whether the tax is inclusive of the taxable amount.

taxable_amountstring

Amount on which the tax was applied, in the smallest currency unit, as a numeric string.

tax_rate_detailsobject or null

Details about the applied tax rate, if available.

Show 6 child attributesHide child attributes
countrystring or null

Two-letter country code (ISO 3166-1 alpha-2).

statestring or null

State, province, or region, if applicable.

tax_typestring or null

Provider-specific tax type, such as vat or sales_tax.

rate_typestring or null

Type of the tax rate. One of percentage or flat_amount.

One of percentage or flat_amount.

percentage_decimalstring or null

Tax rate as a decimal percentage string, if applicable.

flat_amountobject or null

Flat tax amount, if rate_type is flat_amount.

Show 2 child attributesHide child attributes
amountstring

Flat tax amount, in the smallest currency unit, as a numeric string.

currencystring

Three-letter ISO currency code, in lowercase.

taxability_reasonstring or null

Reason the amount is taxable or not, as reported by the tax provider, if applicable.

tax_breakdownarray of objects

Breakdown of the tax amount by jurisdiction.

Show 5 child attributesHide child attributes
amountstring

Tax amount, in the smallest currency unit, as a numeric string.

inclusiveboolean

Whether the tax is inclusive of the taxable amount.

taxable_amountstring

Amount on which the tax was applied, in the smallest currency unit, as a numeric string.

tax_rate_detailsobject or null

Details about the applied tax rate, if available.

Show 6 child attributesHide child attributes
countrystring or null

Two-letter country code (ISO 3166-1 alpha-2).

statestring or null

State, province, or region, if applicable.

tax_typestring or null

Provider-specific tax type, such as vat or sales_tax.

rate_typestring or null

Type of the tax rate. One of percentage or flat_amount.

One of percentage or flat_amount.

percentage_decimalstring or null

Tax rate as a decimal percentage string, if applicable.

flat_amountobject or null

Flat tax amount, if rate_type is flat_amount.

Show 2 child attributesHide child attributes
amountstring

Flat tax amount, in the smallest currency unit, as a numeric string.

currencystring

Three-letter ISO currency code, in lowercase.

taxability_reasonstring or null

Reason the amount is taxable or not, as reported by the tax provider, if applicable.

tax_datestring or null

Time at which tax was calculated, in ISO 8601 format.

expiresstring or null

Time at which the quote expires, in ISO 8601 format.

test_modeboolean

Whether the tax quote was created in the sandbox.

createdstring

Time at which the object was created, in ISO 8601 format.

line_itemsarray of objects

Computed line items, including tax amounts.

Show 11 child attributesHide child attributes
idstring

Unique identifier for the line item.

resourcestring

String representing the object's type.

One of tax_quote_line_item.

amountinteger

Line item amount, in the smallest currency unit.

quantityinteger

Quantity of the line item.

referencestring or null

Your reference for the line item, if applicable.

productstring or null

Free-form product identifier, if applicable.

tax_amountinteger or null

Tax applied to the line item, in the smallest currency unit.

tax_behaviorstring or null

Whether the line item amount is exclusive or inclusive of tax. One of exclusive or inclusive.

One of exclusive or inclusive.

tax_codestring or null

Provider tax code (txcd_*) applied to the line item, if applicable.

taxability_reasonstring or null

Reason the line item is taxable or not, as reported by the tax provider, if applicable.

tax_breakdownarray of objects

Breakdown of the line item's tax by jurisdiction.

Show 5 child attributesHide child attributes
amountstring

Tax amount, in the smallest currency unit, as a numeric string.

inclusiveboolean

Whether the tax is inclusive of the taxable amount.

taxable_amountstring

Amount on which the tax was applied, in the smallest currency unit, as a numeric string.

tax_rate_detailsobject or null

Details about the applied tax rate, if available.

Show 6 child attributesHide child attributes
countrystring or null

Two-letter country code (ISO 3166-1 alpha-2).

statestring or null

State, province, or region, if applicable.

tax_typestring or null

Provider-specific tax type, such as vat or sales_tax.

rate_typestring or null

Type of the tax rate. One of percentage or flat_amount.

One of percentage or flat_amount.

percentage_decimalstring or null

Tax rate as a decimal percentage string, if applicable.

flat_amountobject or null

Flat tax amount, if rate_type is flat_amount.

Show 2 child attributesHide child attributes
amountstring

Flat tax amount, in the smallest currency unit, as a numeric string.

currencystring

Three-letter ISO currency code, in lowercase.

taxability_reasonstring or null

Reason the amount is taxable or not, as reported by the tax provider, if applicable.

Errors

400
Invalid request parameters, or one of these errors: - tax_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.
401
The API key or access token is missing, unknown or no longer works (invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).
403
Tax quotes are not enabled for your account or API key. A 403 can also mean the key may not make this request; code says why.
404
Customer not found (customer_not_found).
409
Another request with the same idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.
500
Internal server error.
503
Service unavailable. Retry after the number of seconds in Retry-After, or after a few seconds when there's none.
Was this page helpful?