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

# Inject OCPP raw request to device

> This endpoint injects an OCPP raw request to the device.



## OpenAPI

````yaml /api/specs/ocpp-v2-api.json post /ocpp/v2/raw-request
openapi: 3.0.0
info:
  title: Lynkwell API
  version: 1.376.0
  description: API Documentation for ocpp-v2 service
servers:
  - url: https://api.lynkwell.com
security: []
tags: []
paths:
  /ocpp/v2/raw-request:
    post:
      tags:
        - OCPP
      summary: Inject OCPP raw request to device
      description: This endpoint injects an OCPP raw request to the device.
      parameters: []
      requestBody:
        description: Request body containing the data need to send a request to the station
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OcppRawRequestParams'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OcppRawRequestResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OcppRawRequestHttpError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OcppRawRequestHttpError'
      security:
        - oauth2:
            - write:ocpp.raw_request
components:
  schemas:
    OcppRawRequestParams:
      type: object
      required:
        - assetId
        - action
        - payload
      properties:
        action:
          description: The name of the action to be executed
          type: string
          enum:
            - CancelReservation
            - ChangeAvailability
            - ChangeConfiguration
            - ClearCache
            - ClearChargingProfile
            - DataTransfer
            - GetCompositeSchedule
            - GetConfiguration
            - GetDiagnostics
            - GetLocalListVersion
            - RemoteStartTransaction
            - RemoteStopTransaction
            - ReserveNow
            - Reset
            - SendLocalList
            - SetChargingProfile
            - TriggerMessage
            - UnlockConnector
            - UpdateFirmware
            - CertificateSigned
            - ClearDisplayMessage
            - ClearVariableMonitoring
            - CostUpdated
            - CustomerInformation
            - DeleteCertificate
            - GetBaseReport
            - GetChargingProfiles
            - GetDisplayMessages
            - GetInstalledCertificateIds
            - GetLog
            - GetMonitoringReport
            - GetReport
            - GetTransactionStatus
            - GetVariables
            - InstallCertificate
            - PublishFirmware
            - RequestStartTransaction
            - RequestStopTransaction
            - SetDisplayMessage
            - SetMonitoringBase
            - SetMonitoringLevel
            - SetNetworkProfile
            - SetVariableMonitoring
            - SetVariables
            - UnpublishFirmware
        assetId:
          description: The id of the asset to send the request to
          type: string
        payload:
          description: The payload to be sent to the asset
          type: object
          additionalProperties: true
        network:
          description: The network to send the request to
          type: object
          required:
            - id
          properties:
            id:
              description: The id of the network to send the request to
              type: string
        async:
          description: >-
            Whether the request should be sent asynchronously. If false, the
            data will be present in the response
          type: boolean
          default: true
        requestId:
          description: >-
            An optional request ID that will be used as the OCPP message ID. If
            not provided one will be generated.
          type: string
        injectActiveTransactionId:
          description: >-
            When true and the request is an OCPP 1.6 SetChargingProfile with a
            TxProfile purpose and no transactionId, the active transaction on
            the targeted connector is resolved and its id is set as
            csChargingProfiles.transactionId. For v2-native stations this
            happens in this API (responding 400 NO_ACTIVE_TRANSACTION when the
            connector has no ongoing transaction); for gateway-connected
            stations the ocpp processor injects the id as the command passes
            through it. Any other request passes through unchanged.
          type: boolean
          default: false
    OcppRawRequestResponse:
      anyOf:
        - type: object
          required:
            - status
            - async
            - ocppMessageId
          properties:
            status:
              description: The status of the response
              type: string
              enum:
                - Success
            async:
              description: >-
                Whether the request was sent asynchronously, if it is false, the
                data will be present in the response otherwise data will be .
              type: boolean
            ocppMessageId:
              description: The id of the OCPP message
              type: string
            data:
              description: The data of the response
              type: object
              required:
                - connection
                - request
                - response
                - ocppMessageId
              properties:
                ocppMessageId:
                  description: The id of the OCPP message
                  type: string
                connection:
                  description: The connection of the response
                  type: object
                  required:
                    - connectionId
                    - protocol
                  properties:
                    connectionId:
                      description: The id of the connection
                      type: string
                    protocol:
                      description: The protocol of the connection
                      type: string
                      enum:
                        - ocpp2.0.1
                        - ocpp1.6
                request:
                  description: The request of the response
                  type: object
                  required:
                    - messageType
                    - messageId
                    - action
                    - payload
                  properties:
                    messageType:
                      description: The type of the message
                      type: string
                      enum:
                        - '2'
                    messageId:
                      description: The id of the message
                      type: string
                    action:
                      description: OCPP action
                      type: string
                    payload:
                      description: The payload of the message
                      type: object
                      additionalProperties: true
                response:
                  description: The response of the response
                  type: object
                  required:
                    - messageType
                    - messageId
                    - errorCode
                    - ErrorDescription
                    - errorDetails
                  properties:
                    messageType:
                      description: The type of the message
                      type: string
                      enum:
                        - CALL_ERROR
                        - CALL_RESULT
                    messageId:
                      description: The id of the message
                      type: string
                    errorCode:
                      description: The error code of the message
                      type: string
                    ErrorDescription:
                      description: The error description of the message
                      type: string
                    errorDetails:
                      description: The error details of the message
                      type: object
                      additionalProperties: true
                    payload:
                      description: The payload of the message
                      type: object
                      additionalProperties: true
        - type: object
          required:
            - status
            - errorCode
            - reason
            - ocppMessageId
          properties:
            ocppMessageId:
              description: The id of the OCPP message
              type: string
            status:
              description: The status of the response
              type: string
              enum:
                - Error
            errorCode:
              description: The error code of the response
              type: string
              enum:
                - InvalidMessage
                - InvalidMessageId
                - OcppRequestNotSupported
                - DeviceTypeNotSupported
                - ConnectionClosed
                - InternalError
                - CallTimeout
                - CallFlushed
                - MaxPendingCallReached
            reason:
              description: The reason of the response
              type: string
            data:
              description: >-
                The data of the response. if data is present, the request was
                sent to the asset.
              type: object
              required:
                - connection
                - request
              properties:
                connection:
                  description: The connection of the response
                  type: object
                  required:
                    - connectionId
                    - protocol
                  properties:
                    connectionId:
                      description: The id of the connection
                      type: string
                    protocol:
                      description: The protocol of the connection
                      type: string
                      enum:
                        - ocpp2.0.1
                        - ocpp1.6
                request:
                  description: The request of the response
                  type: object
                  required:
                    - messageType
                    - messageId
                    - action
                    - payload
                  properties:
                    messageType:
                      description: The type of the message
                      type: string
                      enum:
                        - '2'
                    messageId:
                      description: The id of the message
                      type: string
                    action:
                      description: OCPP action
                      type: string
                    payload:
                      description: The payload of the message
                      type: object
                      additionalProperties: true
    OcppRawRequestHttpError:
      type: object
      properties:
        type:
          description: The type of the response
          type: string
        code:
          description: The code of the response
          type: string
        message:
          description: The message of the response
          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

````