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

# Create a fleet charging key order

> Creates a charging key order for a fleet organization.



## OpenAPI

````yaml reference/openapi.json POST /emp/v1/orders
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:
    post:
      tags:
        - EMP Orders
      summary: Create a fleet charging key order
      description: >-
        Creates a charging key order for a fleet organization. One request
        creates one card order. The `printing` payload requirements come from
        product discovery and are validated by the fulfilment system.
      operationId: createEmpChargingKeyOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmpCreateChargingKeyOrderRequest'
            example:
              fleetId: fleet-123
              productId: Nk375yz7Gw
              address:
                firstName: Jane
                lastName: Doe
                addressLine1: Example Street 1
                addressLine2: Floor 2
                postalCode: '00100'
                city: Helsinki
                country: FI
                companyName: Example Ltd
              printing:
                driverName: Jane Doe
                licensePlate: FI000AA
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmpChargingKeyOrdersProduct'
              example:
                id: aYnky297eG
                address:
                  country: FI
                  firstName: Jane
                  lastName: Doe
                  city: Helsinki
                  postalCode: '00100'
                  companyName: Example Ltd
                  addressLine1: Example Street 1
                  addressLine2: Floor 2
                quantity: 1
                language: en
                product:
                  id: Nk375yz7Gw
                created: '2024-01-15T10:00:00Z'
                organizationId: JoEl1xoP7r
                status: ORDER_PAID
                updated: '2024-01-15T10:00:00Z'
                printing:
                  variables:
                    driverName: Jane Doe
                    licensePlate: FI000AA
        '400':
          description: >-
            Bad Request. Returned when required fields are missing, the request
            body is malformed JSON, or the printing payload fails product
            validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: 'Missing required field: productId'
        '404':
          description: >-
            Not Found. Returned when the fleetId does not exist or the productId
            is not recognised.
          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:
    EmpCreateChargingKeyOrderRequest:
      type: object
      required:
        - fleetId
        - productId
        - address
      properties:
        fleetId:
          type: string
          example: fleet-123
          description: >-
            Customer-provided fleet identifier. Must match the value used when
            the fleet was created via `POST /emp/v1/fleets`.
        productId:
          type: string
          example: Nk375yz7Gw
          description: Encoded public product ID as returned by `GET /emp/v1/products`.
        address:
          $ref: '#/components/schemas/ChargingKeyOrderAddressRequest'
          description: Delivery address for the order.
        printing:
          type: object
          additionalProperties: true
          description: >-
            Optional printing payload. Requirements are product-specific — use
            the `printing.schema` from product discovery to build and validate
            this object before submitting. Drive API forwards this payload
            unchanged to the fulfilment system.
          example:
            driverName: Jane Doe
            licensePlate: FI000AA
      description: Request body for creating a fleet charging key order.
    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.
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        message:
          type: string
    ChargingKeyOrderAddressRequest:
      title: ChargingKeyOrderAddressRequest
      type: object
      required:
        - addressLine1
        - postalCode
        - city
        - country
      properties:
        companyName:
          type: string
          maxLength: 130
          example: Plugsurfing
          description: Company name for business delivery addresses.
        firstName:
          type: string
          maxLength: 130
          example: John
          description: Recipient first name.
        lastName:
          type: string
          maxLength: 130
          example: Drive
          description: Recipient last name.
        addressLine1:
          type: string
          minLength: 1
          maxLength: 100
          example: Automation road 1
          description: Primary street address line.
        addressLine2:
          type: string
          example: Park spot 1
          description: Secondary address line such as apartment or suite.
        postalCode:
          type: string
          minLength: 1
          maxLength: 10
          example: EV1234
          description: Postal or ZIP code.
        city:
          type: string
          minLength: 1
          maxLength: 50
          example: Spark City
          description: City name.
        country:
          type: string
          minLength: 1
          maxLength: 41
          example: SE
          description: Country code in ISO 3166-1 alpha-2 format.
      description: Shipping address used when placing a charging key order.
    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
  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.