question

TRiV avatar image
TRiV asked ·

Set Tax Rate for line item using REST API

Hello!
I have a problem with a setting up tax rate for line item.

Request:
https://apisandbox.dev.clover.com/v3/merchants/{mid}/orders/{oid}/bulk_line_items
{
  "items": [
    {
      "id": null,
      "item": {
        "id": "RAEKCNN82JVFC"
      },
      "itemCode": "code",
      "name": "item name",
      "price": 30000,
      "taxRates": {
        "elements": [
          {
            "name": "MY Tax Rate",
            "rate": 5000
          }
        ]
      }
    }
  ]
}

Response:
{
  "details": "Referenced tax rate does not exist: null",
  "message": "Not Found"
}
The idea to use custom tax rate for line item. Where is my mistake?
REST APITaxes
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Bryanne Vega avatar image
Bryanne Vega answered ·
Is the tax rate variable per item? Or is it a fixed amount?

If it's fixed (eg: 10%), why don't you reate a Tax Rate through the API then pass along the "Tax Rate ID":

(Although I believe without the ID it's possible, would need to test it out)

 "taxRates": [
        {
          "modifiedTime": "long",
          "isDefault": false,
          "rate": "long",
          "name": "",
          "id": "",
          "taxAmount": "long",
          "deletedTime": "long",
          "items": [
            {
              "id": ""
            }
          ]
        }
      ],
1 comment Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tax is variable, so just provide tax rate id is not my flow.

But when I enter just rate and name for tax amount I have error from API.

0 Likes 0 · ·

Welcome to the
Clover Developer Community