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

# Mark an order as 'Assigned'

> Mark order as 'Assigned'



## OpenAPI

````yaml reference/openapi.json POST /emp/v1/orders/{orderId}/assign
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}/assign:
    post:
      tags:
        - EMP Orders
      summary: Mark an order as 'Assigned'
      description: >-
        Marks an order as assigned. The request body is optional. Some orders
        require physical card details during assignment; for those orders,
        `keyIdentifier` and `referenceId` must be provided in the request body.
      operationId: assignEmpChargingKeyOrder
      parameters:
        - name: orderId
          in: path
          description: orderId to be assigned
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmpChargingKeyOrderAssignRequest'
            example:
              keyIdentifier: 0462D53C8ABAC0
              referenceId: '1234567890123456'
      responses:
        '200':
          description: Assigned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmpChargingKeyOrdersProduct'
              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_PAID
                updated: '2023-06-26T12:00:00Z'
        '400':
          description: >-
            Bad Request. Returned when required card details are missing or
            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Missing or invalid card details.
        '404':
          description: Order is not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Resource not found
        '409':
          description: >-
            Conflict. Returned when the provided card details conflict with an
            existing card assignment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Card details conflict with an existing assignment.
        '500':
          description: Internal Server Error. Returned for unexpected failures.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: An unexpected error occurred.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EmpChargingKeyOrderAssignRequest:
      type: object
      required:
        - keyIdentifier
        - referenceId
      properties:
        keyIdentifier:
          type: string
          description: >-
            RFID UID of the physical card, in the same format that a charging
            station would read from the card.
        referenceId:
          type: string
          description: >-
            Number printed on the physical card itself, also known as the visual
            number.
      description: >-
        Optional request body for assigning an order. Required only when the
        order requires printing.
    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
    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.