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

# Reserve a charging key

> Create connection between uid (physical chip id) and visualNumber (called later 'referenceId'), so that the latter can be used for activation.



## OpenAPI

````yaml reference/openapi.json POST /drive/v1/charging-keys/reservations
openapi: 3.1.0
info:
  title: Drive API
  version: 1.0.0
  description: >-
    The Drive API provides comprehensive access to Plugsurfing's charging
    infrastructure network. It enables you to manage users, charging keys,
    search for charging locations, handle payments, and control charging
    sessions.
servers:
  - url: https://{environment}.plugsurfing.com
    variables:
      environment:
        enum:
          - drive-api-stage
        default: drive-api-stage
        description: >-
          API environment - use drive-api-stage for testing and drive-api for
          production
security: []
tags:
  - name: Geosearch
    description: >-
      Search and retrieve detailed information about charging locations and
      stations
  - name: Users
    description: >-
      Manage user accounts including creation, retrieval, updates, and deletion.
      Handles user-specific data and preferences.
  - name: Charging Keys
    description: >-
      Manage physical and virtual charging keys including creation, activation,
      updates, and status management. Essential for user access to charging
      stations.
  - name: Sessions
    description: >-
      Access and manage charging session data including history, status, and
      detailed session information
  - name: Remote Charging
    description: >-
      Control charging sessions remotely including starting and stopping
      sessions, and monitoring session status
  - name: Payment Options
    description: >-
      Manage payment methods and handle transaction processing for charging
      services
  - name: User Groups
    description: Manage user group memberships
  - name: Vouchers
    description: Redeem vouchers
  - name: Charging Key Orders
    description: Handle the ordering and fulfillment process for physical charging keys
  - name: EMP Charging Keys
    description: E-Mobility Provider specific endpoints for managing charging keys
  - name: EMP Geosearch
    description: E-Mobility Provider specific endpoints for location search and information
  - name: EMP Orders
    description: E-Mobility Provider specific endpoints for managing orders
  - name: EMP Sessions
    description: E-Mobility Provider specific endpoints for managing charging sessions
  - name: EMP Fleets
    description: E-Mobility Provider specific endpoints for managing fleets
paths:
  /drive/v1/charging-keys/reservations:
    post:
      tags:
        - Charging Keys
      summary: Reserve a charging key
      description: >-
        Create connection between uid (physical chip id) and visualNumber
        (called later 'referenceId'), so that the latter can be used for
        activation.
      operationId: createChargingKeyReservation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChargingKeyReservationsRequest'
            example:
              amount: 5
              countryCode: DE
              products:
                - RFID_CARD
              userId: 6f36dc9b-446f-462b-aae0-95c7636d5c6c
              language: en
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Provided query parameters, route parameters or body is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestErrorResponse'
              example:
                message: Invalid request payload
                details:
                  - field X is required
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Resource not found
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ChargingKeyReservationsRequest:
      type: object
      required:
        - uid
        - visualNumber
      properties:
        uid:
          type: string
          example: e0e03306
          description: Physical chip id. Must be in hexadecimal, little endian format
        visualNumber:
          type: string
          description: Human-readable identifier written on the rfid card or tag
          example: DE*8PS*FR1RFK*4
        validFrom:
          type: string
          format: date-time
          example: '2022-01-24T11:25:54.210Z'
          description: default - current date
        validTo:
          type: string
          format: date-time
          example: '2032-01-24T11:25:54.210Z'
          description: default - 10 years from 'validFrom' date
        type:
          type: string
          enum:
            - CARD
            - TAG
          default: CARD
          description: this value is just for reference, it has no practical implications
          example: CARD
      description: Request payload to reserve charging key identifiers before activation.
    InvalidRequestErrorResponse:
      title: InvalidRequestErrorResponse
      type: object
      required:
        - message
        - fields
      properties:
        message:
          type: string
        fields:
          type: array
          items:
            title: InvalidField
            type: object
            required:
              - name
              - message
              - rejectedValue
            properties:
              name:
                type: string
              message:
                type: string
                example: UserId is not correct
              rejectedValue:
                type: string
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.