# How to change tax uid for individual tax item from the squareup dashboard?

**URL:** <https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349>\
**Category:** Questions\
**Tags:** orders-api\
**Created:** [December 3, 2020, 4:21pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349 "2020-12-03T16:21:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 3, 2020, 4:21pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/1 "2020-12-03T16:21:27Z")

</div>

I have various tax added from the dashboard. Each tax has its unique id. But when i fetches the tax data for different ids from the

> [https://connect.squareup.com/v2/catalog/object/{tax\_id}?include\_related\_objects=true](https://connect.squareup.com/v2/catalog/object/%7Btax_id%7D?include_related_objects=true)

api then their uid comes to be same like:

[taxes] =\> Array  
(  
[0] =\> Array  
(  
[uid] =\> us\_sales\_tax  
[name] =\> city  
[percentage] =\> 10.0  
[scope] =\> LINE\_ITEM  
)

```
                [1] => Array
                    (
                        [uid] => us_sales_tax
                        [name] => state
                        [percentage] => 5.0
                        [scope] => LINE_ITEM
                    )

            )

```

and when i apply these tax uid in the catalog items orders api then it is giving me error:

stdClass Object  
(  
[errors] =\> Array  
(  
[0] =\> stdClass Object  
(  
[code] =\> BAD\_REQUEST  
[detail] =\> Duplicate entry key `us_sales_tax`  
[field] =\> order.taxes  
[category] =\> INVALID\_REQUEST\_ERROR  
)

```
    )

```

)

So could you please guide how to change the tax uid from squareup dashboard.

Thanks

---

<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:** [December 3, 2020, 5:49pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/2 "2020-12-03T17:49:38Z")

</div>

I’m a bit confused…it looks like you’re talking about several different things. `uid` in the `CreateOrder` request can be literally anything…it doesn’t belong to the tax, and it’s just so you can interact with the tax in the order request (like assigning it to a specific item). Do you see this `uid` in your actual Catalog?

---

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 3, 2020, 6:02pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/3 "2020-12-03T18:02:50Z")

</div>

Actually the thing is that when i try to add multiple taxes for a particular item like:

if(isset($tax\_id) && count($tax\_id) \> 0) {

```
        foreach($tax_id as $kid => $tid) {

            $tx_id = $tid['id'];

            $curl = curl_init();

            curl_setopt_array($curl, array(
            CURLOPT_URL => "https://connect.squareup.com/v2/catalog/object/$tx_id?include_related_objects=true",
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => "",
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 0,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "GET",
            CURLOPT_HTTPHEADER => array(
                "Square-Version: 2020-05-28",
                "Authorization: Bearer $square_access_token",
                "Content-Type: application/json"
            ),
            ));

            $response = curl_exec($curl);

            curl_close($curl);

            $tax_data = json_decode($response);

            $order_params['order']['taxes'][$kid]['uid'] = $tax_data->object->tax_data->tax_type_id;
            $order_params['order']['taxes'][$kid]['name'] = $tax_data->object->tax_data->name;
            $order_params['order']['taxes'][$kid]['percentage'] = $tax_data->object->tax_data->percentage;
            $order_params['order']['taxes'][$kid]['scope'] = "LINE_ITEM";
            
        }

    }

```

Then it is giving me this error:

stdClass Object  
(  
[errors] =\> Array  
(  
[0] =\> stdClass Object  
(  
[code] =\> BAD\_REQUEST  
[detail] =\> Duplicate entry key `us_sales_tax`  
[field] =\> order.taxes  
[category] =\> INVALID\_REQUEST\_ERROR  
)

```
    )

```

)

So i need to change the tax uid that is coming same in these 2 tax ids

---

<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:** [December 3, 2020, 6:07pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/4 "2020-12-03T18:07:20Z")

</div>

Can you share your application id? I’m still not following. The URL suggests you’re trying to get one single tax id, but the error and “order” suggests you’re trying to create an order. There is no “order” in Catalog, so I’m not sure what this is.

Edit: I do not see a “tax\_type\_id” parameter on a TAX object, so I’m not sure what this is. Again, to reiterate, the “uid” in an order, should be unique and it can be anything you want. It does not need to be equal to some id that the tax object knows about. It can be a random string or whatever, so long as it’s the same everywhere you need to access it in the order. It can be different each time you add it to an order, even.

---

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 3, 2020, 6:32pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/5 "2020-12-03T18:32:57Z")

</div>

This is my request body for creating the order:

Array  
(  
[order] =\> Array  
(  
[taxes] =\> Array  
(  
[0] =\> Array  
(  
[uid] =\> us\_sales\_tax  
[name] =\> city  
[percentage] =\> 10.0  
[scope] =\> LINE\_ITEM  
)

```
                [1] => Array
                    (
                        [uid] => us_sales_tax
                        [name] => state
                        [percentage] => 5.0
                        [scope] => LINE_ITEM
                    )

            )

        [line_items] => Array
            (
                [0] => Array
                    (
                        [catalog_object_id] => AMADT3BZI7K6AO6GOP4PDYWZ
                        [quantity] => 1
                        [applied_taxes] => Array
                            (
                                [0] => Array
                                    (
                                        [tax_uid] => us_sales_tax
                                    )

                            )

                    )

                [1] => Array
                    (
                        [catalog_object_id] => QDVDYZUNMXYQPJ6SJOKTBDRT
                        [quantity] => 1
                    )

            )

        [fulfillments] => Array
            (
                [0] => Array
                    (
                        [type] => PICKUP
                        [state] => PROPOSED
                        [pickup_details] => Array
                            (
                                [recipient] => Array
                                    (
                                        [display_name] => WTF test 7
                                    )

                                [expires_at] => 2020-12-10T07:00:16.100Z
                                [auto_complete_duration] => P0DT6H0S
                                [schedule_type] => SCHEDULED
                                [pickup_at] => 2020-12-03T07:00:16.115Z
                                [note] => 
                            )

                    )

            )

    )

[idempotency_key] => a6c8d3283c2ceac28453632be824e568

```

)

Here you can see [uid] =\> us\_sales\_tax is same for city tax and state tax.

---

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 3, 2020, 6:38pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/6 "2020-12-03T18:38:02Z")

</div>

just want a way where i can change the uid of the tax so that they will not gets duplicated. Please let me know how can i change this.

Thanks

---

<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:** [December 3, 2020, 6:42pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/7 "2020-12-03T18:42:01Z")

</div>

The uid is not set on the Catalog object as I mentioned. The uid is only for the Order. You can literally set it to whatever you want, there is no “changing” it since it’s not saved anywhere. You just need to make each of them unique in the `CreateOrder` request. Please let me know if I misunderstood, or if you have additional questions.

---

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 3, 2020, 6:46pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/8 "2020-12-03T18:46:36Z")

</div>

I am not talking about the uid of Catalog object, i am talking about the uid of the tax items.

(a)  
(  
[uid] =\> us\_sales\_tax  
[name] =\> state  
[percentage] =\> 5.0  
[scope] =\> LINE\_ITEM  
)

(b)  
(  
[uid] =\> us\_sales\_tax  
[name] =\> city  
[percentage] =\> 10.0  
[scope] =\> LINE\_ITEM  
)

Here you can see that uid of both the tax items are us\_sales\_tax that is giving error response from the create order api.

Message: Duplicate entry key `us_sales_tax`

So i need a way to change the uid of the tax.

Thanks

---

<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:** [December 3, 2020, 7:00pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/9 "2020-12-03T19:00:45Z")

</div>

Right…this “uid” is literally just a string. You’re supplying “us\_sales\_tax”, but it can be anything. Change the value in the `CreateOrder` request, and the error will be resolved.

---

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 4, 2020, 5:13am UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/10 "2020-12-04T05:13:14Z")

</div>

Actually i am not supplying the us\_sales\_tax uid it is originally coming from the api response.

API:

> [https://connect.squareup.com/v2/catalog/object/$tx\_id?include\_related\_objects=true](https://connect.squareup.com/v2/catalog/object/$tx_id?include_related_objects=true)

In above api i am passing the tax\_id and it is giving me the uid in response.

If i tend to change the uid the api is giving me error: tax uid does not exists.

So what can i do here?

Thanks

---

<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:** [December 4, 2020, 5:15pm UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/12 "2020-12-04T17:15:34Z")

</div>

You do not need to use the id from the response, as I’ve said above, it can be anything. The uid must match in all places of the order request, or it will say it does not exist. The uid is solely to identify the tax _in the order_. It has no meaning outside of the order.

---

<div class="post-metadata">

**Author:** ![tarun\_wegile\_web](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tarun\_wegile\_web](https://developer.squareup.com/forums/u/tarun_wegile_web)\
**Post date:** [December 9, 2020, 9:43am UTC](https://developer.squareup.com/forums/t/how-to-change-tax-uid-for-individual-tax-item-from-the-squareup-dashboard/1349/13 "2020-12-09T09:43:12Z")

</div>

Thanks for the help, now i am able to calculate multiple taxes on single product items.
