> ## 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.

# Tokens

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

A token 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 token's UID, label, and access settings" width="1527" height="960" data-path="images/components/tokens.png" />
</Frame>

## Overview

Tokens are the central object for [authenticating and authorising](/capabilities/access/token-authentication) charging sessions: they define *who* is charging on a network and *whether* they're allowed to. A token (shown as a charge key in the Connect UI) 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 token 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.

## Context

A token 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, tokens 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 tokens, and the billing customer on each one determines who's invoiced for its usage. For roaming, tokens 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, tokens are a channel to sell access to your infrastructure. When a driver presents a valid token at a public, online location, the platform authorises the session and handles the rest.

## Key attributes

| Attribute         | Description                                                                                              | Example                 |
| ----------------- | -------------------------------------------------------------------------------------------------------- | ----------------------- |
| Type              | The token type (see Types below)                                                                         | `RFID`                  |
| UID               | The token's unique identifier. For RFID cards, this is the MiFare UID.                                   | `A7E942F1C8D036B5A429`  |
| Label             | A free-text label for recognising the token in the platform, often the text printed on the physical card | `DE.SPI.00012345`       |
| Billing customer  | The customer in the platform billed for the token's usage                                                | `Acme Inc.`             |
| Billing reference | A free-text reference shown on invoices                                                                  | `Fleet Vehicle #123`    |
| Active            | Whether the token can start sessions on Spirii's network                                                 | `true`                  |
| Roaming           | Whether the token can start sessions over roaming                                                        | `true`                  |
| Expires at        | When the token'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 token's ability to start a session comes from two independent settings: Active (on Spirii's CPO network) and Roaming (over roaming), so a token can have either, both, or neither. An expiry overrides both: once past its `Expires at` date, a token can't authorise sessions regardless of those settings.

## Used in

<CardGroup cols={3}>
  <Card title="Roaming connection" icon="globe" href="/capabilities/roaming/roaming-connection">
    Exchange tokens 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 tokens programmatically.
  </Card>

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