Placing your first order with the Trading API

blog photo
Published by Marius Sprenger on December 30, 2021
Trading offers a simple API that allows you to create your own brokerage experience at the stock market. An important part of that is the possibility to place orders with one simple API call. In this blog post, I will walk you through the steps you need to take to place and activate an order with the Trading API. Ready, set, go 🏃👩‍💻

Getting access

Start by signing up on our Dashboard. After you verified your account, you can log in and use the first API Key and Space that we already created for you by default. After that, you are ready to place your first order.

Place your first order

To place an order with, you need to address the trading API by making a POST request against the base URL and add /orders/ to it:


Make sure to specify your order through your request body. 

Some of the parameters in there are required (isin to specify the instrument you want to buy, expires_at to define when the order expires, side to either buy or sell, quantity to specify how many shares you wish to buy, venue to address a specific trading venue, and space_id to place the order for a specific space). 

Others are optional (stop_price to place a stop market order, limit_price for a limit order, or both for a stop limit order, or notes if you want to add some notes with your order so you later know why you placed it in the first place). 

See an example request in Python below. You can check out our documentation for additional code snippets in JavaScript and more detailed explanations on different request parameters. 

1import requests
2import json
3request ="",
4          data=json.dumps({
5              "isin": "US19260Q1076",
6              "expires_at": "2021-11-25",
7              "side": "buy",
8              "stop_price": 5000000,
9              "limit_price": 5300000,
10              "quantity": 1,
11              "venue": "XMUN",
12              "space_id": "123456789",
13              "notes": "I want to attach a note to this order"
14            }), headers={"Authorization": "Bearer YOUR-API-KEY"})

Place your order

Dealing with the API Response

When you successfully placed your order, the API responds with a 

2"status": "ok"

and outputs some additional response elements. For instance, you learn about the estimated_price or the regulatory information associated to your order. And you receive the order_id, which is crucial for the next (and final) step before your order can get executed. 

Activating an Order

Before we route your order to a trading venue, you first need to activate it. You can do this through the following endpoint:


See now why it is crucial that the POST request against the /orders/ endpoint returns the order_id? Using the ID, we can activate the order through:

1import requests
2import json
3request ="{order_id}/activate/",
4            headers={"Authorization": "Bearer YOUR-API-KEY"})

Activate an order through its order_id

On success, the order is activated and routed to the specified trading venue. You can now sit back and relax — your work here is done (for now). 

Retrieving your Orders

You can retrieve all your orders by posting a GET request against the /orders/ endpoint:


To specify your request, you can add Query Parameters to your request:

  • space_id: filter for orders from a specific space
  • from & to: you can define a time range from which you want to retrieve orders
  • isin: add this query parameter to only see orders related to a specific isin
  • side: query parameter to see only buy or sell orders
  • status: filter for order status, e.g. inactive or executed
  • type: filter for different types of orders: market, stop, limit, stop_limit

See the example request below to learn how to use the query parameters in your request. In the example, we only want to see Tesla buy orders, therefore using the isin and side query parameters:

1import requests
2import json
3request ="{order_id}/activate/",
4            headers={"Authorization": "Bearer YOUR-API-KEY"})

Ideas for Inspiration

You now know how to place an order with the Trading API. Now: what to do with it? There are plenty of use cases. Think of the order placement as the final step in your awesome trading project. You have an automated trading strategies that buys stocks based on predefined criteria? Great, the order endpoint is triggered when a certain threshold in your algo is crossed. You built your own trading app to buy and sell stocks? Great, whenever you click the buy/sell button in your application, you will need the POST /orders/ endpoint. What are your additional ideas for how to use the /orders/ endpoint? Let us know 🙂

I hope you got a good understanding of one of our most crucial API endpoints. If you have any questions or want to get in touch with other liked-minded developers: join our growing Slack community and discuss your newest trading project idea. And for more inspiration: check out our other blog articles

Excited to see what you are building with us 😍

Marius from 🍋.markets

You might also be interested in

Exploring the instruments endpoint

blog photo

The /instruments endpoint can be used to search the 8250+ stocks and ETFs we currently offer on You can customise your search with as much detail as you’d like by specifying the exchange, currency, type and other characteristics. Continue reading if you’d like to learn more.

Manage your trading portfolio with the brokerage API

blog photo

Placing your first order with the Trading API

blog photo

With the API, placing an order is only one API call. But kind of information do you need to include in your request? In this blog post we walk you through how to successfully place an order and how to activate it with the trading API, such that it is placed and filled on the exchange of your choice. Keep reading to learn more.

Dive Deeper

Find more resources to get started easily

Check out our documentation to find out more about our API structure, different endpoints and specific use cases.


Join community

Join our Slack channel to actively participate in our community, ask questions to other users and stay up to date at all times.


Interested in building with us?

We are always looking for great additions to our team that help us build a brokerage infrastructure for the 21st century.

Need any help?
Ask a question in our CommunityAsk a question in our CommunityGet started with our DocumentationGet started with our DocumentationGet inspired on our BlogGet inspired on our Blog
For Developers
© 2021Privacy PolicyImprint
All systems normal