Skip to main content
POST
/
v2
/
tokens
Create a new token
curl --request POST \
  --url https://api.spirii.com/v2/tokens \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": 67890,
  "identifier": {
    "type": "rfid",
    "uid": "A7E942F1C8D036B5A429",
    "label": "DK.SPI.V03198",
    "appUserId": 12345
  },
  "validFrom": "2025-06-03T12:00:00.000Z",
  "expiresAt": "2025-12-31T23:59:59.999Z",
  "isActive": true,
  "roamingEnabled": true,
  "priorityChargingEnabled": true,
  "billingReference": "Bil 246",
  "comment": "This is a comment"
}
'
{
  "id": 67890,
  "customerId": 67890,
  "identifier": {
    "type": "rfid",
    "uid": "A7E942F1C8D036B5A429",
    "label": "DK.SPI.V03198",
    "appUserId": 12345
  },
  "createdAt": "2025-06-03T12:00:00.000Z",
  "updatedAt": "2025-06-03T12:00:00.000Z",
  "validFrom": "2025-06-03T12:00:00.000Z",
  "expiresAt": "2025-12-31T23:59:59.999Z",
  "isActive": true,
  "roamingEnabled": true,
  "priorityChargingEnabled": true,
  "billingReference": "Bil 246",
  "comment": "This is a comment",
  "tokenGroupIds": [
    1,
    2,
    5
  ]
}

Authorizations

Authorization
string
header
required

Authorization: Bearer <SPIRII_API_KEY>

Body

application/json

Token(s) to be created. Content body can be a single or a list of tokens.

customerId
number<integer>
required

Unique identifier of the associated billing customer. Generally, the owner of the token and the entity that receives the monthly billing in case no credit card is attached to the token. Ensure the right customerId for the right entity to be billed.

Example:

67890

identifier
object
required

Token identifier information.

validFrom
string<date-time>

Date and time from when the token can be used (ISO-8601 format). Defaults to current time if not provided.

Example:

"2025-06-03T12:00:00.000Z"

expiresAt
string<date-time> | null

Date and time when the token expires (ISO-8601 format).

Example:

"2025-12-31T23:59:59.999Z"

isActive
boolean
default:true

Indicates if the token is currently active.

Example:

true

roamingEnabled
boolean
default:true

Indicates if roaming is enabled for this token.

Example:

true

priorityChargingEnabled
boolean

Enables priority charging on the operator owned locations if set to true.

Example:

true

billingReference
string | null

Reference used for billing purposes. This is a free field and can, for instance, be a billing reference on invoices or a cost centre reference. Leaving it empty, means it won't show on Spirii-generated billing documents.

Maximum string length: 100
Example:

"Bil 246"

comment
string | null

Optional comment about the token.

Maximum string length: 100
Example:

"This is a comment"

Response

Token created successfully. The response can be a single token or a list of tokens depending of the provided body.

id
number<integer>
required
read-only

Used to identify the token throughout the Spirii system.

Example:

67890

customerId
number<integer>
required

Unique identifier of the associated billing customer. Generally, the owner of the token and the entity that receives the monthly billing in case no credit card is attached to the token. Ensure the right customerId for the right entity to be billed.

Example:

67890

identifier
object
required

Token identifier information.

createdAt
string<date-time>
required
read-only

The date and time when the token was created.

Example:

"2025-06-03T12:00:00.000Z"

updatedAt
string<date-time>
required
read-only

The date and time when the token was last updated.

Example:

"2025-06-03T12:00:00.000Z"

validFrom
string<date-time>

Date and time from when the token can be used (ISO-8601 format). Defaults to current time if not provided.

Example:

"2025-06-03T12:00:00.000Z"

expiresAt
string<date-time> | null

Date and time when the token expires (ISO-8601 format).

Example:

"2025-12-31T23:59:59.999Z"

isActive
boolean
default:true

Indicates if the token is currently active.

Example:

true

roamingEnabled
boolean
default:true

Indicates if roaming is enabled for this token.

Example:

true

priorityChargingEnabled
boolean

Enables priority charging on the operator owned locations if set to true.

Example:

true

billingReference
string | null

Reference used for billing purposes. This is a free field and can, for instance, be a billing reference on invoices or a cost centre reference. Leaving it empty, means it won't show on Spirii-generated billing documents.

Maximum string length: 100
Example:

"Bil 246"

comment
string | null

Optional comment about the token.

Maximum string length: 100
Example:

"This is a comment"

tokenGroupIds
number[]

List of token group IDs this token belongs to (returned only when requested).

Example:
[1, 2, 5]