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

# Tariff library

> Connect route where the user picks their tariff from the Flatpeak tariff library.

The user picks their tariff from Flatpeak's tariff library, in a list filtered by supplier and location. If the tariff is not listed, send `TARIFF_MISSING`; support it so every user can finish.

> [tab] Preview
>
> ![](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/tariff-library.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=4701ef625d4ed3b5a04c673a6ffc0e85)

> [tab] Code
>
> ```json Connect response theme={"system"}
> {
>   "connect_session": "cos_6587fa4362341be5b524de3b",
>   "route": "library_select",
>   "live_mode": false,
>   "actions": [
>     "TARIFF_MISSING",
>     "BACK",
>     "CLOSE"
>   ],
>   "data": {
>     "device_type": "BATTERY_STORAGE",
>     "location": {
>       "timezone": "Europe/London",
>       "currency_code": "GBP"
>     },
>     "supplier": {
>       "id": "sup_65de3071e0c5570f767f06f1",
>       "display_name": "SSE",
>       "logo_url": "https://s.flatpeak.com/570f767f06f1.png"
>     },
>     "tariff_templates": [
>       {
>         "id": "trt_8587fa49c7e5297ccc6c57e4",
>         "name": "EV Energy Plan",
>         "description": "November 2026 tariff"
>       },
>       {
>         "id": "trt_6587fa49c7e5297ccc6c57e7",
>         "name": "Next Flex 2026 (37p/11.2p)",
>         "description": ""
>       }
>     ]
>   }
> }
> ```
>
> ```bash Your POST to Connect (data) theme={"system"}
> curl --request POST \
>   --url https://connect.flatpeak.com \
>   --header 'Content-Type: application/json' \
>   --data '{
>   "connect_session": "cos_6587fa4362341be5b524de3b",
>   "route": "library_select",
>   "data": {
>     "tariff_template_id": "trt_8587fa49c7e5297ccc6c57e4"
>   }
> }'
> ```
>
> #### Actions
>
> | Action | Result |
> | :- | :- |
> | `TARIFF_MISSING` | Returns the next page of the flow. |
> | `BACK` | Returns the previous page. |
> | `CLOSE` | Returns the `callback_url` set on the Connect session. |
>
> #### Errors
>
> | Error code | Description |
> | :- | :- |
> | `tariff_template_id_missing` | Tariff template ID is required. |
> | `tariff_template_not_found` | Tariff template ID trt\_XX not found. |
> | `tariff_template_id_invalid` | Supplier ID sup\_XX does not support tariff template ID trt\_XX. |
> | `data_json_invalid` | Data does not conform to the JSON schema. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.