# Assigning Individual Tax Ids to the Line items in the Orders API

**URL:** <https://developer.squareup.com/forums/t/assigning-individual-tax-ids-to-the-line-items-in-the-orders-api/1093>\
**Category:** Questions\
**Tags:** orders-api\
**Created:** [October 20, 2020, 2:27pm UTC](https://developer.squareup.com/forums/t/assigning-individual-tax-ids-to-the-line-items-in-the-orders-api/1093 "2020-10-20T14:27:12Z")\
**Posts on this page:** 4\
**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:** [October 20, 2020, 2:27pm UTC](https://developer.squareup.com/forums/t/assigning-individual-tax-ids-to-the-line-items-in-the-orders-api/1093/1 "2020-10-20T14:27:12Z")

</div>

Actually when we are setting the individual tax ids to the line items in the ORDERS api:

> [https://connect.squareupsandbox.com/v2/locations/{location\_id}/orders](https://connect.squareupsandbox.com/v2/locations/%7Blocation_id%7D/orders)

we are setting the applied\_taxes parameters and then setting the uid of the tax. But when we submit the api it is saying us:

> stdClass Object  
> (  
> [errors] =\> Array  
> (  
> [0] =\> stdClass Object  
> (

```
                [code] => VALUE_EMPTY
                [detail] => Field must not be blank
                [field] => order.line_items[0].applied_taxes[0].tax_uid
                [category] => INVALID_REQUEST_ERROR
            )

    )

```

)

But in the api documentation it is asking to fill uid not the tax\_uid.

Moreover when we fetches the tax data it is coming like this:

> stdClass Object  
> (  
> [object] =\> stdClass Object  
> (  
> [type] =\> TAX  
> [id] =\> EHXLVURA6ETOI7HH6IZLW6IM  
> [updated\_at] =\> 2020-10-20T10:55:02.256Z  
> [version] =\> 1603191302256  
> [is\_deleted] =\>  
> [present\_at\_all\_locations] =\> 1  
> [tax\_data] =\> stdClass Object  
> (  
> [name] =\> First Tax  
> [calculation\_phase] =\> TAX\_SUBTOTAL\_PHASE  
> [inclusion\_type] =\> INCLUSIVE  
> [percentage] =\> 1.0  
> [applies\_to\_custom\_amounts] =\>  
> [enabled] =\> 1  
> [tax\_type\_id] =\> us\_sales\_tax  
> [tax\_type\_name] =\> Sales Tax  
> )

```
    )

```

)

Could you please let us know what we need to fill in the applied\_taxes object uid or tax\_uid and could you please let us know how to get this ids from the tax data?

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:** [October 20, 2020, 4:33pm UTC](https://developer.squareup.com/forums/t/assigning-individual-tax-ids-to-the-line-items-in-the-orders-api/1093/2 "2020-10-20T16:33:36Z")

</div>

It should be `tax_uid` (in the tech ref it’s marked as “REQUIRED”). Can you share where in the docs it says to use `uid` instead? Also, these are just string values, it can be anything as long as it matches the root level and item level. They are _not_ the actual tax object’s ids.

---

<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:** [October 21, 2020, 6:21am UTC](https://developer.squareup.com/forums/t/assigning-individual-tax-ids-to-the-line-items-in-the-orders-api/1093/3 "2020-10-21T06:21:26Z")

</div>

Please check the below screenshot that contains the create orders api documentation that have applied\_taxes parameter:

 ![Screenshot 2020-10-21 at 11.00.52 AM](https://global.discourse-cdn.com/square/original/1X/6a6880d6fa3f37e22c8cc7f3c9ccf45979b02c2b.png)

If we add some arbitrary tax\_uid then we are getting the following error:

> There is no tax on this order with uid `us_sales_tax`.

stdClass Object  
(  
[errors] =\> Array  
(  
[0] =\> stdClass Object  
(  
[code] =\> BAD\_REQUEST  
[detail] =\> There is no tax on this order with uid `us_sales_tax`.  
[field] =\> order.line\_items[0].applied\_taxes[0].tax\_uid  
[category] =\> INVALID\_REQUEST\_ERROR  
)

```
    )

```

)

Please let us know how to get the tax\_uid from the tax data.

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:** [October 21, 2020, 4:22pm UTC](https://developer.squareup.com/forums/t/assigning-individual-tax-ids-to-the-line-items-in-the-orders-api/1093/4 "2020-10-21T16:22:02Z")

</div>

Sorry for the confusion. So, `tax_uid` needs to match a root level `taxes->uid`. See below for example:

```auto
  "idempotency_key": "{{$guid}}",
  "order": {
    "line_items": [
        {
            "name": "Steak",
            "quantity": "1",
            "variation_name": "Rare Steak",
            "base_price_money": {
                "amount": 1,
                "currency": "USD"
            },
            "applied_taxes": [
                {
                    "tax_uid": "test_tax_uid"
                }
            ]
        }
    ],
    "taxes": [{
        "name": "Test Tax",
        "percentage": "5",
        "scope": "LINE_ITEM",
        "uid": "test_tax_uid"
    }]
  }
}

```

See `test_tax_uid` and how it matches. It’s just how you reference it so you can use it.
