> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ocpplab.com/llms.txt.
> For full documentation content, see https://docs.ocpplab.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ocpplab.com/_mcp/server.

# Bulk-create OCPI locations (durable)

POST https://host.com/ocpi/cpos/{cpo_id}/locations
Content-Type: application/json

Kick off a durable bulk-create of OCPI locations under a CPO. Returns **202 Accepted** in under a second with a `job_id` and `status_url`. Each location's 10-table orchestration (OCPI rows, OCPP rows, topology, per-charger deployment + ECS) runs as a separate Upstash Workflow step with per-step retries on transient failure. Poll `GET {status_url}` every 1-2s until `status == READY` (or `FAILED`). Results include the created location ids.

Reference: https://docs.ocpplab.com/api-reference/ocpplab-gateway-api/ocpi/ocpi-locations/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: OCPPLab SDK
  version: 1.0.0
paths:
  /ocpi/cpos/{cpo_id}/locations:
    post:
      operationId: create
      summary: Bulk-create OCPI locations (durable)
      description: >-
        Kick off a durable bulk-create of OCPI locations under a CPO. Returns
        **202 Accepted** in under a second with a `job_id` and `status_url`.
        Each location's 10-table orchestration (OCPI rows, OCPP rows, topology,
        per-charger deployment + ECS) runs as a separate Upstash Workflow step
        with per-step retries on transient failure. Poll `GET {status_url}`
        every 1-2s until `status == READY` (or `FAILED`). Results include the
        created location ids.
      tags:
        - subpackage_ocpiLocations
      parameters:
        - name: cpo_id
          in: path
          description: >-
            CPO identifier — the stringified integer returned by ``POST
            /ocpi/cpos`` (backed by ``ocpp.partner_operations.id``).
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Bulk location provisioning accepted; poll status_url
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationBulkAcceptedResponse'
        '400':
          description: Invalid location data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '401':
          description: Missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '403':
          description: Insufficient permissions or missing required claims
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '404':
          description: Network not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '503':
          description: Workflow queue unavailable
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLocationsBulkRequest'
servers:
  - url: https://host.com
components:
  schemas:
    OcpiCoordinates:
      type: object
      properties:
        latitude:
          type: number
          format: double
        longitude:
          type: number
          format: double
      required:
        - latitude
        - longitude
      description: Latitude/longitude pair accepted by the OCPI location API.
      title: OcpiCoordinates
    ParkingType:
      type: string
      enum:
        - ALONG_MOTORWAY
        - PARKING_GARAGE
        - PARKING_LOT
        - ON_DRIVEWAY
        - ON_STREET
        - UNDERGROUND_GARAGE
      description: |-
        OCPI 2.2.1 ``parking_type`` — matches the DB check constraint on
        ``ocpp.ocpi221_locations.parking_type``.
      title: ParkingType
    OcpiChargerTemplate:
      type: object
      properties:
        brand_slug:
          type: string
        model_slug:
          type: string
        connector_type:
          type: string
        ocpp_version:
          type: string
        ws_url:
          type: string
        identity_prefix:
          type: string
          description: >-
            Prefix prepended to each charger_id to form the final OCPP identity
            (e.g. prefix ``SITE_A_`` + id ``001`` → ``SITE_A_001``).
        template_name:
          type:
            - string
            - 'null'
          description: Human label for the group (used as charge_point_name).
      required:
        - brand_slug
        - model_slug
        - connector_type
        - ocpp_version
        - ws_url
        - identity_prefix
      description: Shared template applied to every charger_id in a OcpiChargerGroup.
      title: OcpiChargerTemplate
    OcpiChargerGroup:
      type: object
      properties:
        template:
          $ref: '#/components/schemas/OcpiChargerTemplate'
        charger_ids:
          type: array
          items:
            type: string
          description: >-
            Suffixes that will be concatenated with
            ``template.identity_prefix``.
      required:
        - template
        - charger_ids
      description: One template applied to a list of charger_ids.
      title: OcpiChargerGroup
    OcpiCreateLocationRequest:
      type: object
      properties:
        name:
          type: string
        address:
          type: string
        city:
          type: string
        country:
          type: string
        coordinates:
          $ref: '#/components/schemas/OcpiCoordinates'
        timezone:
          type:
            - string
            - 'null'
        owner_name:
          type:
            - string
            - 'null'
        public:
          type: boolean
          default: true
        parking_type:
          oneOf:
            - $ref: '#/components/schemas/ParkingType'
            - type: 'null'
          description: >-
            OCPI 2.2.1 parking type. Ignored for 2.1.1 networks — the
            corresponding column does not exist on ``ocpi211_locations``.
        charges:
          type: array
          items:
            $ref: '#/components/schemas/OcpiChargerGroup'
          description: >-
            Optional charger groups to provision in the newly-created location.
            Each group expands ``charger_ids`` into individual deployments using
            the shared ``template``.
      required:
        - name
        - address
        - city
        - country
        - coordinates
      description: One location to create, optionally with attached chargers.
      title: OcpiCreateLocationRequest
    LocationFromTemplateRequest:
      type: object
      properties:
        template:
          type: string
          description: >-
            Location template slug. See ``GET /ocpi/templates/locations`` for
            the gallery. Examples: ``urban-ac-hub``, ``highway-dc-station``,
            ``residential-ac-single``.
        overrides:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
          description: >-
            Overrides applied to the template's location spec. Top-level
            location fields (``name``, ``address``, ``city``, ``country``,
            ``coordinates``, ``timezone``, ``owner_name``, ``public``,
            ``parking_type``) are a shallow merge. Protocol fields apply across
            every charger group: ``ocpp_version`` (``OCPP1.6`` or ``OCPP2.0.1``)
            rewrites every group in the template at once; ``identity_prefix``
            replaces every group's identity prefix for full-control
            caller-specified disambiguation. When the same template slug is used
            multiple times in one bulk request WITHOUT ``identity_prefix``
            overrides, the router auto-appends ``L01_/L02_/...`` to keep charger
            identities unique. Unknown keys are ignored.
      required:
        - template
      description: |-
        Template reference inside a bulk location-create body.

        Callers use ``{"template": "urban-ac-hub", "overrides": {...}}`` as an
        alternative to the full raw ``OcpiCreateLocationRequest`` shape. The
        router expands the template via
        :mod:`src.services.ocpi.templates.locations` before handing the
        fleshed-out spec to :class:`LocationService.create_locations`.
      title: LocationFromTemplateRequest
    CreateLocationsBulkRequestLocationsItems:
      oneOf:
        - $ref: '#/components/schemas/OcpiCreateLocationRequest'
        - $ref: '#/components/schemas/LocationFromTemplateRequest'
      title: CreateLocationsBulkRequestLocationsItems
    CreateLocationsBulkRequest:
      type: object
      properties:
        locations:
          type: array
          items:
            $ref: '#/components/schemas/CreateLocationsBulkRequestLocationsItems'
      required:
        - locations
      description: |-
        Envelope for bulk-creating one or more locations in a single call.

        Each item in ``locations`` is either a full raw
        :class:`OcpiCreateLocationRequest` OR a
        :class:`LocationFromTemplateRequest`. Pydantic's smart union picks
        whichever shape matches the caller's body.
      title: CreateLocationsBulkRequest
    LocationBulkProvisioningStatus:
      type: string
      enum:
        - PENDING
        - PROVISIONING
        - READY
        - FAILED
      description: State machine for the durable bulk-location async job.
      title: LocationBulkProvisioningStatus
    LocationBulkAcceptedResponse:
      type: object
      properties:
        job_id:
          type: string
        status:
          $ref: '#/components/schemas/LocationBulkProvisioningStatus'
        workflow_run_id:
          type:
            - string
            - 'null'
        status_url:
          type: string
      required:
        - job_id
        - status
        - status_url
      description: |-
        202 response from the async bulk-location-create endpoint.

        Returned by ``POST /ocpi/cpos/{cpo_id}/locations`` before the
        workflow has finished. Clients poll ``status_url`` until the state
        settles on ``READY`` or ``FAILED``.
      title: LocationBulkAcceptedResponse
    HttpErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message returned by the API.
      required:
        - detail
      description: Standard HTTP error payload returned by the API.
      title: HttpErrorResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Bulk-create one location without provisioning chargers
import requests

url = "https://host.com/ocpi/cpos/cpo_id/locations"

payload = { "locations": [
        {
            "name": "Brussels Midi Hub",
            "address": "Place Victor Horta 1",
            "city": "Brussels",
            "country": "BE",
            "coordinates": {
                "latitude": 50.8357,
                "longitude": 4.3353
            },
            "public": True
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Bulk-create one location without provisioning chargers
const url = 'https://host.com/ocpi/cpos/cpo_id/locations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"locations":[{"name":"Brussels Midi Hub","address":"Place Victor Horta 1","city":"Brussels","country":"BE","coordinates":{"latitude":50.8357,"longitude":4.3353},"public":true}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Bulk-create one location without provisioning chargers
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://host.com/ocpi/cpos/cpo_id/locations"

	payload := strings.NewReader("{\n  \"locations\": [\n    {\n      \"name\": \"Brussels Midi Hub\",\n      \"address\": \"Place Victor Horta 1\",\n      \"city\": \"Brussels\",\n      \"country\": \"BE\",\n      \"coordinates\": {\n        \"latitude\": 50.8357,\n        \"longitude\": 4.3353\n      },\n      \"public\": true\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Bulk-create one location without provisioning chargers
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpi/cpos/cpo_id/locations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"locations\": [\n    {\n      \"name\": \"Brussels Midi Hub\",\n      \"address\": \"Place Victor Horta 1\",\n      \"city\": \"Brussels\",\n      \"country\": \"BE\",\n      \"coordinates\": {\n        \"latitude\": 50.8357,\n        \"longitude\": 4.3353\n      },\n      \"public\": true\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Bulk-create one location without provisioning chargers
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpi/cpos/cpo_id/locations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"locations\": [\n    {\n      \"name\": \"Brussels Midi Hub\",\n      \"address\": \"Place Victor Horta 1\",\n      \"city\": \"Brussels\",\n      \"country\": \"BE\",\n      \"coordinates\": {\n        \"latitude\": 50.8357,\n        \"longitude\": 4.3353\n      },\n      \"public\": true\n    }\n  ]\n}")
  .asString();
```

```php Bulk-create one location without provisioning chargers
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpi/cpos/cpo_id/locations', [
  'body' => '{
  "locations": [
    {
      "name": "Brussels Midi Hub",
      "address": "Place Victor Horta 1",
      "city": "Brussels",
      "country": "BE",
      "coordinates": {
        "latitude": 50.8357,
        "longitude": 4.3353
      },
      "public": true
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Bulk-create one location without provisioning chargers
using RestSharp;

var client = new RestClient("https://host.com/ocpi/cpos/cpo_id/locations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"locations\": [\n    {\n      \"name\": \"Brussels Midi Hub\",\n      \"address\": \"Place Victor Horta 1\",\n      \"city\": \"Brussels\",\n      \"country\": \"BE\",\n      \"coordinates\": {\n        \"latitude\": 50.8357,\n        \"longitude\": 4.3353\n      },\n      \"public\": true\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Bulk-create one location without provisioning chargers
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["locations": [
    [
      "name": "Brussels Midi Hub",
      "address": "Place Victor Horta 1",
      "city": "Brussels",
      "country": "BE",
      "coordinates": [
        "latitude": 50.8357,
        "longitude": 4.3353
      ],
      "public": true
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpi/cpos/cpo_id/locations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python
import requests

url = "https://host.com/ocpi/cpos/cpo_id/locations"

payload = { "locations": [
        {
            "name": "La Defense Charging Hub",
            "address": "14 Rue de la Paix",
            "city": "Paris",
            "country": "FR",
            "coordinates": {
                "latitude": 48.8566,
                "longitude": 2.3522
            },
            "timezone": "Europe/Paris",
            "owner_name": "VINCI Autoroutes",
            "public": True,
            "charges": [
                {
                    "template": {
                        "brand_slug": "schneider",
                        "model_slug": "evlink-pro-ac-22kw",
                        "connector_type": "CCS2",
                        "ocpp_version": "OCPP1.6",
                        "ws_url": "wss://ocpp.ocpplab.com",
                        "identity_prefix": "SITE_A_",
                        "template_name": "Bay"
                    },
                    "charger_ids": ["001", "002", "003"]
                }
            ]
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://host.com/ocpi/cpos/cpo_id/locations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"locations":[{"name":"La Defense Charging Hub","address":"14 Rue de la Paix","city":"Paris","country":"FR","coordinates":{"latitude":48.8566,"longitude":2.3522},"timezone":"Europe/Paris","owner_name":"VINCI Autoroutes","public":true,"charges":[{"template":{"brand_slug":"schneider","model_slug":"evlink-pro-ac-22kw","connector_type":"CCS2","ocpp_version":"OCPP1.6","ws_url":"wss://ocpp.ocpplab.com","identity_prefix":"SITE_A_","template_name":"Bay"},"charger_ids":["001","002","003"]}]}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://host.com/ocpi/cpos/cpo_id/locations"

	payload := strings.NewReader("{\n  \"locations\": [\n    {\n      \"name\": \"La Defense Charging Hub\",\n      \"address\": \"14 Rue de la Paix\",\n      \"city\": \"Paris\",\n      \"country\": \"FR\",\n      \"coordinates\": {\n        \"latitude\": 48.8566,\n        \"longitude\": 2.3522\n      },\n      \"timezone\": \"Europe/Paris\",\n      \"owner_name\": \"VINCI Autoroutes\",\n      \"public\": true,\n      \"charges\": [\n        {\n          \"template\": {\n            \"brand_slug\": \"schneider\",\n            \"model_slug\": \"evlink-pro-ac-22kw\",\n            \"connector_type\": \"CCS2\",\n            \"ocpp_version\": \"OCPP1.6\",\n            \"ws_url\": \"wss://ocpp.ocpplab.com\",\n            \"identity_prefix\": \"SITE_A_\",\n            \"template_name\": \"Bay\"\n          },\n          \"charger_ids\": [\n            \"001\",\n            \"002\",\n            \"003\"\n          ]\n        }\n      ]\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpi/cpos/cpo_id/locations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"locations\": [\n    {\n      \"name\": \"La Defense Charging Hub\",\n      \"address\": \"14 Rue de la Paix\",\n      \"city\": \"Paris\",\n      \"country\": \"FR\",\n      \"coordinates\": {\n        \"latitude\": 48.8566,\n        \"longitude\": 2.3522\n      },\n      \"timezone\": \"Europe/Paris\",\n      \"owner_name\": \"VINCI Autoroutes\",\n      \"public\": true,\n      \"charges\": [\n        {\n          \"template\": {\n            \"brand_slug\": \"schneider\",\n            \"model_slug\": \"evlink-pro-ac-22kw\",\n            \"connector_type\": \"CCS2\",\n            \"ocpp_version\": \"OCPP1.6\",\n            \"ws_url\": \"wss://ocpp.ocpplab.com\",\n            \"identity_prefix\": \"SITE_A_\",\n            \"template_name\": \"Bay\"\n          },\n          \"charger_ids\": [\n            \"001\",\n            \"002\",\n            \"003\"\n          ]\n        }\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpi/cpos/cpo_id/locations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"locations\": [\n    {\n      \"name\": \"La Defense Charging Hub\",\n      \"address\": \"14 Rue de la Paix\",\n      \"city\": \"Paris\",\n      \"country\": \"FR\",\n      \"coordinates\": {\n        \"latitude\": 48.8566,\n        \"longitude\": 2.3522\n      },\n      \"timezone\": \"Europe/Paris\",\n      \"owner_name\": \"VINCI Autoroutes\",\n      \"public\": true,\n      \"charges\": [\n        {\n          \"template\": {\n            \"brand_slug\": \"schneider\",\n            \"model_slug\": \"evlink-pro-ac-22kw\",\n            \"connector_type\": \"CCS2\",\n            \"ocpp_version\": \"OCPP1.6\",\n            \"ws_url\": \"wss://ocpp.ocpplab.com\",\n            \"identity_prefix\": \"SITE_A_\",\n            \"template_name\": \"Bay\"\n          },\n          \"charger_ids\": [\n            \"001\",\n            \"002\",\n            \"003\"\n          ]\n        }\n      ]\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpi/cpos/cpo_id/locations', [
  'body' => '{
  "locations": [
    {
      "name": "La Defense Charging Hub",
      "address": "14 Rue de la Paix",
      "city": "Paris",
      "country": "FR",
      "coordinates": {
        "latitude": 48.8566,
        "longitude": 2.3522
      },
      "timezone": "Europe/Paris",
      "owner_name": "VINCI Autoroutes",
      "public": true,
      "charges": [
        {
          "template": {
            "brand_slug": "schneider",
            "model_slug": "evlink-pro-ac-22kw",
            "connector_type": "CCS2",
            "ocpp_version": "OCPP1.6",
            "ws_url": "wss://ocpp.ocpplab.com",
            "identity_prefix": "SITE_A_",
            "template_name": "Bay"
          },
          "charger_ids": [
            "001",
            "002",
            "003"
          ]
        }
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://host.com/ocpi/cpos/cpo_id/locations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"locations\": [\n    {\n      \"name\": \"La Defense Charging Hub\",\n      \"address\": \"14 Rue de la Paix\",\n      \"city\": \"Paris\",\n      \"country\": \"FR\",\n      \"coordinates\": {\n        \"latitude\": 48.8566,\n        \"longitude\": 2.3522\n      },\n      \"timezone\": \"Europe/Paris\",\n      \"owner_name\": \"VINCI Autoroutes\",\n      \"public\": true,\n      \"charges\": [\n        {\n          \"template\": {\n            \"brand_slug\": \"schneider\",\n            \"model_slug\": \"evlink-pro-ac-22kw\",\n            \"connector_type\": \"CCS2\",\n            \"ocpp_version\": \"OCPP1.6\",\n            \"ws_url\": \"wss://ocpp.ocpplab.com\",\n            \"identity_prefix\": \"SITE_A_\",\n            \"template_name\": \"Bay\"\n          },\n          \"charger_ids\": [\n            \"001\",\n            \"002\",\n            \"003\"\n          ]\n        }\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["locations": [
    [
      "name": "La Defense Charging Hub",
      "address": "14 Rue de la Paix",
      "city": "Paris",
      "country": "FR",
      "coordinates": [
        "latitude": 48.8566,
        "longitude": 2.3522
      ],
      "timezone": "Europe/Paris",
      "owner_name": "VINCI Autoroutes",
      "public": true,
      "charges": [
        [
          "template": [
            "brand_slug": "schneider",
            "model_slug": "evlink-pro-ac-22kw",
            "connector_type": "CCS2",
            "ocpp_version": "OCPP1.6",
            "ws_url": "wss://ocpp.ocpplab.com",
            "identity_prefix": "SITE_A_",
            "template_name": "Bay"
          ],
          "charger_ids": ["001", "002", "003"]
        ]
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpi/cpos/cpo_id/locations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```