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

# Migrating to Smart Charging

> Upgrade from Flex Lite to Smart Charging for full schedule control and higher revenue

If you've already integrated Flex Lite and want to unlock higher revenue and full schedule optimisation, this guide covers exactly what changes when upgrading to Smart Charging.

## Why upgrade?

|                         | Flex Lite                           | Smart Charging                                  |
| ----------------------- | ----------------------------------- | ----------------------------------------------- |
| **Scheduling model**    | Inserts pauses into *your* schedule | Axle generates the *entire* schedule            |
| **Optimisation window** | Single 30-min pause                 | Full charging session                           |
| **Re-scheduling**       | One-shot (at plug-in)               | Continuous — Axle re-optimises as prices change |
| **Revenue potential**   | Lower                               | Higher — more flexible capacity to sell         |

<Tip>
  Smart Charging maximises flexibility revenue because Axle controls the full charging window, not just a single pause.
</Tip>

## What changes

<AccordionGroup>
  <Accordion title="What's added">
    * **Tariff data** — send the user's energy tariff so Axle can cost-optimise charging
    * **Intent** — send the user's energy requirement (kWh) and ready-by time, which sets the minimum requirements for the schedule Axle will build
    * **Separate plug-in / plug-out events** — replace the combined `plug-in-schedule` call so Axle knows the charging window
    * **Schedule endpoint** — Axle calls your API with an OCPP schedule payload whenever a new schedule is generated
    * **Half-hourly readings** — report consumption so Axle can verify delivery and calculate rewards
  </Accordion>

  <Accordion title="What's removed">
    * **`plug-in-schedule` endpoint** — replaced by separate plug-in event + async schedule delivery
    * **Schedule in API response** — schedules arrive via a call to your API with an OCPP schedule payload, not in the plug-in response
  </Accordion>

  <Accordion title="What stays the same">
    * **Authentication** — same OAuth token flow
    * **Site & asset model** — same entities, same IDs
    * **Onboarding** — same `onboard-site-and-asset` (or advanced `initialise` / `enrol`) flow, though Smart Charging uses the `full_asset_schedule_control` proposition instead of `limited_pause`
    * **Offboarding** — same `offboard-site-and-assets` endpoint
    * **Payments** — same rewards and transaction endpoints
  </Accordion>
</AccordionGroup>

## Integration steps

These are the changes you need to make on top of your existing Flex Lite integration. For full detail on each step, see the [Smart Charging integration guide](/workflows/smart-charging/integration).

### 1. Send tariff data

Axle needs the user's energy tariff to optimise charging cost. Send it once at enrolment time, then update whenever the tariff changes.

<Card title="Send tariff" icon="rectangle-terminal" href="/workflows/smart-charging/api-reference/tariff">
  Send or update a user's tariff
</Card>

### 2. Collect and send intent

Collect the user's charging requirement and deadline:

* **kWh** — how much energy to add
* **Ready-by time** — when the vehicle needs to be ready

Send intent once at enrolment time, then update whenever it changes.

<Card title="Send intent" icon="rectangle-terminal" href="/workflows/smart-charging/api-reference/intent">
  Send or update a user's charging intent
</Card>

### 3. Replace plug-in-schedule with separate events

Instead of a single `plug-in-schedule` call that returns a schedule synchronously, send separate plug-in and plug-out events. Schedules are delivered asynchronously in OCPP format via an API call to your endpoint.

<CardGroup cols={2}>
  <Card title="Plug-in event" icon="rectangle-terminal" href="/workflows/smart-charging/api-reference/plug-in">
    Notify Axle when a vehicle plugs in
  </Card>

  <Card title="Plug-out event" icon="rectangle-terminal" href="/workflows/smart-charging/api-reference/plug-out">
    Notify Axle when a vehicle unplugs
  </Card>
</CardGroup>

<Note>
  You should also send a plug event when a user is first enrolled to inform Axle of the initial plug state.
</Note>

### 4. Set up schedule endpoint

Axle sends charging schedules to your platform in OCPP format via an API call. You need to expose an endpoint that can receive and apply these schedules to the charger.

Axle will send a schedule:

* When the user plugs in
* When the user is already plugged in and one of the following events happens:
  * The user's tariff is updated
  * The user's intent changes
  * Axle reoptimises in response to changes in the wider market

<Card title="Example OCPP charging profile" icon="code" href="/api-reference/examples/get-example-ocpp-charging-profile">
  See the format of schedule pushes from Axle
</Card>

### 5. Report half-hourly readings

Send consumption readings so Axle can verify delivery and calculate rewards.

<Card title="Send readings" icon="rectangle-terminal" href="/workflows/smart-charging/api-reference/readings">
  Report asset consumption readings
</Card>

### 6. Enrol users in Smart Charging

Once the above integration work is complete, you can start enabling users. Enrol them in the `full_asset_schedule_control` proposition via the [enrol endpoint](/workflows/flex-lite/api-reference/enrol):

```json theme={null}
{
  "proposition": "full_asset_schedule_control"
}
```

<Tip>
  Sites can be enrolled in multiple propositions simultaneously, so this won't affect the existing Flex Lite enrolment. Once you've verified Smart Charging is working, unenrol from `limited_pause` via the [unenrol endpoint](/workflows/flex-lite/api-reference/unenrol) to keep things clean and avoid ambiguity.
</Tip>

## Sequence diagram

<Accordion title="View end-to-end flow for smart charging integration">
  ```mermaid theme={null}
  %%{init: {'theme': 'neutral'}}%%
  sequenceDiagram
      participant Charger
      participant Your API
      participant Axle API

      Note over Your API,Axle API: One-time setup per user
      Your API->>Axle API: POST /entities/site/{site_id}/enrol<br/>{proposition: "full_asset_schedule_control"}
      Axle API-->>Your API: {status: "enrolled"}

      Your API->>Axle API: POST /entities/asset/{asset_id}/event/tariff
      Axle API-->>Your API: 200 OK

      Note over Charger,Axle API: Each charging session
      Charger->>Your API: User plugs in
      Your API->>Axle API: POST /entities/asset/{asset_id}/event/plug-in
      Axle API-->>Your API: OCPP SetChargingProfile
      Your API->>Charger: Apply schedule

      Note over Charger,Axle API: Schedule may be re-sent if<br/>tariff or intent changes, or Axle reoptimises

      Charger->>Your API: User unplugs
      Your API->>Axle API: POST /entities/asset/{asset_id}/event/plug-out

      Note over Your API,Axle API: Reporting
      Your API->>Axle API: POST /data/readings<br/>(half-hourly consumption)

      Note over Your API,Axle API: User offboarding
      Your API->>Axle API: POST /entities/site/{site_id}/unenrol
      Axle API-->>Your API: {"site_id": "...", "status": "unenrolled"}
  ```
</Accordion>

## Migration checklist

Use this to track your migration progress:

<Steps>
  <Step title="Send tariff data">
    Send each user's tariff to Axle.
  </Step>

  <Step title="Collect and send intent">
    Add UI to collect kWh requirement and ready-by time, and send via the intent endpoint.
  </Step>

  <Step title="Replace plug-in-schedule with separate events">
    Switch from `plug-in-schedule` to separate `plug-in` and `plug-out` event calls.
  </Step>

  <Step title="Set up schedule endpoint">
    Expose an endpoint to receive and apply OCPP charging profiles from Axle.
  </Step>

  <Step title="Report half-hourly readings">
    Report consumption data via the readings endpoint.
  </Step>

  <Step title="Test end-to-end">
    Run a full charging session through the sandbox to verify the integration.
  </Step>

  <Step title="Enrol users in Smart Charging">
    Enrol each user in `full_asset_schedule_control`. Once verified, unenrol from `limited_pause`.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Smart Charging integration guide" icon="code" href="/workflows/smart-charging/integration">
    Full integration walkthrough
  </Card>

  <Card title="Smart Charging API Reference" icon="rectangle-terminal" href="/workflows/smart-charging/api-reference/auth">
    Complete API documentation
  </Card>

  <Card title="OCPP example" icon="bolt" href="/api-reference/examples/get-example-ocpp-charging-profile">
    Example charging profile payload
  </Card>
</CardGroup>
