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

# Fetch a charging key order

> Returns a single charging key order, including the charging keys of its manufactured cards.



## OpenAPI

````yaml reference/openapi.json GET /emp/v1/orders/{orderId}
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:
  /emp/v1/orders/{orderId}:
    get:
      tags:
        - EMP Orders
      summary: Fetch a charging key order
      description: >-
        Returns a single charging key order by ID. The response contains the
        same fields as an item returned by `GET /emp/v1/orders`, plus an
        optional `chargingKeys` array with the charging keys of the cards
        manufactured for the order so far. `chargingKeys` is omitted until the
        first card has been manufactured. Orders that do not exist or are not
        accessible to the caller return `404`.
      operationId: getEmpChargingKeyOrder
      parameters:
        - name: orderId
          in: path
          description: ID of the order to fetch
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmpChargingKeyOrderWithChargingKeys'
              example:
                id: aYnky297eG
                address:
                  country: Austria
                  additionalInformation: test test
                  firstName: Frans
                  lastName: Anderson
                  city: Wistful Vista
                  postalCode: '85960'
                  companyName: Low area Corp.
                  addressLine1: First Way 261b
                  addressLine2: Suite 9
                quantity: 1
                language: en
                product:
                  id: Am07b6Q7JZ
                created: '2023-06-26T10:00:00Z'
                organizationId: JoEl1xoP7r
                status: ORDER_ASSIGNED
                updated: '2023-06-26T12:00:00Z'
                chargingKeys:
                  - name: SE6F1K2C3
                    keyIdentifier: 0462D53C8ABAC0
                    fleetId: fleet-123
                    contractId: DE-9FS-C045DS363-E
                    visualNumber: '1234567890123456'
                    enabled: false
                    whitelist: NEVER
        '404':
          description: Order is not found or is not accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Resource not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: An unexpected error occurred.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EmpChargingKeyOrderWithChargingKeys:
      allOf:
        - $ref: '#/components/schemas/EmpChargingKeyOrdersProduct'
        - type: object
          properties:
            chargingKeys:
              type: array
              items:
                $ref: '#/components/schemas/EmpChargingKeyResponse'
              description: >-
                Charging keys of the cards manufactured for this order. Omitted
                until the first card has been manufactured.
      description: >-
        A single EMP charging key order, including the charging keys of its
        manufactured cards.
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        message:
          type: string
    EmpChargingKeyOrdersProduct:
      required:
        - id
        - address
        - quantity
        - language
        - product
        - created
        - organizationId
        - status
        - updated
      type: object
      properties:
        id:
          type: string
          example: aYnky297eG
          description: Unique identifier of the order product.
        address:
          $ref: '#/components/schemas/EmpChargingKeyOrdersProductAddress'
          description: Delivery address for this order product.
        quantity:
          type: number
          example: 1
          description: Number of product units ordered.
        language:
          type: string
          example: en
          description: Language used for order communication.
        product:
          type: object
          properties:
            id:
              type: string
              example: Am07b6Q7JZ
          description: Ordered product code or type.
        created:
          type: string
          format: date-time
          example: '2023-06-26T10:00:00Z'
          description: UTC timestamp when this product order was created.
        organizationId:
          type: string
          example: JoEl1xoP7r
          description: Identifier of the organization that placed the order.
        status:
          $ref: '#/components/schemas/ChargingKeyOrderStatus'
          description: Current processing status of the order product.
        updated:
          type: string
          format: date-time
          example: '2023-06-26T12:00:00Z'
          description: UTC timestamp when this product order was last updated.
        printing:
          type: object
          description: >-
            Printing details associated with the order product. Present only for
            orders that include physical card customization.
          required:
            - variables
          properties:
            variables:
              type: object
              additionalProperties:
                type: string
              description: >-
                Print-specific values associated with the order, for example
                values used on a customized physical card.
            color:
              type:
                - string
                - 'null'
              enum:
                - BLACK
                - WHITE
                - null
              description: >-
                Card template color agreed for the product/order. It is not
                selected by the end customer while placing the order.
      description: EMP charging key order product details.
    EmpChargingKeyResponse:
      properties:
        name:
          type: string
          example: SE6F1K2C3
          description: Name of the Charging key
        keyIdentifier:
          type: string
          example: 3633e0e0
          description: >-
            Charging key identifier in hexadecimal, little-endian format with
            usually 8 or 14 characters.
        validTo:
          type: string
          format: date-time
          example: '2022-01-24T11:25:54.210Z'
          description: UTC timestamp when the charging key expires.
        fleetId:
          type: string
          example: y1nNLJqb7m
          description: Fleet id
        contractId:
          type: string
          example: DE-9FS-C045DS363-E
          description: Charging key contract id
        visualNumber:
          type: string
          example: '6285629402937'
          description: Identifier printed on the physical key
        enabled:
          type: boolean
          example: true
          description: Charging key is enabled or disabled
        whitelist:
          $ref: '#/components/schemas/DriveApiChargingKeyWhitelistType'
          description: >-
            Defines whether the CPO may allow a session for this charging key
            when it cannot get a response from the EMP, or must always rely on
            realtime authorization from the EMP. Possible values:
            ALLOWED_OFFLINE, NEVER.
          example: NEVER
      description: EMP charging key details returned by key management endpoints.
    EmpChargingKeyOrdersProductAddress:
      type: object
      properties:
        country:
          type: string
          example: Austria
          description: Country code in ISO 3166-1 alpha-2 format.
        additionalInformation:
          type: string
          example: test test
          description: Additional delivery instructions.
        firstName:
          type: string
          example: Frans
          description: Recipient first name.
        lastName:
          type: string
          example: Anderson
          description: Recipient last name.
        city:
          type: string
          example: Wistful Vista
          description: City name.
        postalCode:
          type: string
          example: '85960'
          description: Postal or ZIP code.
        companyName:
          type: string
          example: Low area Corp.
          description: Company name for business delivery addresses.
        addressLine1:
          type: string
          example: First Way 261b
          description: Primary street address line.
        addressLine2:
          type: string
          example: Suite 9
          description: Secondary address line such as apartment or suite.
      description: Delivery address for an EMP charging key order product.
    ChargingKeyOrderStatus:
      type: string
      description: ORDER_PAID -> orders ready to be fulfilled
      enum:
        - WAITING_FOR_ORDER
        - ORDER_PLACED
        - ORDER_PROCESSING
        - ORDER_ASSIGNED
        - ORDER_PAID
        - ORDER_CANCELLED
        - ORDER_CANCELLING
        - ORDER_PAYMENT_FAILED
        - ORDER_REFUND_FAILED
        - ORDER_WAITING_REFUND
        - ORDER_REFUNDED
        - PAYMENT_ONGOING
        - ORDER_FILLED
        - ORDER_PAYED
        - PREPARE_RECEIPT
        - ORDER_PAYED_WITHOUT_RECEIPT
      example: ORDER_PAID
    DriveApiChargingKeyWhitelistType:
      type: string
      enum:
        - ALLOWED_OFFLINE
        - NEVER
      description: >-
        Defines when authorization of a charging key by the CPO is allowed.

        ALLOWED_OFFLINE: CPO should use realtime authorization. But when the CPO
        cannot get a response from the eMSP, the CPO shall allow the charging
        key to be used.

        NEVER: Only realtime authorization is allowed. CPO shall always send a
        realtime authorization for any use of this charging key to the MSP.
  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.