Hello,
I am experiencing an issue with the automatic calculation of sales tax for different states using Square’s API. Here are the details of my setup and the problem I am facing:
Setup:
- I have an online store based in the United States.
- I am using the Square API to create orders and generate payment links.
- I am setting the
auto_apply_taxes
field totrue
in my order creation request. - I am including the customer’s shipping address with different ZIP codes for different states in the
fulfillments
section of the order.
Issue:
Despite including different shipping addresses and ZIP codes, Square is calculating the same sales tax for orders in different states. For example, an order shipped to California (ZIP code 94103) and an order shipped to New York (ZIP code 10001) both show the same sales tax amount.
Steps Taken:
- Verified that the shipping address, including
postal_code
,locality
,administrative_district_level_1
, andcountry
, is correctly passed in the order creation request. - Checked the Square Dashboard to ensure that tax settings are configured correctly and the
Auto-Apply Taxes
option is enabled. - Tested with multiple addresses from different states to ensure the issue is consistent.
- Confirmed that no errors are returned in the API responses for both order creation and payment link generation.
Example Order Creation Request:
$response = $client->request('POST', '/v2/orders', [
'json' => [
'order' => [
'location_id' => 'YOUR_LOCATION_ID',
'line_items' => [
[
'name' => 'Sample Item',
'quantity' => '1',
'base_price_money' => [
'amount' => 1000, // Price in cents
'currency' => 'USD'
]
]
],
'auto_apply_taxes' => true,
'fulfillments' => [
[
'type' => 'SHIPMENT',
'shipment_details' => [
'recipient' => [
'address' => [
'address_line_1' => '123 Main St',
'locality' => 'San Francisco',
'administrative_district_level_1' => 'CA',
'postal_code' => '94103',
'country' => 'US'
],
'display_name' => 'John Doe',
'phone_number' => '1234567890',
'email_address' => '[email protected]'
]
]
]
]
]
]
]);
$order = json_decode($response->getBody(), true);
$orderId = $order['order']['id'];
Questions:
- Is there a specific configuration or additional steps required to ensure that sales tax is calculated correctly based on the customer’s shipping address?
- Are there any known issues or limitations with the
auto_apply_taxes
feature in the Square API? - What can I do to troubleshoot this issue further and ensure accurate tax calculation for different states?
Any assistance or guidance on resolving this issue would be greatly appreciated.
Thank you!