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

# Manual tariff capture

> Customer enters their tariff manually.

Connect requests you to provide a manual tariff input screen for `FIXED` or `TIME_OF_DAY` tariff structure.

<Steps>
  <Step title="`FIXED` tariff rate">
    This page enables the customer to enter their tariff when they are on a fixed (flat) rate.

    <Tabs>
      <Tab title="Preview">
        <Frame>
          <img src="https://mintcdn.com/flatpeak/R_LWNRztMA209Dv3/images/08-fixed-rate-tariff.png?fit=max&auto=format&n=R_LWNRztMA209Dv3&q=85&s=d866a6a1f877d9073220d560cfdb26bf" style={{ width: "200px" }} width="375" height="852" data-path="images/08-fixed-rate-tariff.png" />
        </Frame>
      </Tab>

      <Tab title="Code">
        <Note>`cost` shall be returned in *large* currency units.</Note>

        <CodeGroup>
          ```json Connect response theme={"system"}
          {
            "connect_token": "cot_6587fa4362341be5b524de3b",
            "route": "rate_fixed_capture",
            "direction": "IMPORT",
            "live_mode": false,
            "data": {
              "currency_code": "GBP",
              "provider": {
                "id": "prv_65de30082a7c56d2297cbe3d",
                "display_name": "OVO Energy",
                "logo_url": "https://s.flatpeak.com/c56d2297cbe3d.png"
              },
              "cost": 0
            }
          }
          ```

          ```json Your POST to Connect theme={"system"}
          curl --request POST \
            --url https://connect.flatpeak.com \
            --header 'Content-Type: application/json' \
            --data '{
            "connect_token": "cot_6587fa4362341be5b524de3b",
            "route": "rate_fixed_capture",
            "data": {
              "cost": 24
            }
          }'
          ```
        </CodeGroup>

        When you POST the response, Connect may return any of these [validation errors](/guides/system/errors):

        | Error Code            | Error Description                             |
        | --------------------- | --------------------------------------------- |
        | `cost_value_zero`     | Tariff rate (cost) cannot be zero.            |
        | `cost_value_negative` | Tariff rate (cost) must be greater than zero. |
        | `data_json_invalid`   | Data does not conform to the JSON schema.     |
      </Tab>
    </Tabs>
  </Step>

  <Step title="`TIME_OF_DAY` tariff rate">
    This page lets the customer enter their tariff if it changes throughout the day.

    <Tabs>
      <Tab title="Preview">
        <Frame>
          <img src="https://mintcdn.com/flatpeak/R_LWNRztMA209Dv3/images/09-day-night-tariff.png?fit=max&auto=format&n=R_LWNRztMA209Dv3&q=85&s=b4a85900f70c7fe4718fb152d708f56f" style={{ width: "200px" }} width="375" height="852" data-path="images/09-day-night-tariff.png" />
        </Frame>
      </Tab>

      <Tab title="Code">
        <Note>`hours.valid_from` and `hours.valid_to` shall be returned as entered. `hours.cost` shall be returned in *large* currency units.</Note>

        <CodeGroup>
          ```json Connect response theme={"system"}
          {
            "connect_token": "cot_6587fa4362341be5b524de3b",
            "route": "rate_tod_capture",
            "direction": "IMPORT",
            "live_mode": false,
            "data": {
              "currency_code": "GBP",
              "provider": {
                "id": "prv_65de3167136dda41ceba3c2f",
                "display_name": "EDF",
                "logo_url": "https://s.flatpeak.com/dda41ceba3c2f.png"
              },
              "hours": [
                {
                  "cost": 0,
                  "valid_from": "00:00:00",
                  "valid_to": "00:00:00"
                }
              ]
            }
          }
          ```

          ```json Your POST to Connect highlight={15-42} theme={"system"}
          curl --request POST \
            --url https://connect.flatpeak.com \
            --header 'Content-Type: application/json' \
            --data '{
            "connect_token": "cot_6587fa4362341be5b524de3b",
            "route": "rate_tod_capture",
            "data": {
              "hours": [
                {
                  "cost": 0.12,
                  "valid_from": "00:00:00",
                  "valid_to": "00:00:00"
                }
              ]
            }
          }'
          ```
        </CodeGroup>

        When you POST the response, Connect may return any of these [validation errors](/guides/system/errors):

        | Error Code               | Error Description                                  |
        | ------------------------ | -------------------------------------------------- |
        | `cost_value_zero`        | Tariff rate (cost) cannot be zero.                 |
        | `cost_value_negative`    | Tariff rate (cost) must be greater than zero.      |
        | `valid_from_invalid`     | Time period start must be in format HH:mm:ss.      |
        | `valid_to_invalid`       | Time period end must be in format HH:mm:ss.        |
        | `gap_in_time_period`     | Gap between XX and YY is found in the time period. |
        | `incomplete_time_period` | Time period must cover the full 24 hours.          |
        | `data_json_invalid`      | Data does not conform to the JSON schema.          |
      </Tab>
    </Tabs>
  </Step>
</Steps>
