DataTransfer

DataTransfer Both OCPP 2.0.1

Allows vendor-specific or non-standard data exchange between the Charging Station and CSMS. Can be initiated by either side.

Quick Reference

Required Fields

vendorId string(255)

Vendor or organization identifier for the custom message

Optional Fields

messageId string(50)

Optional message identifier within the vendor namespace

data any

The actual data payload — can be a string, object, or array, in any format agreed between vendor and CSMS

Example Payload

{
  "vendorId": "com.example.vendor",
  "messageId": "CustomMeterData",
  "data": {
    "customField1": "value1",
    "energyExported": 0
  }
}

Example Full Frame

[
  2,
  "msg-001",
  "DataTransfer",
  {
    "vendorId": "com.example.vendor",
    "messageId": "CustomMeterData",
    "data": {
      "customField1": "value1",
      "energyExported": 0
    }
  }
]

Format: [MessageType, MessageId, Action, Payload]

Overview

DataTransfer provides an escape hatch for vendor-specific functionality that is not covered by the standard OCPP protocol. Both the Charging Station and the CSMS can initiate a DataTransfer.

When to Use

  • To implement custom meter data formats
  • To send proprietary commissioning or diagnostics data
  • For real-time tariff information not covered by standard messages
  • For any vendor-specific feature that needs OCPP transport

Expected Response

  • status: Accepted, Rejected, UnknownVendorId, or UnknownMessageId
  • data (optional): Response data from the receiver

Usage Notes

  • Use reverse-DNS naming for vendorId to avoid collisions: "com.yourcompany.feature"
  • The data field can be any JSON type — string, object, or array
  • Both parties must agree out-of-band on the vendorId/messageId protocol
  • Prefer standard OCPP messages over DataTransfer when available

Testing Tips

  • Test with a known vendorId and verify Accepted response
  • Test with an unknown vendorId and verify UnknownVendorId response
  • Verify the bidirectional nature: both CS→CSMS and CSMS→CS directions work

Common Errors

PropertyConstraintViolation

Cause: vendorId exceeds 255 characters

Solution: Use a reverse-DNS style vendorId under 255 characters

GenericError

Cause: CSMS does not recognize the vendorId

Solution: CSMS responds with status UnknownVendorId