question

haku-d avatar image
haku-d asked parquet76 commented

Wasn't able to include tax amount by using ECOMMERCE SERVICE API

I am using ECOMMERCE SERVICE API (https://docs.clover.com/reference/postorders) to create custom orders and I would like to have taxes included in my receipt. It seems tax_rates property did not work in this case. It was able to submit the order without tax_rates, but an error was occurred when included tax_rates. It said "

Could not find tax rate for line item."


curl --request POST \
     --url https://scl-sandbox.dev.clover.com/v1/orders \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

{
  "items": [
    {
      "tax_rates": [
        {
          "name": "GST",
          "tax_amount": 1000
        }
      ]
    }
  ]
}


Has anyone had same issue with using the ECOMMERCE SERVICE API?

e-commerce api
10 |2000

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

1 Answer

·
parquet76 avatar image
parquet76 answered parquet76 commented

You need to create the tax rate (using the rest API) prior to creating the order and pass the id of the tax rate when you create the order.

4 comments
10 |2000

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

haku-d avatar image haku-d commented ·

1720017268563.png

But the API spec for creating order only accept name & tax_amount. There is no id field for the tax rate.

0 Likes 0 ·
1720017268563.png (18.4 KiB)
parquet76 avatar image parquet76 haku-d commented ·

No, it accepts a uuid, look at the API docs. Regardless, I would recommend that you do not use that API. Use the atomic order endpoint which is more recent and more full-featured.

0 Likes 0 ·
haku-d avatar image haku-d parquet76 commented ·

I can see that. But I just want to make a simple online payment without creating inventory on Clover. The thing is the api does work properly.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community