Skip to main content

How to Authenticate

The StoneX Clearing API follows the industry standard Client Credentials authentication flow. This returns a JWT that will be passed to subsequent requests in the Authorization header.

Step 1: Setup Client Credentials

Work with your firm's StoneX relationship manager to setup your developer account and get your client credentials.

Step 2: Generate Token

Once you have your client credentials, you’re ready to get an access token to make API calls. You can get the token using cURL, or you can use a tool such as Postman® or SoapUI®.

The token is valid for ten hours. When the token expires, you must get a new token by calling the /token endpoint again.

      POST https://api.clearing.uat.stonex.com/identity/connect/token

Headers

KeyValue
Content-Typeapplication/x-www-form-urlencoded

Body

The request body requires the following attributes:

KeyValue
client_id<your_client_id>
client_secret<your_client_secret>

Response

The /token endpoint will return the following response as JSON:

KeyDescription
access_tokenYour JWT token
expires_inLifetime of token in seconds
token_typeToken type

Step 3: Use Token

The generated access_token returned should then be passed to the API endpoint(s) in the Authorization header following the Bearer schema.

Authorization: Bearer <token>

Token Lifetime

The JWT generated from this endpoint has a lifetime of 10 hours. After that time expires you will need to generate a new one.