So far, we have only worked with fetching data via the Order API. This section explains how you can create an order using the API.
In order to create an order via the API, we will be using GraphQL mutations. The example mutation below takes in information about the customer, the cart, as well as the payment details. Once an order is created, you get back the order ID.
Multiple Items in Cart
The example mutation above only has a single item in the cart, you can add multiple items in the cart as well as shown below:
In case you would like to add more information to your order such as information about which warehouse the product would be shipped from, you can use the meta field. Data in this field is provided as key-value pairs as shown below.
The additionalInformation field takes in a string value. A good use case for this would be when a customer would like to place an additional request while placing an order such as requesting an engraving on a device or adding a message on a card, etc.