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

# Charge keys

> Who's allowed to charge, and who gets billed for it.

A charge key is a unique identifier that authenticates a driver to start a charging session.

<Frame>
  <img src="https://mintcdn.com/spirii-7457b714/Hq2YBNx3n8oQoC1s/images/components/tokens.png?fit=max&auto=format&n=Hq2YBNx3n8oQoC1s&q=85&s=ec9dd3fe145f7cae2f83089c84ab9d5c" alt="The Create charge key screen in Spirii Connect, showing owner details, key type selection, and the charge key's UID, label, and access settings" width="1527" height="960" data-path="images/components/tokens.png" />
</Frame>

## Overview

Charge keys are the central object for [authenticating and authorising](/capabilities/access/charge-key-authentication) charging sessions: they define *who* is charging on a network and *whether* they're allowed to. A charge key is an umbrella over several identification technologies: RFID cards, virtual identifiers in an app, and vehicle identification by MAC address or VIN (known as Autocharge).

Over [roaming](/capabilities/roaming/roaming-connection), the charge key is what lets a driver authenticate across networks, and what links each [CDR](/components/charging/sessions-and-cdrs) to the party that should be billed.

<Note>
  In the API, charge keys are called **tokens** and charge key groups are called **token groups** — for example `GET /v2/tokens`. The object is the same; only the name differs.
</Note>

## Context

A charge key is primarily an eMSP object — it's how a provider gives drivers access — but it works on both sides of a charge.

### eMSP context

For an eMSP, charge keys are how you identify your drivers and give them access to charge — on Spirii's network, and over roaming across other networks too. You register and manage the charge keys, and the billing customer on each one determines who's invoiced for its usage. For roaming, charge keys are exchanged with connected CPOs over hubs and direct integrations, so they must follow the roaming standard's (OCPI) rules; we recommend eMI3 formatting like `DK.SPI.C{customerPrefix}` to avoid interoperability issues.

### CPO context

For a CPO, charge keys are a channel to sell access to your infrastructure. When a driver presents a valid charge key at a public, online location, the platform authorises the session and handles the rest.

## Key attributes

| Attribute         | Description                                                                                                   | Example                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------- |
| Type              | The charge key type (see Types below)                                                                         | `RFID`                  |
| UID               | The charge key's unique identifier. For RFID cards, this is the MiFare UID.                                   | `A7E942F1C8D036B5A429`  |
| Label             | A free-text label for recognising the charge key in the platform, often the text printed on the physical card | `DE.SPI.00012345`       |
| Billing customer  | The customer in the platform billed for the charge key's usage                                                | `Acme Inc.`             |
| Billing reference | A free-text reference shown on invoices                                                                       | `Fleet Vehicle #123`    |
| Active            | Whether the charge key can start sessions on Spirii's network                                                 | `true`                  |
| Roaming           | Whether the charge key can start sessions over roaming                                                        | `true`                  |
| Expires at        | When the charge key's activation expires                                                                      | `23:59:59, 31 Dec 2025` |
| App user          | The linked app user in a Spirii app, if any                                                                   | `Spirii Go User 12345`  |

## Types and status

### Types

| Type                 | Description                                                                           |
| -------------------- | ------------------------------------------------------------------------------------- |
| RFID                 | A physical card or fob with an embedded MiFare chip.                                  |
| Virtual              | A digital identifier in a Spirii app, used as a payment method for monthly invoicing. |
| Vehicle (Autocharge) | The vehicle's MAC address or VIN, read by the charger when the cable is plugged in.   |

<Note>
  Vehicle (Autocharge) works only on Spirii's own network, not over roaming. A driver relying on Autocharge won't be recognised on other operators' chargers.
</Note>

### Status

A charge key's ability to start a session comes from two independent settings: Active (on Spirii's CPO network) and Roaming (over roaming), so a charge key can have either, both, or neither. An expiry overrides both: once past its `Expires at` date, a charge key can't authorise sessions regardless of those settings.

Deleting a charge key is the third way it stops authorising. Deletion is a *soft* delete: the key is set inactive and can no longer start sessions, but its record stays in the platform rather than being removed. Deleting a charge key also unlinks the payment method from it. You can delete a charge key from its sidebar in Connect, which asks you to confirm first.

<Warning>
  Deletion is permanent for that UID: once a charge key is deleted, you can't register a new one with the same UID. For a physical RFID card, that means the card can't be re-registered afterwards. To stop a charge key charging temporarily, set it inactive instead of deleting it.
</Warning>

## Used in

<CardGroup cols={3}>
  <Card title="Roaming connection" icon="globe" href="/capabilities/roaming/roaming-connection">
    Exchange charge keys with other networks over OCPI.
  </Card>

  <Card title="Tokens API" href="https://docs.spirii.com/api-reference/tokens/get-a-token-by-id">
    Register and manage charge keys programmatically.
  </Card>

  <Card title="Token groups API" href="https://docs.spirii.com/api-reference/token-groups/get-a-token-group-by-id">
    Organise charge keys into groups for shared access and billing.
  </Card>
</CardGroup>
