ampr docs

Tokens

Driver authorization tokens (RFID / app / virtual idTags)

GET /tokens List tokens

Parameters

Name In Type Required Description
page query integer
per_page query integer

Responses

200 Token list

PropertyTypeRequiredDescription
dataarray<Token>
PropertyTypeRequiredDescription
idstringrequired
uidstringrequiredPhysical RFID uid / MIFARE / virtual string the charger presents as OCPP idTag. Unique per org.
typeenum
  • rfid
  • app
  • other
required
validbooleanrequiredWhether this token may currently authorize a charging session.
driver_idstringnullableThe driver this token is linked to (see `PUT /tokens/{token_id}/driver`), or null.
labelstringnullableHuman-friendly label (e.g. driver name).
issuer_party_idstringnullableOCPI party id of the issuer; null for CPO-native tokens.
created_atstringformat: date-timerequired
paginationPagination
PropertyTypeRequiredDescription
totalintegerrequired
pageintegerrequired
per_pageintegerrequired
has_morebooleanrequired

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

Request example

curl -X GET "https://api.ampr.dev/v1/tokens" \
  -H "Authorization: Bearer $AMPR_API_KEY"
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

POST /tokens Pre-register a driver token

Pre-register a driver token (fleet card) into the org allowlist before charger cutover. Strict insert — a duplicate (org, uid) returns 409.

Request body

PropertyTypeRequiredDescription
uidstringrequiredRFID uid / MIFARE / virtual idTag; non-empty, bounded length + charset.
typeenum
  • rfid
  • app
  • other
validboolean
labelstring

Responses

201 Token created

PropertyTypeRequiredDescription
dataToken
PropertyTypeRequiredDescription
idstringrequired
uidstringrequiredPhysical RFID uid / MIFARE / virtual string the charger presents as OCPP idTag. Unique per org.
typeenum
  • rfid
  • app
  • other
required
validbooleanrequiredWhether this token may currently authorize a charging session.
driver_idstringnullableThe driver this token is linked to (see `PUT /tokens/{token_id}/driver`), or null.
labelstringnullableHuman-friendly label (e.g. driver name).
issuer_party_idstringnullableOCPI party id of the issuer; null for CPO-native tokens.
created_atstringformat: date-timerequired

400 Invalid request parameters application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

409 Resource conflict (e.g., duplicate serial, active session) application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

Request example

curl -X POST "https://api.ampr.dev/v1/tokens" \
  -H "Authorization: Bearer $AMPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "string",
    "type": "rfid",
    "valid": true,
    "label": "string"
  }'
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

GET /tokens/{token_id} Get a token

Parameters

Name In Type Required Description
token_id path string required

Responses

200 Token detail

PropertyTypeRequiredDescription
dataToken
PropertyTypeRequiredDescription
idstringrequired
uidstringrequiredPhysical RFID uid / MIFARE / virtual string the charger presents as OCPP idTag. Unique per org.
typeenum
  • rfid
  • app
  • other
required
validbooleanrequiredWhether this token may currently authorize a charging session.
driver_idstringnullableThe driver this token is linked to (see `PUT /tokens/{token_id}/driver`), or null.
labelstringnullableHuman-friendly label (e.g. driver name).
issuer_party_idstringnullableOCPI party id of the issuer; null for CPO-native tokens.
created_atstringformat: date-timerequired

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

Request example

curl -X GET "https://api.ampr.dev/v1/tokens/trk_example" \
  -H "Authorization: Bearer $AMPR_API_KEY"
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

PATCH /tokens/{token_id} Update a token

Toggle `valid` (e.g. block a lost card) or edit `label`.

Parameters

Name In Type Required Description
token_id path string required

Request body

PropertyTypeRequiredDescription
validboolean
labelstringnullable

Responses

200 Token updated

PropertyTypeRequiredDescription
dataToken
PropertyTypeRequiredDescription
idstringrequired
uidstringrequiredPhysical RFID uid / MIFARE / virtual string the charger presents as OCPP idTag. Unique per org.
typeenum
  • rfid
  • app
  • other
required
validbooleanrequiredWhether this token may currently authorize a charging session.
driver_idstringnullableThe driver this token is linked to (see `PUT /tokens/{token_id}/driver`), or null.
labelstringnullableHuman-friendly label (e.g. driver name).
issuer_party_idstringnullableOCPI party id of the issuer; null for CPO-native tokens.
created_atstringformat: date-timerequired

400 Invalid request parameters application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

Request example

curl -X PATCH "https://api.ampr.dev/v1/tokens/trk_example" \
  -H "Authorization: Bearer $AMPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "valid": true,
    "label": "string"
  }'
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

PUT /tokens/{token_id}/driver Link a token to a driver

Links the token (RFID or app credential) to a driver of the same organization so settlement charges the driver's saved payment method. A driver may own many tokens. Operator role or higher. Idempotent for the same driver. A token already linked to a different driver returns `409` (`token_already_linked`); an erased driver returns `409` (`driver_erased`). A token or driver of another organization is a `404`.

Parameters

Name In Type Required Description
token_id path string required

Request body

PropertyTypeRequiredDescription
driver_idstringrequired

Responses

200 Token linked

PropertyTypeRequiredDescription
dataToken
PropertyTypeRequiredDescription
idstringrequired
uidstringrequiredPhysical RFID uid / MIFARE / virtual string the charger presents as OCPP idTag. Unique per org.
typeenum
  • rfid
  • app
  • other
required
validbooleanrequiredWhether this token may currently authorize a charging session.
driver_idstringnullableThe driver this token is linked to (see `PUT /tokens/{token_id}/driver`), or null.
labelstringnullableHuman-friendly label (e.g. driver name).
issuer_party_idstringnullableOCPI party id of the issuer; null for CPO-native tokens.
created_atstringformat: date-timerequired

400 Invalid request parameters application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

403 Authenticated but not authorized for this action (insufficient role) application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

409 Resource conflict (e.g., duplicate serial, active session) application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

Request example

curl -X PUT "https://api.ampr.dev/v1/tokens/trk_example/driver" \
  -H "Authorization: Bearer $AMPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "driver_id": "drv_example"
  }'
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

DELETE /tokens/{token_id}/driver Unlink a token from its driver

Operator role or higher. Idempotent (`204` whether or not the token was linked).

Parameters

Name In Type Required Description
token_id path string required

Responses

204 Unlinked

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

403 Authenticated but not authorized for this action (insufficient role) application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable
codestringStable machine-readable problem code, present on problems a client is expected to branch on (for example `org_payments_not_ready`, `driver_erased`, `token_already_linked`, `payment_method_not_active`, `idempotency_key_required`, `idempotency_key_reused`, `provider_unavailable`, `publishable_key_not_configured`).

Request example

curl -X DELETE "https://api.ampr.dev/v1/tokens/trk_example/driver" \
  -H "Authorization: Bearer $AMPR_API_KEY"
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.