This endpoint calculates tax for an invoice based on the provided request data. To learn more about how tax is calculated, see the tax calculation guide.
It processes the invoice details and returns calculated tax information, including individual tax items and total tax due.
Raises an HTTPException if there’s an error processing while the request,
translating to a non 200 status code response.
X-Include-Unregistered: true header, this requirement is overridden, and tax will be nonzero in some cases even when unregistered in that jurisdiction.Create calculation request model.
The currency of the transaction. Defaults to USD. The currency must be a valid ISO 4217 currency code.
3"USD"
Amount of discount applied to the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: "100" would be 100 cents or $1.00 in a USD transaction.
"100"
Amount of discount applied to the vendor in the transaction. Most of the time, you should use the discount_amount field instead. Unlike discount_amount, this discount is funded by the vendor and typically does not reduce the taxable base of the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: "100" would be 100 cents or $1.00 in a USD transaction.
"100"
List of line items for an invoice or transaction. Required for sale transactions, optional for credits. A credit transaction without line_items will be assumed to be a full refund of the invoice.
[
{
"customer": {
"address": {
"city": "Anytown",
"line1": "123 Main St",
"postal_code": "12345",
"state": "CA"
},
"tax_ids": [
{
"country": "DE",
"type": "eu_vat",
"value": "DE123456789"
}
]
},
"id": "item_123",
"product": {
"tax_attributes": [
"DIGITAL_PROPERTY.DIGITAL_SOFTWARE._DOWNLOADED"
]
},
"quantity": "1",
"unit_price": "100"
}
]