question

ahsan avatar image
ahsan asked zgreathouse Deactivated answered

How to create a complete order in one or two requests. Like adding more than one items and more than one modifications in one call only.

How to create a complete order in one or two requests. Like adding more than one items and more than one modifications in one call only.

At present, I first have to create an order with "state: open".

On the second request I have to add the item and

then on the third request, I have to add modifications.

Can we do all these requests by one call only?
OrdersInventory
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

zgreathouse avatar image
zgreathouse Deactivated answered
You cannot create an order, add a line item, and then set a modification to the item of that line item with only one API call.

Additionally, you cannot add multiple lineItems to an order with one call, nor can you add multiple modifications at once to an item with one call.

If you need to make new orders frequently to test your application I highly recommend the use of a dev kit or an emulator to quickly make orders through the register app. Or you can write a quick script which creates some amount of orders for you, so you don't need to do it manually through the rest api every time.
10 |2000

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