Prerequisites
Before you begin, make sure you have:- An active Aries account
- A terminal and your preferred language runtime (Node.js 18+, Python 3.8+, or any HTTP client for cURL)
Step 1: Register your app
Before your app can talk to Aries, you need to register it. This lets Aries know which app is making the request and what permissions that app will ask for. When you complete this step, Aries gives you two credentials:- Client ID - A public identifier for your app
- Client Secret - A private secret that proves the request is coming from your app
- Log in to Aries and open Client Center. Then go to the API tab.
- Click Generate Key.
- Fill in the fields:
- Client Name - A descriptive name for your app, such as
My Trading App - Redirect URIs - The URL Aries sends the user back to after they approve access, such as
https://yourapp.com/oauth/callback - Scopes - The permissions your app needs, such as account access, market data access, and order permissions
- Client Name - A descriptive name for your app, such as
- Click Generate API key.
- Client Name helps you recognize the app later in Aries.
- Redirect URIs tells Aries where to return the user after sign-in and approval. The value must exactly match the redirect URI you register in Client Center.
- Scopes tell Aries what data or actions your app wants permission to access.
user:information- View user profile and personal detailsaccount:information- View account balances, positions, and account historyorder:execution- Place, modify, and cancel ordersorder:information- View order history and order statusposition:information- View current positions and holdingsmarket:information- Access live and historical market datacalendar:information- Access earnings, economic, and market schedule dataoptions:information- Access options chains, Greeks, and expiration dataanalytics:information- View ratings, analytics, and market insightsmarket:supplemental- Access news, company profiles, financials, filings, ETF data, and technical analysis
Step 2: Request access for your app
In this step, you send the user to Aries so they can sign in and approve your app. This is how the user gives your app permission to access their Aries data. Aries does not give you an access token yet. First, Aries asks the user to sign in and confirm that they want to allow your app to use the requested scopes. After the user approves, Aries sends them back to your app with a temporary authorizationcode. You will use that code in Step 3 to request tokens from the token endpoint.
The authorization URL looks like this:
YOUR_CLIENT_ID, YOUR_REDIRECT_URI, and scope in the URL above with your real values from Step 1.
What these values mean:
YOUR_CLIENT_ID- The client ID Aries gave you when you created the appYOUR_REDIRECT_URI- The same callback URL you registered in Ariesscope- The permissions your app is requestingstate- A random value your app generates to help protect the sign-in flow
code in the URL:
code- A short-lived authorization code that you exchange for tokens in Step 3state- The same random value you sent earlier; your app should verify that it matches
state value does not match, do not continue. Stop the sign-in flow and start again.
Step 3: Get your access token
Now exchange the authorization code from Step 2 for tokens. The most important token is the access token. You send this token with every protected API request. Aries uses it to confirm that your app is allowed to act on behalf of the signed-in user. You also receive a refresh token. When the access token expires, the refresh token lets you request a new access token without asking the user to sign in again. In simple terms:- Step 2 gives you a temporary code
- Step 3 turns that code into usable tokens
access_token- Send this token with your API requeststoken_type- UsuallyBearerexpires_in- How long the access token remains validrefresh_token- Use this later to get a new access tokenscope- The permissions that were granted
access_token, refresh_token, and expiry time in a secure place. You will need the access token for the next steps.
-> Full reference: OAuth2 Token
Step 4: Fetch the user’s accounts
Now that you have an access token, you can make your first authenticated API call. This step fetches the user’s linked brokerage accounts. If your app will place trades, this step is important because you need thetrading_account_id from the response.
You can think of this step as: “Show me which accounts this signed-in user can use.”
trading_account_id- The account ID you use in trading requestsstatus- Whether the account is openis_sim- Whether the account is simulated or real
trading_account_id from this response.
-> Full reference: User Accounts
Step 5: Search for a stock
Before you can request market data or place an order, you need the correct symbol for the stock or asset you want to use. This step lets you search by company name or ticker symbol. In the example below, the search usesAAPL.
You will use the returned symbol in the next two steps.
symbol- The ticker you will use in later requestsdescription- The company or asset nametype- The asset category, such as stock
symbol value from the response in the quote and order steps that follow.
-> Full reference: Search Symbols
Step 6: Get a live quote
Now use the symbol to fetch current market data. This step helps you see the latest available price information before placing an order. For example, you may want to review the last traded price, the current bid and ask, or the price change before deciding what order price to send.d- The list of quote resultss- The overall response statusn- The instrument namesinside each quote item - The symbolv.lp- The latest traded pricev.bid- The highest current buy pricev.ask- The lowest current sell pricev.chandv.chp- The price change and percent changev.volume- The current trading volume
Step 7: Place an order
You now have everything needed to place an order:- A valid access token from Step 3
- A
trading_account_idfrom Step 4 - A symbol from Step 5
AAPL.
What the main fields mean:
side: BUY- You want to buy the stockqty: "1"- You want to buy 1 sharetype: LIMIT- You only want to buy at your limit price or a better priceprice: "189.00"- The highest price you are willing to paytimeInForce: DAY- The order stays active for the trading day unless it fills or is canceled
successshows whether Aries accepted the order requestclOrdIdis the client order IDstatusshows the current order stateqtyis the original order quantitycumQtyis the quantity already filledleavesQtyis the quantity still openavgPriceis the average filled price so fartextcontains a short status message
Next steps
OAuth2 Guide
Authorization Code and PKCE flows, scopes, security, and troubleshooting.
Accounts & Balances
Fetch account balances, positions, and order history.
Orders
Place, preview, update, and cancel orders.
Market Data
Search symbols, get quotes, and stream real-time market data.