question

tombialy avatar image
tombialy asked ·

Adding line item with tax gives "Invalid line item"

Cmd=[POST https://sandbox.dev.clover.com/v3/merchants/H1Z*****Q1/orders/YSG*****RAJE/line_items HTTP/1.1]
  Header key=[Authorization] val=[Bearer 54c711************fd8bbf]
Payload=[{"name":"3 Egg Omlette","price":1802,"unitQty":1000,"taxRates":[{"rate":1200000,"taxAmount":216}]}]


Generates:


2020-05-30 14:34:29 DEBUG CloverServer:292 - Response[400] reply:{
  "message" : "Invalid line item"
}


API Token
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

· Write an Answer
David Marginian avatar image
David Marginian answered ·

I checked the logs, and it appears the tax rate may have to exist before creating a line item. Can you try adding the tax rate first - https://docs.clover.com/clover-platform/reference/inventory-1#taxratecreatetaxrate-1.

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.

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