Crystallize logo

Fetching an Order

Orders can be fetched in multiple ways in Crystallize, either by using the order ID or via the customer identifier. This section explains how you can fetch an order with the help of an order ID. We recommend reading more about the order object before fetching an order.

In order to perform these operations, ensure that you have the proper authentication (if necessary) and user permissions.

Base URL

Once you have generated access tokens, you can use the following endpoint to query the Order API:

https://api.crystallize.com/your-tenant-identifier/orders

Get Order Details Query

Fetching an order is fairly simple. All you need to do is provide an order ID to the query and then fetch the fields you would like the information for. The example query below fetches the name of the customer and the items contained in the order.

{
  orders {
    get(id: "60bdbf1836f57a0008304051") {
      customer {
        firstName
      }
      cart {
        name
      }
    }
  }
}
Running this query requires access tokens. If you have already generated the tokens, you can test out the query using the order API endpoint.

The above query is only fetching the most basic details. You can use any of the fields mentioned in the order object section to retrieve more information.