Skip to main content
More in Learn

Crystallize Access Tokens

Crystallize Access Tokens allow you to make API requests that require authentication, such as fetching and creating orders via the Order API.

Creating a Crystallize Access Token

Creating access tokens is very straightforward withing Crystallize. Simply head over to the Settings page within Crystallize and click on "Access tokens".

Click on "Generate a new token", provide a name for the token, and click "Generate". This will generate an access key with an ID and a secret - you should make a note of these as the secret will not be shown again.

Making Requests

Once you have your access token you can make requests where authentication is required, such as the Order API. You can add your token ID and secret with the headers "X-Crystallize-Access-Token_Id" and "X-Crystallize-Access-Token-Secret" respectfully.

Below is an example of how you might make a request to the Order API via cURL.

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 assistance?

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

Join our slack community