Crystallize logo
More in Learn

Order API

The Order API gives you the ability to query as well as create orders in Crystallize with GraphQL. Every order contains information regarding the purchase and includes the customer details, cart details as well as any payment related information.

Base URL

The Order API can be accessed by using the following endpoint:{your-tenant-name}/orders

API Access

Authentication is required to access the Order API. You can generate access tokens in order to do so.

Generate Access Tokens

Accessing via Browser

To explore the API using the GraphQL playground within the browser, you can add an extension such as Requestly. It modifies the network requests and is available for Firefox as well as Chrome. All you need to do is click on the New Rule button and add your access tokens as shown in the picture.

Requestly App

Example Query

Below is an example query that fetches a particular order.

Circle loading spinnerImage of a partial circle indicating &qoute;loading&qoute;.Fetching snippet...

cURL Example

The snippet below shows how you can fetch an order by ID through cURL. Don't forget to replace the access tokens, the order ID as well as the tenant identifier!

curl \
-H "Content-Type: application/json" \
-H "X-Crystallize-Access-Token-Id: [your-crystallize-token-id]" \
-H "X-Crystallize-Access-Token-Secret: [your-crystallize-token-secret]" \
--data '{ "query": "{ orders { get(id: \"[order-id]\") { total { gross } } } }" }' \[your-tenant-identifier]/orders
People showing thumbs up

Need further help?

Join and ask our
slack community.

Join our slack community