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

# Send an ocpp command to an asset (Deprecated)

> This endpoint saves and emits a new ocpp command to the station. It then waits for a response for a maximum of 25 seconds and returns it. If the status of the response body is "Success", then the "confirmation" field will be present. The "confirmation.payload" contains the raw response from the station. If the status is not "Success", then the "error" field will be present containing details of what the error was.
**INFO! This route is deprecated. We now recommend using the [Inject OCPP Raw Request](/api/ocppv2/ocpp/inject-ocpp-raw-request-to-device) endpoint instead.**
**WARNING! This action is potentially dangerous and irreversible!**




## OpenAPI

````yaml /api/specs/assetManagement-api.json post /asset-management/v1/assets/{assetId}/send-command
openapi: 3.0.0
info:
  title: Lynkwell API
  version: 1.376.0
  description: API Documentation for assetManagement service
servers:
  - url: https://api.lynkwell.com
security: []
tags: []
paths:
  /asset-management/v1/assets/{assetId}/send-command:
    post:
      tags:
        - Assets
      summary: Send an ocpp command to an asset (Deprecated)
      description: >
        This endpoint saves and emits a new ocpp command to the station. It then
        waits for a response for a maximum of 25 seconds and returns it. If the
        status of the response body is "Success", then the "confirmation" field
        will be present. The "confirmation.payload" contains the raw response
        from the station. If the status is not "Success", then the "error" field
        will be present containing details of what the error was.

        **INFO! This route is deprecated. We now recommend using the [Inject
        OCPP Raw Request](/api/ocppv2/ocpp/inject-ocpp-raw-request-to-device)
        endpoint instead.**

        **WARNING! This action is potentially dangerous and irreversible!**
      parameters:
        - name: assetId
          in: path
          required: true
          description: The id of the asset to send the command to
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendOCPPCommand'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/OCPPRequest'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetManagementBadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetManagementUnauthorizedError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetManagementNotFoundError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetManagementInternalServerError'
      deprecated: true
      security:
        - oauth2:
            - write:asset
components:
  schemas:
    SendOCPPCommand:
      type: object
      properties:
        action:
          description: The type of OCPP action to be executed
          type: string
          enum:
            - BootNotification
            - Heartbeat
            - MeterValues
            - StatusNotification
            - Authorize
            - StartTransaction
            - StopTransaction
            - DataTransfer
            - DiagnosticsStatusNotification
            - FirmwareStatusNotification
            - SignCertificate
            - GetConfiguration
            - ChangeConfiguration
            - RemoteStartTransaction
            - RemoteStopTransaction
            - Reset
            - UnlockConnector
            - UpdateFirmware
        payload:
          description: JSON string of the ocpp payload based on the action and protocol
          type: string
        protocol:
          description: The OCPP protocol version
          type: string
          enum:
            - OCPP_1_6
      required:
        - action
        - payload
        - protocol
    OCPPRequest:
      type: object
      properties:
        id:
          description: Unique identifier for this command request
          type: string
        assetId:
          type: string
        networkId:
          type: string
        action:
          type: string
          enum:
            - CancelReservation
            - ChangeAvailability
            - ChangeConfiguration
            - ClearCache
            - ClearChargingProfile
            - GetCompositeSchedule
            - GetConfiguration
            - GetDiagnostics
            - GetLocalListVersion
            - RemoteStartTransaction
            - RemoteStopTransaction
            - Reset
            - SendLocalList
            - SetChargingProfile
            - TriggerMessage
            - UnlockConnector
            - UpdateFirmware
            - ReserveNow
            - Authorize
            - BootNotification
            - Heartbeat
            - MeterValues
            - DataTransfer
            - DiagnosticsStatusNotification
            - FirmwareStatusNotification
            - StartTransaction
            - StopTransaction
            - StatusNotification
        request:
          type: object
          properties:
            timestamp:
              type: string
              format: date-time
            payload:
              description: Format depends on the action and protocol
              type: object
        status:
          type: string
          enum:
            - Success
            - Error
            - Invalid
            - NotSupported
            - TimedOut
        confirmation:
          type: object
          required:
            - timestamp
            - payload
          description: This field will be present if the status is "Success"
          properties:
            timestamp:
              type: string
              format: date-time
            payload:
              description: >-
                Structure of the payload depends on the action and protocol of
                the ocpp message
              type: object
        error:
          type: object
          description: This field will be present if the status is not "Success"
          required:
            - timestamp
          properties:
            reason:
              type: string
            timestamp:
              type: string
              format: date-time
        protocol:
          type: string
          enum:
            - OCPP_1_6
      required:
        - id
        - assetId
        - networkId
        - action
        - request
        - protocol
        - status
    AssetManagementBadRequestError:
      type: object
      description: The response body for a 400 request
      properties:
        type:
          type: string
          enum:
            - BAD_REQUEST
        code:
          type: string
          enum:
            - INVALID_REQUEST_PARAMETERS
            - REFERENCE_ERROR
            - UNSUPPORTED_TYPE
            - LOCATION_VALIDATION_ERROR
            - CHARGING_STATION_VALIDATION_ERROR
            - SITE_HOST_VALIDATION_ERROR
            - UTILITY_VALIDATION_ERROR
            - UTILITY_USER_NOT_ALLOWED
            - INVALID_CONTACT_DETAILS
            - CONTACT_DETAILS_ALREADY_EXISTS
            - SITE_PARTNER_USER_ARCHIVED
            - ASSET_NOT_CONNECTED
            - LICENSE_ALREADY_ASSIGNED
            - INVALID_AUTH_METHOD
            - INVALID_ENROLLED_SERVICES
            - UNSUPPORTED_PAYMENT_TERMINAL_PROVIDER
            - UNSUPPORTED_SIM_PROVIDER
            - RATE_IN_USE
            - CHARGING_STATION_MODEL_ARCHIVED
            - OPERATING_SITE_HOST_NOT_FOUND
            - OPERATING_SITE_HOST_INVALID_TYPE
            - OPERATING_SITE_HOST_ARCHIVED
            - LOCATION_ARCHIVED
        message:
          type: string
    AssetManagementUnauthorizedError:
      type: object
      description: The response body for a 401 request
      properties:
        message:
          type: string
    DefaultForbiddenError:
      type: object
      description: The response body for a 403 request
      properties:
        message:
          type: string
    AssetManagementNotFoundError:
      type: object
      description: The response body for a 404 request
      properties:
        type:
          type: string
          enum:
            - NOT_FOUND
        code:
          type: string
          enum:
            - ASSET_NOT_FOUND
            - ASSET_STATUS_NOT_FOUND
            - ASSET_GROUP_NOT_FOUND
            - NETWORK_NOT_FOUND
            - FLEET_NOT_FOUND
            - SECURITY_PROFILE_NOT_FOUND
            - NETWORK_ACCESS_PROFILE_NOT_FOUND
            - SITE_PARTNER_NOT_FOUND
            - SITE_PARTNER_USER_NOT_FOUND
        message:
          type: string
    AssetManagementInternalServerError:
      type: object
      description: The response body for a 500 request
      properties:
        type:
          type: string
          enum:
            - INTERNAL_ERROR
        code:
          type: string
          enum:
            - INTERNAL_SERVER_ERROR
        message:
          type: string
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 Client Credentials Flow
      flows:
        clientCredentials:
          tokenUrl: https://lynkwell-prod.us.auth0.com/oauth/token
          scopes:
            read:asset: Retrieve assets
            write:asset: Create and update assets
            read:assetgroup: Retrieve asset groups
            write:assetgroup: Create and update asset groups
            read:assetstatus: Retrieve asset statuses
            read:chargingstationmodel: Retrieve charging station models
            write:chargingstationmodel: Create and update charging station models
            write:network: Create and update networks
            write:sitepartner: Create and update site partners
            read:sitepartner: Retrieve site partners
            write:sitepartneruser: Create and update site partner users
            read:sitepartneruser: Retrieve site partner users
            read:networkaccessprofile: Retrieve network access profiles
            write:paymentprofile: Create payment profile
            write:onboardinglink: Create an onboarding link
            read:invoice: Retrieve an invoice
            write:session: Create or update a session
            read:session: Retrieve a session
            write:ticket: Create a ticket
            write:verificationcode: Send and confirm verification codes
            write:driver: Create and update drivers
            read:driver: Retrieve drivers
            write:token: Create and update tokens
            read:token: Retrieve tokens
            read:tokenvalue: Retrieve token by ID including its value
            write:invitecode: Create and update invite codes
            write:invitation: Create and update invitations
            read:invitation: Retrieve invitations
            read:payment_terminals_payment: Read payments from payment terminal
            abort:session: Abruptly end session
            read:paymentprofile: Retrieve payment profile from payment terminal
            write:ocpp: Sends request over OCPP
            write:ocpp.raw_request: Sends raw request over OCPP
            write:notification.email: Create and update email
            read:invoiceitem: Retrieve invoice item
            read:subscription: Retrieve subscription
            write:plugandcharge_enrollment: Update Plug and Charge enrollment status
            write:projects: Create and update projects
            read:projects: Retrieve projects
            write:project_stations: Create and update project stations
            write:panel: Create and update panels.
            read:panel: Retrieve panels.
            write:webhooks: Create, update, and delete webhooks
            read:webhooks: Retrieve webhooks

````