Skip to main content
More in Learn

Creating Orders

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 perform these operations, ensure that you have the proper authentication (if necessary) and user permissions.

Create Order

In order to create an order via the API, we’ll be using GraphQL mutations. The example mutation below takes information about the customer and the cart, as well as the payment details. Once an order is created, you get back the order ID.

Multiple

The example mutation above only has a single item in the cart. You can add multiple items to the cart as shown below:

Order Metadata

In case you’d 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.

Additional Information

The additionalInformation field takes a string value. A good use case for this would be for when a customer makes an additional request while placing an order, such as adding a message to a gift card.

People showing thumbs up

Need further assistance?

Ask the Crystallize team or other enthusiasts in our slack community.

Join our slack community