Skip to content

SolarUser Account API

Matt Magoffin edited this page Sep 29, 2026 · 1 revision

The SolarUser Account API provides methods to manage SolarNetwork account subscription details. All requests must provide a valid user authentication token. See SolarNet API authentication for information on how to use authentication tokens.

Registering an account subscribes the user to SolarNetwork invoicing, and records the billing address, currency, and locale that invoices are generated with. Registration also grants the feature entitlements the user requests, which unlock optional SolarNetwork services such as SolarOCPP or datum export.

Billing systems

Every SolarNetwork account is held by a billing system, identified by an accounting system key. The account details returned by this API are defined by the billing system holding the account, so the shape of the account object in a response depends on the systemKey value that accompanies it.

At present SolarNetwork offers a single billing system, snf, and all accounts are created in it. The account objects returned today are therefore always SNF account objects. Clients should treat systemKey as the discriminator for interpreting the account object, so they continue to work if other billing systems are added.

The request objects accepted by this API are the same for all billing systems.

Date formatting

For endpoints that return timestamp values (full date and time) the timestamps will be rendered as string values using the ISO 8601 timestamp format YYYY-MM-dd HH:mm:ss.SSSSSS'Z' in the UTC time zone, for example 2020-03-01 10:30:49.346827Z. The fractional second can contain up to 6 digits for nanosecond level precision, and will only display up to the precision set in the timestamp. That means the fractional seconds might not appear if the timestamp has no fractional seconds.

For endpoints that accept timestamp values, the same ISO 8601 timestamp format is required, however the fractional seconds may be omitted. For example 2020-03-01 10:30:49Z is a valid value. The standard ISO 8601 T date/time separator is accepted as well, so 2020-03-01T10:30:49Z is also a valid value. A UTC offset other than Z may be provided, and will be normalized to UTC, so 2020-03-01T23:30:49+13:00 is another way of expressing the same value.

All dates and times are represented in the Gregorian calendar system.

Account objects

Account info

Every endpoint in this API returns an account info object, which pairs the account details with the billing system that defines them.

Property Type Description
systemKey string The accounting system key of the billing system holding the account.
account object The account details, in the form defined by the billing system named by systemKey. See SNF account.
entitlements array The feature entitlements granted to the user.

Account input

The request body accepted when registering or updating an account. This object is the same for all billing systems.

Property Type Description
systemKey string The accounting system key of the billing system to create the account in. Optional; if omitted the default billing system is used. Ignored when updating an account.
account object Required. The account details.
address object Required. The billing address details.
requestedEntitlements array The feature entitlements to grant. Optional; if omitted or empty, no entitlements are granted.

⚠️ NOTE: the requestedEntitlements value replaces the set of entitlements granted to the user. Omitting an entitlement that was previously granted revokes it, and omitting the property entirely revokes all of them. Always submit the complete set you want the user to have.

Account input details

The account property of an account input object.

Property Type Description
currency string Required. The currency to invoice in, as an ISO 4217 currency code. See supported currency.
locale string Required. The locale to generate invoices in, as a BCP 47 language tag, for example en-NZ.

Address input details

The address property of an account input object.

Property Type Description
name string Required. The name to address invoices to.
email string Required. The email address to send invoices to. Must be a valid email address.
street array Required. The street address lines, as an array of strings. At least one non-blank line must be provided; blank lines are discarded.
locality string The city or town.
stateOrProvince string The state or province.
region string The region.
postalCode string The postal code.
country string Required. The country, as an ISO 3166-1 alpha-2 country code, for example NZ.
timeZoneId string Required. The time zone invoice periods are calculated in, as a time zone ID, for example Pacific/Auckland.

An example account input object looks like this:

{
  "account" : {
    "currency" : "NZD",
    "locale" : "en-NZ"
  },
  "address" : {
    "name" : "Tester Dude",
    "email" : "billing@example.com",
    "street" : ["Level 1", "123 Main Street"],
    "locality" : "Wellington",
    "stateOrProvince" : "Wellington",
    "region" : "Wellington",
    "postalCode" : "6011",
    "country" : "NZ",
    "timeZoneId" : "Pacific/Auckland"
  },
  "requestedEntitlements" : ["OCPP"]
}

SNF account objects

The objects described in this section are the account details returned when systemKey is snf. See billing systems for more information.

SNF account

Property Type Description
userId number The unique ID of the user the account belongs to.
accountId number The unique ID of the account.
created string The date the account was created, for example 2026-09-30 02:17:42.221539Z. See date formatting.
currencyCode string The currency invoices are generated in, as an ISO 4217 currency code.
locale string The locale invoices are generated in, as a BCP 47 language tag.
address object The billing address.

SNF address

Property Type Description
userId number The unique ID of the user the address belongs to.
addressId number The unique ID of the address.
created string The date the address was created, for example 2026-09-30 02:17:42.198043Z. See date formatting.
name string The name invoices are addressed to.
email string The email address invoices are sent to.
street array The street address lines, as an array of strings.
locality string The city or town.
stateOrProvince string The state or province.
region string The region.
country string The country, as an ISO 3166-1 alpha-2 country code.
postalCode string The postal code.
timeZoneId string The time zone invoice periods are calculated in, as a time zone ID.

⚠️ NOTE: an address record is never modified once created. When an account update changes any address property, a new address record is created and the account is pointed at it, so the addressId value changes. When the submitted address is identical to the existing one, the existing record is retained and addressId is unchanged.

Enumerated types

Accounting system key

Key Description
snf SolarNetwork Foundation billing. The only billing system available, and the default used when an account input omits systemKey.

Feature entitlement

Feature entitlements unlock optional SolarNetwork services. They are granted by listing them in the requestedEntitlements property of an account input object.

Entitlement Description
CLOUD_INTEGRATIONS Access to Cloud Integrations, for collecting data from third-party cloud APIs.
DATUM_EXPORT Access to the datum export service.
DATUM_IMPORT Access to the datum import service.
DATUM_INPUT_ENDPOINTS Access to SolarDIN dynamic datum input endpoints.
DNP3 Access to SolarDNP3.
INSTRUCTION_INPUT_ENDPOINTS Access to SolarDIN dynamic instruction input endpoints.
OCPP Access to SolarOCPP, for EV charger management.
OSCP Access to SolarOSCP, for the Open Smart Charging Protocol.

Supported currency

SolarNetwork generates invoices in the following currencies:

Code Description
NZD New Zealand dollar.
USD United States dollar.

Endpoints

Verb Endpoint Description
POST /user/account/register Register a new billing account for the active user.
GET /user/account/view View the active user's billing account.
POST /user/account Update the active user's billing account.

Account register

Register a new billing account for the active user, and grant the requested feature entitlements. A user may only have one account: registering when an account already exists returns an error and changes nothing.

POST /solaruser/api/v1/sec/user/account/register

The request body is an account input object.

Account register response

The response is an account info object for the newly created account. The entitlements property holds the entitlements granted by the request.

An example response looks like this:

{
  "success" : true,
  "data" : {
    "systemKey" : "snf",
    "account" : {
      "userId" : 123,
      "accountId" : 456,
      "created" : "2026-09-30 02:17:42.221539Z",
      "currencyCode" : "NZD",
      "locale" : "en-NZ",
      "address" : {
        "userId" : 123,
        "addressId" : 789,
        "created" : "2026-09-30 02:17:42.198043Z",
        "name" : "Tester Dude",
        "email" : "billing@example.com",
        "street" : ["Level 1", "123 Main Street"],
        "locality" : "Wellington",
        "stateOrProvince" : "Wellington",
        "region" : "Wellington",
        "country" : "NZ",
        "postalCode" : "6011",
        "timeZoneId" : "Pacific/Auckland"
      }
    },
    "entitlements" : ["OCPP"]
  }
}

If an account already exists for the user, the request fails with a 403 status and a REGISTRATION_ALREADY_CONFIRMED message. See errors.

Account view

View the active user's billing account.

GET /solaruser/api/v1/sec/user/account/view

Account view response

The response is an account info object. The entitlements property holds the entitlements currently granted to the user. See Account register response for an example.

If the user has not registered an account, the request fails with a 403 status and a REGISTRATION_NOT_CONFIRMED message. See errors.

Account update

Update the active user's billing account. The user must have registered an account already.

POST /solaruser/api/v1/sec/user/account

The request body is an account input object.

The submitted object completely replaces the existing account details, including the granted feature entitlements, so be sure to submit a complete object. The systemKey property is ignored: an account cannot be moved between billing systems.

Account update response

The response is an account info object for the updated account. See Account register response for an example.

Properties that did not change keep their existing values, including accountId, created, and — when no address property changed — addressId. See the note on SNF address for how address changes are recorded.

If the user has not registered an account, the request fails with a 403 status. See errors.

Errors

Errors are returned in the standard SolarNetwork form, with success set to false and a message describing the problem:

{
  "success" : false,
  "message" : "REGISTRATION_ALREADY_CONFIRMED"
}

The following errors can be returned by this API:

Status Message Description
401 No authentication credentials were provided.
403 REGISTRATION_ALREADY_CONFIRMED Account register was called but an account already exists for the user.
403 REGISTRATION_NOT_CONFIRMED Account view or account update was called but the user has not registered an account.
422 A description of the invalid properties. The submitted account input was not valid, for example an unknown country code, an unknown time zone ID, a malformed language tag, an invalid email address, or a street array with no non-blank lines.

When a request fails, no part of the account is created or changed.

Clone this wiki locally