Skip to content

Expand Tax Provider API to include customs information, duties #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions reference/tax_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ paths:
class_id: '0'
name: Default Tax Class
tax_exempt: false
customs_information:
country_of_origin: 'AU'
hs_code: '817355'
type: item
wrapping:
id: d2675662-6326-4a23-9107-ab71fa6a21a1
Expand Down Expand Up @@ -254,6 +257,9 @@ paths:
name: Brutal Tax
code: US
id: Brutal Tax
duties:
- name: Brutal Duty
amount: 50
Copy link
Contributor Author

@theromulans theromulans May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another topic that is up for exploration is whether or not an item can ever have more than one custom duty associated - and, if not, whether this is likely to change in the future.

Avalara has advised that they do not support more than one duty per item.

Further exploration outside of Avalara is warranted, with a global platform mindset. Although, a flexible model could still be suitable even if it's only anticipated that one duty is required.

One related consideration here is if duties are provided via another source (e.g. a BigCommerce "basic duties" or a Shipping provider solution) then that might imply a duty is actually a new type of ItemRequest alongside fee, wanting a tax estimate as any other item.

type: item
wrapping:
id: d2675662-6326-4a23-9107-ab71fa6a21a1
Expand Down Expand Up @@ -942,6 +948,18 @@ components:
description: Merchants may opt to include additional properties that a tax provider can choose to support, factoring these values into tax calculation.
items:
$ref: '#/components/schemas/request-item-tax-property'
customs_information:
type: object
description: Merchants may opt to include customs information data in the quote request allowing tax providers to supply calculated duties in addition to taxes. See [Customs Information API](/docs/rest-management/shipping/customs-information) for more information on configuring customs information.
properties:
country_of_origin:
type: string
description: The country of manufacture, production, or growth represented in ISO 3166-1 alpha-2 format, when available.
example: 'AU'
hs_code:
type: string
description: The item's harmonized tariff code for the document's destination country, when available.
example: '817355'
required:
- id
- price
Expand Down Expand Up @@ -1227,16 +1245,21 @@ components:
response-item:
type: object
description: |-
The tax liabilities calculated for a specific item.
The tax liabilities, and any duties, calculated for a specific item.

Note: Tax liabilities should be calculated with **quantity** accounted for.
Note: Tax liabilities and duties should be calculated with the item's **quantity** accounted for.
title: Item
properties:
id:
type: string
description: A unique identifier for the line item these tax liabilities are calculated for. Must match the corresponding request line item ID.
price:
$ref: '#/components/schemas/response-taxprice'
duties:
type: array
description: Any duties that applied to this item.
items:
$ref: '#/components/schemas/CustomDuty'
required:
- id
- price
Expand Down Expand Up @@ -1301,6 +1324,19 @@ components:
- rate
- amount
x-internal: false
CustomDuty:
type: object
properties:
name:
type: string
description: The human-readable name of this custom duty. May not be empty.
amount:
type: number
format: double
description: The absolute amount that the shopper will be charged for this custom duty.
required:
- name
- amount
item_type:
type: string
description: |-
Expand Down