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
Retrieve a Calculation's line items
GET / v1 / tax / calculations /:id / line_items
Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.
Parameters
- ending _ before string A cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list. The maximum length is 500 characters. - limit integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
- starting _ after string A cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list. The maximum length is 500 characters.
Returns
A list of Line Item objects if the Tax calculation is found. Otherwise returns a ‘not found’ error.
Response
