question

zelin avatar image
zelin asked ·

Adding line items while creating orders not working

I am trying to create an order via REST API. Here is the JSON String. However its not adding lineitems to order creation.

What am I missing in the json.

{"state":"OPEN","lineItems":[{"unitQty":1,"item":{"id":"xxxxxx"}}],"employee":{"id":"xxxx"},"total":1394}

OrdersLineItems
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
Dan avatar image
Dan answered ·
The create order endpoint does not support adding line items
https://docs.clover.com/clover-platform/reference#...
After calling the create order endpoint, the create line item endpoint will need to be called
https://docs.clover.com/clover-platform/reference#...

https://docs.clover.com/clover-platform/docs/working-with-orders
2 comments 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.

But in the docs there is an object of line items while creating order. @

0 Likes 0 · ·

https://docs.clover.com/clover-platform/reference/orders-1#ordercreateorder-2 says "Only supports basic order creation. Valid fields are limited to taxRemoved, note, title, and orderType. Adding line items must be done in separate calls."

But as you say, then goes on to list body params listing line items. I'll get that fixed in the docs.

0 Likes 0 · ·

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