# Get sales tax for location from API

**URL:** <https://developer.squareup.com/forums/t/get-sales-tax-for-location-from-api/1801>\
**Category:** Questions\
**Tags:** locations-api\
**Created:** [February 6, 2021, 3:46pm UTC](https://developer.squareup.com/forums/t/get-sales-tax-for-location-from-api/1801 "2021-02-06T15:46:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 6, 2021, 3:46pm UTC](https://developer.squareup.com/forums/t/get-sales-tax-for-location-from-api/1801/1 "2021-02-06T15:46:42Z")

</div>

I need to get the sales tax for each location. I haven’t found a way to do this through the API. Sales tax is assigned per location in the square dashboard. Is it possible to retrieve sales tax per location via the API?

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [February 8, 2021, 5:38pm UTC](https://developer.squareup.com/forums/t/get-sales-tax-for-location-from-api/1801/2 "2021-02-08T17:38:22Z")

</div>

Taxes are catalog objects, so they can be found using the [Catalog API](https://developer.squareup.com/reference/square/catalog-api). Unfortunately, there’s no way to filter by location explicitly when calling `ListCatalog`, but you’ll be able to see which location each tax belongs to in the response.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 13, 2021, 2:14pm UTC](https://developer.squareup.com/forums/t/get-sales-tax-for-location-from-api/1801/3 "2021-02-13T14:14:59Z")

</div>

Thanks @sjosey.

Here’s the response I got:

```auto
{
  "objects": [
    {
      "type": "TAX",
      "id": "HWTI33ECRV6HNQXTTVJTZF3E",
      "updated_at": "2019-07-01T12:20:54.129Z",
      "version": 1561983654129,
      "is_deleted": false,
      "catalog_v1_ids": [
        {
          "catalog_v1_id": "89E6DD32-EDA1-449C-A464-920DA5593005",
          "location_id": "CJKHHFZX3XJEF"
        }
      ],
      "present_at_all_locations": false,
      "present_at_location_ids": [
        "CJKHHFZX3XJEF",
        "J2XWVZW813V8E"
      ],
      "tax_data": {
        "name": "Sales Tax (DC)",
        "calculation_phase": "TAX_SUBTOTAL_PHASE",
        "inclusion_type": "ADDITIVE",
        "percentage": "10.0",
        "applies_to_custom_amounts": true,
        "enabled": true,
        "tax_type_id": "us_sales_tax",
        "tax_type_name": "Sales Tax"
      }
    },
    {
      "type": "TAX",
      "id": "XV4E4UTJCS2IYC6FYKRTPOK6",
      "updated_at": "2019-07-01T12:21:00.774Z",
      "version": 1561983660774,
      "is_deleted": false,
      "present_at_all_locations": true,
      "absent_at_location_ids": [
        "CJKHHFZX3XJEF",
        "J2XWVZW813V8E"
      ],
      "tax_data": {
        "name": "Sales Tax (MD)",
        "calculation_phase": "TAX_SUBTOTAL_PHASE",
        "inclusion_type": "ADDITIVE",
        "percentage": "6.0",
        "applies_to_custom_amounts": true,
        "enabled": true,
        "tax_type_id": "us_sales_tax",
        "tax_type_name": "Sales Tax"
      }
    }
  ]
}

```

This shape would make it hard to find the taxes at all of the locations because when `present_at_all_locations` is true, the location ids are located under a `present_at_location_ids` property, but when it’s false, they’re under a `absent_at_location_ids` property. This seems to be because one of the taxes has “Available at all future locations” selected in the dashboard, and the other one doesn’t. I’m not clear on what selecting this option in the dashboard actually does, because the tax that does NOT have “Available at all future locations” selected still seems to be available at the other locations anyway. Can you let me know how this should work? It seems to me that it would be best to have the same option selected for all taxes, otherwise it will be difficult to parse the response.

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [February 15, 2021, 11:02pm UTC](https://developer.squareup.com/forums/t/get-sales-tax-for-location-from-api/1801/4 "2021-02-15T23:02:36Z")

</div>

Most likely the `XV4E4UTJCS2IYC6FYKRTPOK6` was created with all locations checked (which makes `present_at_all_locations==true`, and later unchecked at locations `CJKHHFZX3XJEF` and `J2XWVZW813V8E`. “Available at all future locations” implies when you create a new location it will automatically be enabled. If you want to make them the same, you could update them via the API and change one to true/false, depending on your preference, and then add/remove the `present_...` or `absent_...` attributes.
