> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trlyr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update aFRR bids for a single product and delivery day.

> # Updates an aFRR product bid for a virtual asset

The endpoint expects a list of bids for a single product and delivery day. For now, only a single bid per product is allowed.

If one (or more) bids have already been submitted for the product, they will be replaced by the newer submission.

## Path parameters

`productDateCode`: 

The product date code identifies a single product and delivery day pair: `YYYY-MM-DD_{{productName}}`. 

The delivery day inside the `productDateCode` path parameter must be in the following format: `YYYY-MM-DD`, e.g. `2025-01-01` (full day according to RFC3339).

All submitted bids for this product are updated. Previous bids are deleted.

Examples:
- aFRR Energy: `2025-01-01_POS_001`.
- aFRR Capacity: `2025-01-01_POS_00_04`.

## Request body

The request body is a list of bids to be placed for the selected product and delivery day. It contains the following fields:

`offeredCapacity`: 

The offered capacity of the bid in **kilowatts**, e.g. `2000`. 

The value must be an integer multiple of 1 megawatt. Any non-integral part will be rounded down, e.g. 1000.5 is accepted and rounded down to 1000kW, whereas 1500 would be rejected.

`capacityPrice`:

The max price that can be bid into both markets is 15,000 Euros, the min price is -15,000 Euros. If you bid a positive price (> 0), you will be paid by the TSO. If you bid a negative price (< 0), you pay the TSO.
- aFRR Energy: This field is null.
- aFRR Capacity: The capacity price of the bid in **EUR/MW/h**, e.g. `100.00`. This price is used to determine the position of the bid in the TSO's merit order.

`energyPrice`:

The max price that can be bid into both markets is 15,000 Euros, the min price is -15,000 Euros. If you bid a positive price (> 0), you will be paid by the TSO. If you bid a negative price (< 0), you pay the TSO.
- aFRR Energy: The energy price of the bid in **EUR/MWh**, e.g. `100.00`. This price is used to determine the position of the bid in the TSO's merit order.
- aFRR Capacity: The energy price of the 16 implicit aFRR Energy bids in **EUR/MWh**, e.g. `100.00`. When submitting a bid into the aFRR Capacity market, it is mandatory to place 16 implicit aFRR Energy bids covering the 4-hour duration of the Capacity bid. This is done by providing a mandatory `energyPrice` on each Capacity bid. Each of the 16 Energy bids will have the same `offeredCapacity` as the corresponding Capacity bid. These Energy bids can still be updated after the Capacity bid has received a result. However, if the Capacity bid was accepted, the `offeredCapacity` of the Energy bids cannot be reduced. If the Capacity bid is rejected, the implicit Energy bids are also rejected.

## Bidding deadlines

### aFRR Energy
All bids must be placed before the following deadline: **30 minutes** before the delivery period, e.g. a bid for delivery period 15:30pm must be submitted by 15:00pm. Moreover, bids must be placed after **12:00pm CET/CEST** on the day before delivery. If bids are made before that time, they are rejected.

### aFRR Capacity
All bids must be placed before the following deadline: **8:40am CET/CEST** on the day before delivery. The auction opens a week before the delivery day.

## Determining available bidding capacity

Validation 1 and 2 must be passed, or the bid will be rejected.

### Validation 1: Available positive and negative aFRR timeseries

The `offeredCapacity` for aFRR bids at any given point in time must be lower than or equal to the available positive or negative capacity for aFRR of the virtual asset.

The value can be retrieved from the `operationalData` endpoint on the virtual asset as a 15 minute timeseries by requesting the operational data category `afrrNegCapacityAvailable` and `afrrPosCapacityAvailable` respectively.

Example:
- `afrrPosCapacityAvailable` from 00:00-04:00 am:        4000 kW
- `afrrNegCapacityAvailable` from 00:00-04:00 am:        5000 kW
- Remaining capacity for product `POS_00_04`:            4000 kW
- Remaining capacity for products `POS_001`-`POS_016`:   4000 kW
- Remaining capacity for product `NEG_00_04`:            5000 kW
- Remaining capacity for products `NEG_001`-`NEG_016`:   5000 kW

### Validation 2: Max total ancillary capacity timeseries

The `offeredCapacity` for aFRR bids at any given point in time must also take into account bids that have already been placed in the FCR market for the same period so as not to exceed the max total ancillary capacity of the virtual asset.

An FCR bid has both a positive and negative product direction and therefore reduces the available max total capacity in both directions.

The max total ancillary capacity can be retrieved from the `operationalData` endpoint on the virtual asset as a 15 minute timeseries by requesting the operational data category `maxTotalAncillaryCapacityChargeAvailable` (negative direction) and `maxTotalAncillaryCapacityDischargeAvailable` (positive direction) respectively.

Example:
- `maxTotalAncillaryCapacityDiscargeAvailable`:          5000 kW
- `maxTotalAncillaryCapacityChargeAvailable`:            4000 kW
- FCR bid placed for product `NEGPOS_00_04`:             3000 kW
- Remaining capacity for product `POS_00_04`:            2000 kW (5000 - 3000)
- Remaining capacity for products `POS_001`-`POS_016`:   2000 kW (5000 - 3000)
- Remaining capacity for product `NEG_00_04`:            1000 kW (5000 - 4000)
- Remaining capacity for products `NEG_001`-`NEG_016`:   1000 kW (5000 - 4000)

## Deleting bids

To delete a bid, set the body with 0 values:

```json
[
  {
    "capacityPrice": 0,
    "energyPrice": 0,
    "offeredCapacity": 0
  }
]
```

## Adjustment of virtual asset blocks

Once a valid product bid has been submitted, a new aFRR block (`"market":"AFRR"`) is added to the virtual asset.

The block will cover the duration of the whole virtual asset.

Inside the block's power capacity timeseries, the `powerCapacity` is updated to value of the bid's `offeredCapacity` for the delivery period of the product you bid on.

At the same time, the `powerCapacity` of the wholesale block (`"market":"WHOLESALE"`) for the delivery period of the product you bid on is reduced by the `offeredCapacity`.

Both the aFRR and the wholesale block will be adjusted according to the incoming bid results.

E.g. if a bid is rejected, the `powerCapacity` is removed from the aFRR block and added to the wholesale block.

## Response format

Returns a JSON representation of the created aFRR product bids identical to the response body of the POST aFRR bids endpoint.




## OpenAPI

````yaml https://api.sandbox.trlyr.com/docs/doc.json put /organisations/{organisationID}/virtual-assets/{virtualAssetID}/ancillary/afrr/bids/{productDateCode}
openapi: 3.1.0
info:
  description: >
    This API allows clients to manage virtual-assets and blocks on the terralayr
    system.


    A virtual asset is a virtual battery, it has static parameters that dictate
    how much power it can import / export, how much energy it can store, and how
    efficiently it charges / discharges. It also has a state of charge which
    changes as the virtual asset exports and imports power.


    A block represents a slice of the power capacity of a virtual asset over
    time, and has a schedule which can be updated to control what the
    virtual-asset will do.


    Virtual assets should be kept balanced: you should manage the schedule such
    that the such that state of charge at the end of its lifetime is 50%. It is
    possible to submit schedules that do not end at 50%, but the response will
    include information about how much imbalance is left.


    ### Authorization


    All the underneath requests require a Bearer-type `Authorization` Header
    i.e. in the form : `Authorization: Bearer <YOUR_TOKEN>`.


    To retrieve a valid token you must log in to our system using a
    password-username authentication as follows:


    ```

    POST https://api.sandbox.trlyr.com/auth/public/authenticate

    ```


    with the following JSON body:


    ```

    {
        "username": "YOUR_USERNAME",
        "password": "YOUR_PASSWORD"
    }

    ```


    Your username and password are the ones you created after receiving an
    invitation to join your organisation.


    You should receive a JSON response body from which you can extract your
    token under `access_token`.


    If you have any questions, don't hesitate to contact our account manager at
    the following address: support@trlyr.com.
  title: terralayr API
  version: 1.11.3
servers:
  - description: Production API
    url: https://api.trlyr.com
  - description: Sandbox API
    url: https://api.sandbox.trlyr.com
security: []
tags:
  - name: virtual-assets
  - name: afrr
  - name: fcr
  - name: ancillary
  - name: blocks
externalDocs:
  description: ''
  url: ''
paths:
  /organisations/{organisationID}/virtual-assets/{virtualAssetID}/ancillary/afrr/bids/{productDateCode}:
    put:
      tags:
        - afrr
      summary: Update aFRR bids for a single product and delivery day.
      description: >
        # Updates an aFRR product bid for a virtual asset


        The endpoint expects a list of bids for a single product and delivery
        day. For now, only a single bid per product is allowed.


        If one (or more) bids have already been submitted for the product, they
        will be replaced by the newer submission.


        ## Path parameters


        `productDateCode`: 


        The product date code identifies a single product and delivery day pair:
        `YYYY-MM-DD_{{productName}}`. 


        The delivery day inside the `productDateCode` path parameter must be in
        the following format: `YYYY-MM-DD`, e.g. `2025-01-01` (full day
        according to RFC3339).


        All submitted bids for this product are updated. Previous bids are
        deleted.


        Examples:

        - aFRR Energy: `2025-01-01_POS_001`.

        - aFRR Capacity: `2025-01-01_POS_00_04`.


        ## Request body


        The request body is a list of bids to be placed for the selected product
        and delivery day. It contains the following fields:


        `offeredCapacity`: 


        The offered capacity of the bid in **kilowatts**, e.g. `2000`. 


        The value must be an integer multiple of 1 megawatt. Any non-integral
        part will be rounded down, e.g. 1000.5 is accepted and rounded down to
        1000kW, whereas 1500 would be rejected.


        `capacityPrice`:


        The max price that can be bid into both markets is 15,000 Euros, the min
        price is -15,000 Euros. If you bid a positive price (> 0), you will be
        paid by the TSO. If you bid a negative price (< 0), you pay the TSO.

        - aFRR Energy: This field is null.

        - aFRR Capacity: The capacity price of the bid in **EUR/MW/h**, e.g.
        `100.00`. This price is used to determine the position of the bid in the
        TSO's merit order.


        `energyPrice`:


        The max price that can be bid into both markets is 15,000 Euros, the min
        price is -15,000 Euros. If you bid a positive price (> 0), you will be
        paid by the TSO. If you bid a negative price (< 0), you pay the TSO.

        - aFRR Energy: The energy price of the bid in **EUR/MWh**, e.g.
        `100.00`. This price is used to determine the position of the bid in the
        TSO's merit order.

        - aFRR Capacity: The energy price of the 16 implicit aFRR Energy bids in
        **EUR/MWh**, e.g. `100.00`. When submitting a bid into the aFRR Capacity
        market, it is mandatory to place 16 implicit aFRR Energy bids covering
        the 4-hour duration of the Capacity bid. This is done by providing a
        mandatory `energyPrice` on each Capacity bid. Each of the 16 Energy bids
        will have the same `offeredCapacity` as the corresponding Capacity bid.
        These Energy bids can still be updated after the Capacity bid has
        received a result. However, if the Capacity bid was accepted, the
        `offeredCapacity` of the Energy bids cannot be reduced. If the Capacity
        bid is rejected, the implicit Energy bids are also rejected.


        ## Bidding deadlines


        ### aFRR Energy

        All bids must be placed before the following deadline: **30 minutes**
        before the delivery period, e.g. a bid for delivery period 15:30pm must
        be submitted by 15:00pm. Moreover, bids must be placed after **12:00pm
        CET/CEST** on the day before delivery. If bids are made before that
        time, they are rejected.


        ### aFRR Capacity

        All bids must be placed before the following deadline: **8:40am
        CET/CEST** on the day before delivery. The auction opens a week before
        the delivery day.


        ## Determining available bidding capacity


        Validation 1 and 2 must be passed, or the bid will be rejected.


        ### Validation 1: Available positive and negative aFRR timeseries


        The `offeredCapacity` for aFRR bids at any given point in time must be
        lower than or equal to the available positive or negative capacity for
        aFRR of the virtual asset.


        The value can be retrieved from the `operationalData` endpoint on the
        virtual asset as a 15 minute timeseries by requesting the operational
        data category `afrrNegCapacityAvailable` and `afrrPosCapacityAvailable`
        respectively.


        Example:

        - `afrrPosCapacityAvailable` from 00:00-04:00 am:        4000 kW

        - `afrrNegCapacityAvailable` from 00:00-04:00 am:        5000 kW

        - Remaining capacity for product `POS_00_04`:            4000 kW

        - Remaining capacity for products `POS_001`-`POS_016`:   4000 kW

        - Remaining capacity for product `NEG_00_04`:            5000 kW

        - Remaining capacity for products `NEG_001`-`NEG_016`:   5000 kW


        ### Validation 2: Max total ancillary capacity timeseries


        The `offeredCapacity` for aFRR bids at any given point in time must also
        take into account bids that have already been placed in the FCR market
        for the same period so as not to exceed the max total ancillary capacity
        of the virtual asset.


        An FCR bid has both a positive and negative product direction and
        therefore reduces the available max total capacity in both directions.


        The max total ancillary capacity can be retrieved from the
        `operationalData` endpoint on the virtual asset as a 15 minute
        timeseries by requesting the operational data category
        `maxTotalAncillaryCapacityChargeAvailable` (negative direction) and
        `maxTotalAncillaryCapacityDischargeAvailable` (positive direction)
        respectively.


        Example:

        - `maxTotalAncillaryCapacityDiscargeAvailable`:          5000 kW

        - `maxTotalAncillaryCapacityChargeAvailable`:            4000 kW

        - FCR bid placed for product `NEGPOS_00_04`:             3000 kW

        - Remaining capacity for product `POS_00_04`:            2000 kW (5000 -
        3000)

        - Remaining capacity for products `POS_001`-`POS_016`:   2000 kW (5000 -
        3000)

        - Remaining capacity for product `NEG_00_04`:            1000 kW (5000 -
        4000)

        - Remaining capacity for products `NEG_001`-`NEG_016`:   1000 kW (5000 -
        4000)


        ## Deleting bids


        To delete a bid, set the body with 0 values:


        ```json

        [
          {
            "capacityPrice": 0,
            "energyPrice": 0,
            "offeredCapacity": 0
          }
        ]

        ```


        ## Adjustment of virtual asset blocks


        Once a valid product bid has been submitted, a new aFRR block
        (`"market":"AFRR"`) is added to the virtual asset.


        The block will cover the duration of the whole virtual asset.


        Inside the block's power capacity timeseries, the `powerCapacity` is
        updated to value of the bid's `offeredCapacity` for the delivery period
        of the product you bid on.


        At the same time, the `powerCapacity` of the wholesale block
        (`"market":"WHOLESALE"`) for the delivery period of the product you bid
        on is reduced by the `offeredCapacity`.


        Both the aFRR and the wholesale block will be adjusted according to the
        incoming bid results.


        E.g. if a bid is rejected, the `powerCapacity` is removed from the aFRR
        block and added to the wholesale block.


        ## Response format


        Returns a JSON representation of the created aFRR product bids identical
        to the response body of the POST aFRR bids endpoint.
      parameters:
        - description: Access token
          in: header
          name: Authorization
          required: true
          schema:
            default: Bearer <access token value>
            type: string
        - description: Organisation ID
          in: path
          name: organisationID
          required: true
          schema:
            type: string
        - description: Virtual Asset ID
          in: path
          name: virtualAssetID
          required: true
          schema:
            type: string
        - description: Bid ID
          in: path
          name: productDateCode
          required: true
          schema:
            default: YYYY-MM-DD_ProductName
            type: string
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/UpdateAFRRProductBid'
              title: updateAFRRProductBid
              type: array
        description: AFRR Product Bid Update
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AFRRProductBidsBody'
                type: array
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
components:
  schemas:
    UpdateAFRRProductBid:
      properties:
        capacityPrice:
          description: In EUR/MW/h
          example: 100.5
          format: float
          type: number
        energyPrice:
          description: In EUR/MWh
          example: 100.5
          format: float
          type: number
        offeredCapacity:
          description: In kW
          example: 1000
          format: float
          type: number
      required:
        - offeredCapacity
      type: object
    AFRRProductBidsBody:
      properties:
        bids:
          items:
            $ref: '#/components/schemas/AFRRProductBidBody'
          type: array
          uniqueItems: false
        deliveryDay:
          example: '2025-11-11'
          type: string
        product:
          description: 'Capacity market bid: POS_00_04, Energy market bid: POS_001'
          example: POS_00_04
          type: string
        productDateCode:
          description: >-
            Capacity market bid: 2025-11-11_POS_00_04, Energy market bid:
            2025-11-11_POS_001
          example: 2025-11-11_POS_00_04
          type: string
      required:
        - deliveryDay
        - product
        - productDateCode
      type: object
    AFRRProductBidBody:
      properties:
        capacityPrice:
          description: In EUR/MW/h (will be 'null' in energy market bid)
          example: 100.5
          format: float
          type: number
        energyPrice:
          description: In EUR/MWh
          example: 100.5
          format: float
          type: number
        offeredCapacity:
          description: In kW (must be an integer multiple of 1 megawatt, e.g. 1000, 2000)
          example: 1000
          format: float
          type: number
      required:
        - offeredCapacity
      type: object

````