Market operations
This guide will show you how to use the Switch API to trade with flexibility products on the market.
To automate certain actions such as creating offers for availability orders, you can fetch and send data to specific endpoints of the Switch API.
1. Getting Started
First of all, you'll need to be set up and accustomed to working with the Switch API. Next you need to create an Organization Client and note the client ID and secret since you will need them further on.
2. Get Access Token
In order to be able to fetch or send market data, you first need a valid access token that will be used to authorize your request to the Switch API.
To accomplish this you will need the previously noted client ID and client secret and use them to retrieve valid access token by following the client credentials flow as described in Client Credentials Flow page. Please note the endpoint for retriving the token as stated in Token Endpoint page depending on which environment you want to interface with.
When you have your access token ready, proceed with the next step.
3. Get Resource Information
You can use the Get resources endpoint to find information about the resources available in your organization. The ID of a specific resource is needed to fetch availability orders and create offers. It's also possible to view the resource information in the Switch app, as described in the Concepts section.
4. Get Availability Orders
For the products "Tillgänglighetsordrar" (productType LfmA
) and "Direktordrar" (productType LfmD
), the markets use availability orders to request quantities of potential flexibility that may be activated for delivery. Once availability orders are cleared on the market (at expiry), any accepted offer will lead to awarded availability and corresponding flexibility orders being created by Switch.
You need to use a resource ID in your API request to fetch availability orders with the Get resource availability orders endpoint. This ensures that the correct availability quantity and price is calculated for that specific resource, which can be used to create corresponding offers on the market. For each availability order you will also get an ID which must be provided in the create offer POST request.
5. Create Availability Offers
When creating offers with the Create availability offers endpoint you need to specify availability order ID, quantity and activation price, i.e.what you want to be paid in addition to the availability price. This must be done before order expiry and market clearing:
D-2 18:00 for "Tillgänglighetsordrar"
D-1 09:00 for "Direktordrar DayAhead"
H-3 for "Direktordrar IntraDay"
Before clearing occurs it's also possible to either update an existing offer or remove it entirely by using the Update availability offers and Delete availability offers endpoints, respectively.
6. Get Availability Transactions
If you want to see awarded availability quantities, i.e.what offers were accepted on the market, you can use the Get availability transactions endpoint to fetch the transactions related to an availability order. Data is available D-2 18:30 at the latest for "Tillgänglighetsordrar" and D-1 09:30 for "Direktordrar DayAhead". Most of the information such as quantity and delivery time period will be duplicated in a corresponding flexibility order, created by Switch.
7. Get Flexibility Transactions
If you want to see activated quantities, i.e.what you need to deliver with your flexibility resources, you can use the Get flexibility transactions endpoint to fetch the transactions related to a flexibility order. Data is available D-1 10:35 at the latest for day-ahead activation. Note that if no transaction data is returned, you can assume that no delivery of flexibility is expected.
Last updated
Was this helpful?