Skip to content

Data Models & Schemas ​

Device Registration (POST /api/device) ​

The device registration endpoint accepts both application/json and multipart/form-data.

Option 1: Plain JSON (no documents) ​

Send device data directly as a JSON body:

http
POST /api/device
Content-Type: application/json
Authorization: Bearer <token>

{
  "externalId": "DEV-001",
  "siteName": "My Solar Site",
  "countryCode": "IN",
  "commissioningDate": "2025-01-15",
  "capacity": 50,
  "address": "123 Solar Lane",
  "latitude": "12.9716",
  "longitude": "77.5946",
  "fuelCode": "ES100",
  "deviceTypeCode": "TC110",
  "organizationId": 1,
  "serialNumber": "SN-001"
}

Option 2: Multipart form-data (with documents) ​

Send device data as a JSON string in the deviceToRegister field, with optional file uploads:

http
POST /api/device
Content-Type: multipart/form-data
Authorization: Bearer <token>

deviceToRegister: '{"externalId":"DEV-001","siteName":"My Solar Site",...}'
FORM_SF_02: <file>         (optional)
SF_02C: <file>             (optional)
METERING_EVIDENCE: <file>  (optional)
SINGLE_LINE_DIAGRAM: <file>(optional)
PROJECT_PHOTOS: <file>     (optional)
COD_PROOF: <file>          (optional)

Each file field accepts up to 10 files.

Required Roles ​

The caller must have one of: OrganizationAdmin, ApiUser.

Document Types ​

Field NameDescription
FORM_SF_02SF-02 application form
SF_02CSF-02C compliance form
METERING_EVIDENCEMetering/measurement evidence
SINGLE_LINE_DIAGRAMSingle line diagram (SLD)
PROJECT_PHOTOSSite/project photographs
COD_PROOFCommercial Operation Date proof

Device Update (PATCH /api/device/:externalId) ​

The device update endpoint also accepts both application/json and multipart/form-data, following the same dual-path pattern. When using multipart, send the device data as a JSON string in the deviceToUpdate field.

All fields are optional — only send the fields you want to change. Unsent fields are left unchanged.

All document file uploads are optional on update.

Device Update by Site Name (PATCH /api/device/by-site/:siteName) ​

Alternative to the serial-number-based update. Looks up the device by its siteName within the caller's organization.

http
PATCH /api/device/by-site/My%20Solar%20Site
Content-Type: application/json
Authorization: Bearer <token>

{
  "organizationId": 1,
  "capacity": 75
}

Accepts the same body and file uploads as PATCH /api/device/:externalId.


Certificate Log (per-device) ​

Each entry in the perDeviceCertificateLog array returned by the certificate endpoints contains:

FieldTypeDescription
idnumberCertificate log record ID
certificate_issuance_startdateISO 8601Start of the certified period
certificate_issuance_enddateISO 8601End of the certified period
readvalue_watthournumberEnergy produced in Wh for this period
statusstringIssuance status
externalIdstringInternal device identifier (UUID)
developerIdstringDeveloper's external reference for the device (e.g. Powertrust Site ID)
serialNumberstringDevice serial number
deviceIdnumberInternal device ID
groupIdnumberDevice group ID
certificateTransactionUIDstringCertificate transaction identifier
timezonestringDevice timezone
ongoing_start_dateISO 8601Ongoing cycle start
ongoing_end_dateISO 8601Ongoing cycle end

Note: developerId is the identifier originally supplied by the device developer during registration (e.g. the Powertrust Site ID). Use this field to correlate certificates with devices in external systems.

Built with VitePress ❤️.