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. It’s also possible to create and manage orders using the Crystallize App.
In order to perform these operations, ensure that you have the proper authentication (if necessary) and user permissions.
In order to create an order via the API, we’ll be using GraphQL mutations. Refer to our GraphQL sample for creating an order, which is part of our example repository. Also check out the API docs at https://api.crystallize.com/your-tenant-identifier/orders for the full list of parameters you can specify and fetch.
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.
Note that orders are created asynchronously. There is no guarantee that the order will be retrievable immediately after registering it.