- Reference
- OCPI 2.1.1 (eMSP)
- Receiver Location
OpenAPI reference
Receiver Location
/locations/{country_code}/{party_id}/{location_id}Push new/updated Location object to the eMSP.
API: OCPI 2.1.1 (eMSP) · Module: Locations (eMSP)
Base path:/locations· Base URL:https://ocpi-api.gridos.co/ocpi/emsp/2.1.1
Overview
PUT /locations/{country_code}/{party_id}/{location_id}Absolute URL: https://ocpi-api.gridos.co/ocpi/emsp/2.1.1/locations/{country_code}/{party_id}/{location_id}
Push new/updated Location object to the eMSP.
Requires authentication. Use Authorization: Token <token>. See OCPI credentials.
How to call
Quick Shell sample (set OCPI_TOKEN when auth is required). Full Python and TypeScript under Examples.
curl -sS -X PUT 'https://ocpi-api.gridos.co/ocpi/emsp/2.1.1/locations/NL/ABC/LOC1' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"id":"LOC1","type":"ON_STREET","name":"Gent Zuid","address":"F.Rooseveltlaan 3A","city":"Gent","postal_code":"9000","country":"BEL","coordinates":{"latitude":"51.047599","longitude":"3.729944"},"evses":[{"uid":"3256","evse_id":"BE-BEC-E041503001","status":"AVAILABLE","connectors":[{"id":"1","standard":"IEC_62196_T2","format":"CABLE","power_type":"AC_3_PHASE","voltage":220,"amperage":16,"tariff_id":"11","last_updated":"2015-03-16T10:10:02Z"}],"last_updated":"2015-06-28T08:12:01Z"}],"operator":{"name":"BeCharged"},"last_updated":"2015-06-29T20:39:09Z"}'Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | Yes | ISO-3166 alpha-2 country code of the party performing this request. |
party_id | string | Yes | 3-char party ID of the CPO or eMSP (ISO-15118). |
location_id | string | Yes | Location.id of the Location object. |
Request body
application/json · Required
Schema: Location
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | — |
type | `"ON_STREET" | "PARKING_GARAGE" | "UNDERGROUND_GARAGE" |
name | string | No | — |
address | string | Yes | — |
city | string | Yes | — |
postal_code | string | Yes | — |
country | string | Yes | — |
coordinates | GeoLocation | Yes | GeoLocation |
related_locations | AdditionalGeoLocation[] | No | — |
evses | EVSE[] | No | — |
directions | DisplayText[] | No | — |
operator | BusinessDetails | No | BusinessDetails |
suboperator | BusinessDetails | No | BusinessDetails |
owner | BusinessDetails | No | BusinessDetails |
facilities | `"HOTEL" | "RESTAURANT" | "CAFE" |
time_zone | string | No | — |
opening_times | Hours | No | Hours |
charging_when_closed | boolean | No | — |
images | Image[] | No | — |
energy_mix | EnergyMix | No | EnergyMix |
last_updated | string (date-time) | Yes | — |
Request examples
Example 1
{
"id": "LOC1",
"type": "ON_STREET",
"name": "Gent Zuid",
"address": "F.Rooseveltlaan 3A",
"city": "Gent",
"postal_code": "9000",
"country": "BEL",
"coordinates": {
"latitude": "51.047599",
"longitude": "3.729944"
},
"evses": [
{
"uid": "3256",
"evse_id": "BE-BEC-E041503001",
"status": "AVAILABLE",
"connectors": [
{
"id": "1",
"standard": "IEC_62196_T2",
"format": "CABLE",
"power_type": "AC_3_PHASE",
"voltage": 220,
"amperage": 16,
"tariff_id": "11",
"last_updated": "2015-03-16T10:10:02Z"
}
],
"last_updated": "2015-06-28T08:12:01Z"
}
],
"operator": {
"name": "BeCharged"
},
"last_updated": "2015-06-29T20:39:09Z"
}Example 2
{
"id": "LOC2",
"type": "PARKING_GARAGE",
"name": "Central Station Garage",
"address": "Stationsplein 1",
"city": "Utrecht",
"postal_code": "3511AA",
"country": "NLD",
"coordinates": {
"latitude": "52.089444",
"longitude": "5.110278"
},
"evses": [
{
"uid": "EVSE-UTR-1",
"status": "AVAILABLE",
"connectors": [
{
"id": "1",
"standard": "IEC_62196_T2",
"format": "SOCKET",
"power_type": "AC_3_PHASE",
"voltage": 400,
"amperage": 32,
"last_updated": "2015-07-01T07:59:00Z"
}
],
"last_updated": "2015-07-01T07:59:00Z"
}
],
"operator": {
"name": "RailCharge"
},
"last_updated": "2015-07-01T07:59:00Z"
}Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | LocationResponse |
400 | Invalid or missing parameters (HTTP 200, OCPI envelope) | — |
401 | Unauthorized | — |
422 | Validation Error | HTTPValidationError |
200 — successful response
application/json
Schema: LocationResponse
| Field | Type | Required | Description |
|---|---|---|---|
status_code | integer | No | Default: 1000 |
status_message | string | No | — |
timestamp | string (date-time) | No | — |
data | LocationOut | No | LocationOut |
Response example
{
"status_code": 1000,
"status_message": "Success",
"timestamp": "2015-06-29T22:39:09Z",
"data": {
"address": "F.Rooseveltlaan 3A",
"charging_when_closed": true,
"city": "Gent",
"coordinates": {
"latitude": "51.047599",
"longitude": "3.729944"
},
"country": "BEL",
"directions": [
{
"language": "en",
"text": "Enter via main gate"
}
],
"energy_mix": {
"energy_sources": [
{
"percentage": 100,
"source": "SOLAR"
}
],
"is_green_energy": true
},
"evses": [
{
"connectors": [
{
"amperage": 64,
"format": "SOCKET",
"id": "1",
"last_updated": "2015-03-16T10:10:02Z",
"power_type": "AC_1_PHASE",
"standard": "IEC_62196_T2",
"tariff_id": "11",
"voltage": 230
}
],
"evse_id": "BE-BEC-E041503003",
"floor_level": "-1",
"last_updated": "2015-06-28T08:12:01Z",
"physical_reference": "1",
"status": "AVAILABLE",
"uid": "3256"
}
],
"facilities": [
"BUS_STOP"
],
"id": "LOC1",
"images": [],
"last_updated": "2015-06-29T20:39:09Z",
"name": "Gent Zuid",
"opening_times": {
"twentyfourseven": true
},
"operator": {
"name": "BeCharged"
},
"owner": {
"name": "Gent Municipality"
},
"postal_code": "9000",
"related_locations": [],
"suboperator": {
"name": "BeCharged Sub"
},
"time_zone": "Europe/Brussels",
"type": "ON_STREET"
}
}400 — invalid or missing parameters (HTTP 200, OCPI envelope)
application/json
Response example
{
"status_code": 2001,
"status_message": "Invalid or missing parameters",
"timestamp": "2025-01-01T00:00:00Z",
"doc_url": "https://github.com/ocpplab/ocpi-gateway/blob/main/docs/errors.md#2001-invalid-parameters",
"errors": [
{
"field": "country_code",
"message": "expected 'NL' to match Token A identity",
"type": "value_error.identity_mismatch"
}
]
}401 — unauthorized
application/json
Response example
{
"status_code": 2000,
"status_message": "Unauthorized",
"timestamp": "2025-01-01T00:00:00Z"
}422 — validation error
application/json
Schema: HTTPValidationError
| Field | Type | Required | Description |
|---|---|---|---|
detail | ValidationError[] | No | Detail |
Response example
{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string",
"input": {
"_type": "Input"
},
"ctx": {
"_type": "Context"
}
}
]
}Examples
Shell, Python, and TypeScript (set OCPI_TOKEN when auth is required).
curl -sS -X PUT 'https://ocpi-api.gridos.co/ocpi/emsp/2.1.1/locations/NL/ABC/LOC1' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"id":"LOC1","type":"ON_STREET","name":"Gent Zuid","address":"F.Rooseveltlaan 3A","city":"Gent","postal_code":"9000","country":"BEL","coordinates":{"latitude":"51.047599","longitude":"3.729944"},"evses":[{"uid":"3256","evse_id":"BE-BEC-E041503001","status":"AVAILABLE","connectors":[{"id":"1","standard":"IEC_62196_T2","format":"CABLE","power_type":"AC_3_PHASE","voltage":220,"amperage":16,"tariff_id":"11","last_updated":"2015-03-16T10:10:02Z"}],"last_updated":"2015-06-28T08:12:01Z"}],"operator":{"name":"BeCharged"},"last_updated":"2015-06-29T20:39:09Z"}'