> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spirii.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creates a new location.



## OpenAPI

````yaml /openapi/integration-api-v2/openapi.yaml post /v2/locations
openapi: 3.0.0
info:
  title: Spirii API
  description: Spirii API
  version: 2.10.0
  contact: {}
servers:
  - url: https://api.spirii.com
security: []
tags: []
paths:
  /v2/locations:
    post:
      tags:
        - Locations v2
      summary: Creates a new location.
      operationId: LocationController_createLocation_v2
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLocationRequestBodyDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateLocationResponseBodyDto'
        '201':
          description: >-
            Creates an new location. The operator will be derived from the
            logged in user
        '400':
          description: Bad Request provided. A message will describe the issue.
        '403':
          description: Authorization header token is invalid or not provided.
        '500':
          description: Internal Server Error.
      security:
        - Authorization: []
components:
  schemas:
    CreateLocationRequestBodyDto:
      type: object
      properties:
        name:
          type: string
          description: Location name
          example: Example Location
        address:
          type: string
          description: Street address of the location
          example: 123 Charging St, City, Country
        postalCode:
          type: string
          description: Postal code
          example: '00123'
        city:
          type: string
          description: City name
          example: Copenhagen
        countryCode:
          type: string
          description: ISO-31661 alpha-2 country code of the CPO that 'owns' this location.
          example: DK
        facilities:
          type: array
          description: List of available facilities at the location
          example:
            - WIFI
            - RESTROOM
          items:
            type: string
            enum:
              - HOTEL
              - RESTAURANT
              - CAFE
              - MALL
              - SUPERMARKET
              - SPORT
              - RECREATION_AREA
              - NATURE
              - MUSEUM
              - BIKE_SHARING
              - BUS_STOP
              - TAXI_STAND
              - TRAIN_STATION
              - METRO_STATION
              - AIRPORT
              - PARKING_LOT
              - CARPOOL_PARKING
              - FUEL_STATION
              - WIFI
              - RESTROOM
              - SHOWER
              - CAR_WASH
              - SHOPPING_AREA
              - MEDICAL_CENTER
              - HOTEL_RESERVATION
              - TICKET_SERVICE
              - PUBLIC_TRANSPORT
        coordinates:
          description: Geographical coordinates of the location
          allOf:
            - $ref: '#/components/schemas/CoordinatesDto'
        publish:
          type: boolean
          description: >-
            Defines if a location may be published on websites & apps etc. This
            will be true for public locations
          example: true
        openingTimes:
          description: >-
            The times when the EVSEs at the location can be accessed for
            charging
          allOf:
            - $ref: '#/components/schemas/OpeningTimesDto'
        parkingType:
          type: string
          description: |-
            Type of parking available. 
             

             The mapping of the parkingType to the Spirii location Type is visible in the table below: 

             [ParkingType] - [Spirii Location Type] 

             ON_STREET - Public road

            ON_DRIVEWAY - Residential

            PARKING_LOT - Parking lot

            PARKING_GARAGE - Parking lot (indoor)

            UNDERGROUND_GARAGE - Parking lot (underground)

            OTHER - Hotel
          enum:
            - ON_STREET
            - PARKING_GARAGE
            - UNDERGROUND_GARAGE
            - PARKING_LOT
            - OTHER
            - ON_DRIVEWAY
          example: ON_STREET
          default: ON_STREET
        ownerId:
          type: number
          description: >-
            Legacy ID of the customer that 'owns' the location. An 'owner'
            represents a 'customer' in the Spirii Connect portal/UI. While the
            term 'ownerId' is outdated, this ID is retained for backward
            compatibility with legacy systems.
          example: 1234
        customerId:
          type: number
          description: >-
            ID of the customer that 'owns' the location. The 'customerId' is the
            unique identifier for a customer. The 'customer' can be found in the
            Connect Customer management page. This customer ID corresponds with
            the customer ID that can be retrieved from the Customer v2 API.
          example: 1234
        tariffId:
          type: string
          description: Uniquely identifies the tariff within the CPO’s platform
          example: 58652fe8-d840-4aa4-bb4f-3ebd944df9d6
        legacyTariffId:
          type: number
          description: >-
            The tariff displayed for all the users who are using older versions
            of the app
          example: 12345678
          deprecated: true
        allowPriorityCharging:
          type: boolean
          description: If a location allows priority charging
          example: true
        billingReference:
          type: string
          description: >-
            An optional identifier used to reference specific charging sessions
            or transactions in invoices
          example: Identifier text
      required:
        - name
        - address
        - postalCode
        - city
        - countryCode
        - coordinates
        - publish
    CreateLocationResponseBodyDto:
      type: object
      properties:
        id:
          type: number
          description: ID that Uniquely identifies the location
          example: 123456
        name:
          type: string
          description: Location name
          example: Example Location
        address:
          type: string
          description: Street address of the location
          example: 123 Charging St, City, Country
        postalCode:
          type: string
          description: Postal code
          example: '00123'
        city:
          type: string
          description: City name
          example: Copenhagen
        countryCode:
          type: string
          description: ISO-31661 alpha-2 country code of the CPO that 'owns' this location.
          example: DK
        parkingType:
          type: string
          description: |-
            Type of parking available. 
             

             The mapping of the parkingType to the Spirii location Type is visible in the table below: 

             [ParkingType] - [Spirii Location Type] 

             ON_STREET - Public road

            ON_DRIVEWAY - Residential

            PARKING_LOT - Parking lot

            PARKING_GARAGE - Parking lot (indoor)

            UNDERGROUND_GARAGE - Parking lot (underground)

            OTHER - Hotel
          enum:
            - ON_STREET
            - PARKING_GARAGE
            - UNDERGROUND_GARAGE
            - PARKING_LOT
            - OTHER
            - ON_DRIVEWAY
          example: ON_STREET
        partyId:
          type: string
          description: >-
            ID of the CPO that 'owns' this location (following the ISO-15118
            standard)
          example: SPI
        facilities:
          type: array
          description: List of available facilities at the location
          example:
            - WIFI
            - RESTROOM
          items:
            type: string
            enum:
              - HOTEL
              - RESTAURANT
              - CAFE
              - MALL
              - SUPERMARKET
              - SPORT
              - RECREATION_AREA
              - NATURE
              - MUSEUM
              - BIKE_SHARING
              - BUS_STOP
              - TAXI_STAND
              - TRAIN_STATION
              - METRO_STATION
              - AIRPORT
              - PARKING_LOT
              - CARPOOL_PARKING
              - FUEL_STATION
              - WIFI
              - RESTROOM
              - SHOWER
              - CAR_WASH
              - SHOPPING_AREA
              - MEDICAL_CENTER
              - HOTEL_RESERVATION
              - TICKET_SERVICE
              - PUBLIC_TRANSPORT
        coordinates:
          description: Geographical coordinates of the location
          allOf:
            - $ref: '#/components/schemas/CoordinatesDto'
        publish:
          type: boolean
          description: >-
            Defines if a location may be published on websites & apps etc. This
            will be true for public locations
          example: true
        directions:
          description: Human-readable directions on how to reach the location
          type: array
          items:
            $ref: '#/components/schemas/DirectionsDto'
        openingTimes:
          description: >-
            The times when the EVSEs at the location can be accessed for
            charging
          allOf:
            - $ref: '#/components/schemas/OpeningTimesDto'
        evses:
          description: List of EVSEs at the location
          type: array
          items:
            $ref: '#/components/schemas/GetEvseResponseBodyDto'
        operator:
          description: Information of the operator
          allOf:
            - $ref: '#/components/schemas/BusinessDetailsDto'
        owner:
          description: >-
            Information about the owner of the location, if available. The
            'owner' represents a legacy concept of a 'customer' in the Spirii
            Connect portal/UI, retained for backward compatibility.
          allOf:
            - $ref: '#/components/schemas/OwnerDetailsDto'
        customer:
          description: >-
            Information about the customer that 'owns' the location. This
            represents the current terminology for identifying the customer
            associated with the location in the Spirii Connect portal.
          allOf:
            - $ref: '#/components/schemas/CustomerDetailsDto'
        energyMix:
          description: Details on the energy supplied at this location
          allOf:
            - $ref: '#/components/schemas/EnergyMixDto'
        helpPhone:
          type: string
          description: >-
            A telephone number that a Driver using the Location may call for
            assistance.
          example: '4550505050'
        lastUpdated:
          type: string
          description: Last update timestamp
          example: '2025-01-27 09:38:41'
        allowPriorityCharging:
          type: boolean
          description: Information about if a location allows priority charging
          example: true
        billingReference:
          type: string
          description: >-
            An optional identifier used to reference specific charging sessions
            or transactions in invoices
          example: Identifier text
      required:
        - id
        - name
        - address
        - postalCode
        - city
        - countryCode
        - partyId
        - coordinates
        - publish
        - evses
        - operator
        - lastUpdated
        - allowPriorityCharging
    CoordinatesDto:
      type: object
      properties:
        latitude:
          type: number
          description: Latitude coordinate of the location
          example: 55.6761
        longitude:
          type: number
          description: Longitude coordinate of the location
          example: 12.5683
      required:
        - latitude
        - longitude
    OpeningTimesDto:
      type: object
      properties:
        twentyFourSeven:
          type: boolean
          description: Indicates if the location is open 24/7
          example: false
        regularHours:
          description: Regular hours of operation
          type: array
          items:
            $ref: '#/components/schemas/RegularHoursDto'
      required:
        - twentyFourSeven
        - regularHours
    DirectionsDto:
      type: object
      properties:
        text:
          type: string
          description: Public directions for the location
          example: Public info goes here
        language:
          type: string
          description: Language code for directions
          example: en
      required:
        - text
        - language
    GetEvseResponseBodyDto:
      type: object
      properties:
        uid:
          type: number
          description: Uniquely identifies the EVSE
          example: 123456
        evseId:
          type: string
          description: >-
            Compliant with the following specification for EVSE ID: "E-mobility
            ID-codes: the purpose of IDs, ID usage and ID format"
          example: DK.12343*1
        chargeboxId:
          type: number
          description: Uniquely identifies the charge box on which the EVSE is found
          example: 123
        status:
          type: string
          description: |-
            Indicates the current status of the EVSE. 
             

             The mapping of the OCPP status to the OCPI status, which is used in this endpoint, is visible in the table below: 

             [OCPP status] - [OCPI status] 

             Available - AVAILABLE

            Reserved - RESERVED

            Preparing,Charging,Finishing - CHARGING

            SuspendedEV,SuspendedEVSE - BLOCKED

            Faulted - OUTOFORDER

            Unavailable - INOPERATIVE

            N/A - PLANNED

            N/A - REMOVED

            N/A - UNKNOWN
          enum:
            - AVAILABLE
            - BLOCKED
            - CHARGING
            - INOPERATIVE
            - OUTOFORDER
            - PLANNED
            - REMOVED
            - RESERVED
            - UNKNOWN
          example: CHARGING
        connectors:
          description: List of available connectors
          type: array
          items:
            $ref: '#/components/schemas/ConnectorDto'
      required:
        - uid
        - evseId
        - chargeboxId
        - status
        - connectors
    BusinessDetailsDto:
      type: object
      properties:
        name:
          type: string
          description: Operator name
          example: ChargedUp Inc.
        website:
          type: string
          description: Link to the operator’s website.
          example: https://spirii.com
      required:
        - name
        - website
    OwnerDetailsDto:
      type: object
      properties:
        name:
          type: string
          description: Owner name
          example: ChargedUp Inc.
        website:
          type: string
          description: Link to the owner’s website.
          example: https://spirii.com
      required:
        - name
        - website
    CustomerDetailsDto:
      type: object
      properties:
        id:
          type: number
          description: >-
            ID of the customer that 'owns' the charge box. The 'id' is the
            unique identifier for a customer. The 'customer' can be found in the
            Connect Customer management page. This customer ID corresponds with
            the customer ID that can be retrieved from the Customer v2 API.
          example: 123456
      required:
        - id
    EnergyMixDto:
      type: object
      properties:
        isGreenEnergy:
          type: boolean
          description: >-
            True if 100% from regenerative sources. (CO2 and nuclear waste is
            zero)
          example: false
      required:
        - isGreenEnergy
    RegularHoursDto:
      type: object
      properties:
        weekday:
          type: number
          description: Number of day in the week, from Monday (1) till Sunday (7)
          example: 1
        periodBegin:
          type: string
          description: Opening time in HH:mm format
          example: '08:00'
        periodEnd:
          type: string
          description: Closing time in HH:mm format
          example: '17:00'
      required:
        - weekday
        - periodBegin
        - periodEnd
    ConnectorDto:
      type: object
      properties:
        id:
          type: number
          description: Identifier of the Connector within the EVSE
          example: 1
        standard:
          type: string
          description: The standard of the installed connector.
          example: CHADEMO
          enum:
            - CHADEMO
            - IEC_62196_T2_COMBO
            - IEC_62196_T2
            - GBT_AC
            - GBT_DC
            - IEC_62196_T1_COMBO
            - IEC_62196_T1
        format:
          type: string
          description: The format (socket/cable) of the installed connector.
          enum:
            - SOCKET
            - CABLE
          example: SOCKET
        powerType:
          type: string
          description: Power type of the connector
          enum:
            - AC_1_PHASE
            - AC_2_PHASE
            - AC_2_PHASE_SPLIT
            - AC_3_PHASE
            - DC
          example: DC
        maxElectricPower:
          type: number
          description: Maximum electric power output (kW).
          example: 22
        maxAmperage:
          type: number
          description: Maximum amperage (current) output (A).
          example: 32
        maxVoltage:
          type: number
          description: Maximum voltage output (V).
          example: 400
        tariffIds:
          description: Identifiers of the currently valid charging tariffs
          example:
            - 58652fe8-d840-4aa4-bb4f-3ebd944df9d6
          type: array
          items:
            type: string
        error:
          description: Error status of the connector, if present
          allOf:
            - $ref: '#/components/schemas/ConnectorStatus'
        deletedAt:
          format: date-time
          type: string
          description: Deleted at timestamp
          example: '2025-01-27 09:38:41'
      required:
        - id
        - standard
        - format
        - powerType
        - maxElectricPower
        - maxAmperage
        - maxVoltage
        - tariffIds
    ConnectorStatus:
      type: object
      properties:
        errorCode:
          type: string
          description: This contains the error code reported by the charge box
          example: UnderVoltage
          enum:
            - ConnectorLockFailure
            - EVCommunicationError
            - GroundFailure
            - HighTemperature
            - InternalError
            - LocalListConflict
            - NoError
            - OtherError
            - OverCurrentFailure
            - OverVoltage
            - PowerMeterFailure
            - PowerSwitchFailure
            - ReaderFailure
            - ResetFailure
            - UnderVoltage
            - WeakSignal
        info:
          type: string
          description: Additional free format information related to the error
          example: NO_VOLTAGE_L2_L3
        vendorErrorCode:
          type: string
          description: This contains the vendor-specific error code
          example: '134217728'
      required:
        - errorCode
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization
      description: '`Authorization: Bearer <SPIRII_API_KEY>`'

````