The Tax Calculation object
Attributes
- id nullable string Unique identifier for the calculation.
- object string, value is "tax.calculation" String representing the object’s type. Objects of the same type share the same value.
- amount _ total integer Total amount after taxes in the smallest currency unit.
- currency string Three-letter ISO currency code, in lowercase. Must be a supported currency.
- customer _ details object The customer’s details, such as address and tax IDs.
- expires _ at nullable timestamp Timestamp of date at which the tax calculation will expire.
- line _ items nullable object Includable The list of items the customer is purchasing.
- shipping _ cost nullable object The shipping cost details for the calculation.
- tax _ amount _ exclusive integer The amount of tax to be collected on top of the line item prices.
- tax _ amount _ inclusive integer The amount of tax already included in the line item prices.
- tax _ breakdown array of objects Breakdown of individual tax amounts that add up to the total.
More attributes
- customer nullable string
- livemode boolean
- ship _ from _ details nullable object
- tax _ date timestamp
The Tax Calculation object
Create a Calculation
POST / v1 / tax / calculations
Calculates tax based on the input and returns a Tax Calculation object.
Parameters
- currency enum Required Three-letter ISO currency code, in lowercase. Must be a supported currency.
- line _ items array of objects Required A list of items the customer is purchasing. You can pass up to 100 line items, or 1,000 if your account has an increased limit.
- customer _ details object Required unless customer provided Details about the customer, including address and tax IDs.
- shipping _ cost object Shipping cost details to be used for the calculation.
More parameters
- customer string Required unless customer_details provided
- ship _ from _ details object
- tax _ date integer
Returns
A Tax Calculation object containing the first 100 input line_items if the calculation succeeds. Otherwise, an error (for example, indicating that the customer address was invalid).
Response
Retrieve a Calculation
GET / v1 / tax / calculations /:id
Retrieves a Tax Calculation object, if the calculation hasn’t expired.
Parameters
No parameters.
Returns
A Tax Calculation object if the Tax calculation is found. Otherwise returns a ‘not found’ error.
Response
