swagger: "2.0"
schemes:
  - https
  - http
host: api.deutschebahn.com
basePath: /flinkster-api-ng/v1
info:
  contact:
    email: partner@flinkster.de
    name: DB Rent GmbH
  description: |-
    This REST-API enables you to query for private transport sharing offers provided by companies and cities in Germany, Netherland and Austria. 
    You can search for informations about the rental stations (points or areas) where you can find the rentals by utilizing the /areas/ ressource. 
    With the help of the proximity search in the /bookingproposals/ URI you can request the availabilities of the rentalobjects for spontaneous or planed usage in the future. 

    Feel free to browse through data by setting the parameter 'providernetwork' to the value: 
     1: Search for car sharing offers provided by the Flinkster platform (http://www.flinkster.de)
    2: Finding bike rental offers from Call a Bike (http://www.callabike.de) 

    You can find more details in the documentation section (Unfortunately only available in german language).

    Have lots of fun and we are lucky to take notice of your products or getting your feedback.
  termsOfService: https://developer.deutschebahn.com/store/
  title: Flinkster_API_NG
  version: v1
  x-apisguru-categories:
    - transport
    - open_data
  x-logo:
    backgroundColor: "#FFFFFF"
    url: https://pbs.twimg.com/profile_images/591140150413025280/Cjcqjl2J.png
  x-origin:
    - format: swagger
      url: https://developer.deutschebahn.com/store/api-docs/DBOpenData/Flinkster_API_NG/v1
      version: "2.0"
  x-providerName: deutschebahn.com
  x-serviceName: flinkster
tags:
  - name: areas
  - name: bookingproposals
  - name: categories
  - name: index
  - name: prices
  - name: providernetworks
  - name: providers
  - name: rentalobjects
paths:
  /areas:
    get:
      description: Search for areas (locations of rental objects) by criteria.
      operationId: listAreas
      parameters:
        - format: double
          in: query
          name: lat
          required: false
          type: number
        - format: double
          in: query
          name: lon
          required: false
          type: number
        - format: int32
          in: query
          name: radius
          required: false
          type: integer
        - format: int32
          in: query
          name: offset
          required: false
          type: integer
        - format: int32
          in: query
          name: limit
          required: false
          type: integer
        - in: query
          name: expand
          required: false
          type: string
        - in: query
          name: type
          required: false
          type: string
        - in: query
          name: provider
          required: false
          type: string
        - in: query
          name: providernetwork
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AreaJO"
        "403":
          description: |-
            Forbidden
            If provider is not allowed to display this area.
          schema:
            $ref: "#/definitions/AreaJO"
        "404":
          description: |-
            Not Found
            If no area was found for the given UID.
          schema:
            $ref: "#/definitions/AreaJO"
      summary: List Areas by Criteria.
      tags:
        - areas
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/areas/{areaUID}":
    get:
      description: Search for a specific area by UID.
      operationId: getArea
      parameters:
        - description: "The Area UID "
          in: path
          name: areaUID
          required: true
          type: string
        - description: Expand Provider
          in: query
          name: expand
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AreaJO"
        "403":
          description: |-
            Forbidden
            If provider is not allowed to display this area.
          schema:
            $ref: "#/definitions/AreaJO"
        "404":
          description: |-
            Not Found
            If no area was found for the given UID.
          schema:
            $ref: "#/definitions/AreaJO"
      summary: Get area by UID.
      tags:
        - areas
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /bookingproposals:
    get:
      description: Here you can query all bookable Rental Objects with different Parameters (Time, Location,...)
      operationId: listBookingProposals
      parameters:
        - format: double
          in: query
          name: lat
          required: false
          type: number
        - format: double
          in: query
          name: lon
          required: false
          type: number
        - format: int32
          in: query
          name: radius
          required: false
          type: integer
        - format: int32
          in: query
          name: offset
          required: false
          type: integer
        - format: int32
          in: query
          name: limit
          required: false
          type: integer
        - in: query
          name: providernetwork
          required: false
          type: string
        - in: query
          name: begin
          required: false
          type: string
        - in: query
          name: end
          required: false
          type: string
        - in: query
          name: expand
          required: false
          type: string
        - in: query
          name: view
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/RentalObjectJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Query for available RentalObjects of a specific view
      tags:
        - bookingproposals
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /index:
    get:
      description: Show Service index.
      operationId: getIndex
      produces:
        - application/json
      responses:
        "200":
          description: successful operation
          schema:
            $ref: "#/definitions/JsonCollection"
      summary: Show index.
      tags:
        - index
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/providernetworks/{providernetworkUID}/categories":
    get:
      description: Search for categorie.
      operationId: listCategories
      parameters:
        - in: path
          name: providernetworkUID
          required: true
          type: string
        - in: query
          name: expand
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/CategoryJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Lists all categories
      tags:
        - categories
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/providernetworks/{providernetworkUID}/categories/{categoryUID}":
    get:
      description: Search for categorie.
      operationId: getCategory
      parameters:
        - description: Provider Network UID
          in: path
          name: providernetworkUID
          required: true
          type: string
        - in: path
          name: categoryUID
          required: true
          type: string
        - in: query
          name: expand
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/CategoryJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Get a Category by UID
      tags:
        - categories
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/providernetworks/{providernetworkUID}/prices":
    get:
      description: |
        Prices of a rental object by query params. The params depend on the price determination strategy of the provider network.
      operationId: getPrices
      parameters:
        - in: path
          name: providernetworkUID
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/RentalObjectJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Get information about the prices.
      tags:
        - prices
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/providernetworks/{providernetworkUID}/rentalobjects/{rentalObjectUID}":
    get:
      description: |
        Get information about the Rental Object.
      operationId: getRentalObject
      parameters:
        - in: path
          name: rentalObjectUID
          required: true
          type: string
        - in: path
          name: providernetworkUID
          required: true
          type: string
        - in: query
          name: expand
          required: false
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/RentalObjectJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Get information about the RentalObject.
      tags:
        - rentalobjects
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/providernetworks/{uid}":
    get:
      description: |
        Get information about the ProviderNetworkResources.
      operationId: getProviderNetwork
      parameters:
        - in: path
          name: uid
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/RentalObjectJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Get information about the ProviderNetworkResources.
      tags:
        - providernetworks
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/providers/{uid}":
    get:
      description: |
        Get information about the ProviderResourcesCtrl.
      operationId: getProvider
      parameters:
        - in: path
          name: uid
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/RentalObjectJO"
        "400":
          description: |-
            Bad Request
            One or more parameters have invalid values.
          schema:
            $ref: "#/definitions/ErrorJO"
        "403":
          description: |-
            Forbidden
            Provider is not allowed to use this interface.
          schema:
            $ref: "#/definitions/ErrorJO"
      summary: Get information about the ProviderResourceImpl.
      tags:
        - providers
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
definitions:
  AddressJO:
    properties:
      city:
        type: string
      district:
        type: string
      isoCountryCode:
        type: string
      number:
        type: string
      street:
        type: string
      zip:
        type: string
    type: object
  AreaJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      address:
        $ref: "#/definitions/AddressJO"
      attributes:
        additionalProperties:
          type: object
        type: object
      description:
        type: string
      expand:
        type: string
      geometry:
        $ref: "#/definitions/GeometryJO"
      href:
        type: string
      name:
        type: string
      provider:
        $ref: "#/definitions/ProviderJO"
      providerAreaId:
        type: string
      providerNetworkIds:
        items:
          format: int32
          type: integer
        type: array
      type:
        enum:
          - STATION
          - OPERATIONAREA
          - PARKINGAREA
          - GASSTATION
          - UNKNOWN
        type: string
      uid:
        type: string
    type: object
  BookingProposalJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      area:
        $ref: "#/definitions/AreaJO"
      attributes:
        additionalProperties:
          type: object
        type: object
      description:
        type: string
      distance:
        format: double
        type: number
      expand:
        type: string
      href:
        type: string
      name:
        type: string
      position:
        $ref: "#/definitions/GeoJsonObject"
      price:
        $ref: "#/definitions/JsonCollectionPriceJO"
      rentalObject:
        $ref: "#/definitions/RentalObjectJO"
      uid:
        type: string
    type: object
  CategoryJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      attributes:
        additionalProperties:
          type: object
        type: object
      description:
        type: string
      expand:
        type: string
      href:
        type: string
      name:
        type: string
      price:
        items:
          $ref: "#/definitions/PriceJO"
        type: array
      uid:
        type: string
    type: object
  Crs:
    properties:
      properties:
        additionalProperties:
          type: object
        type: object
      type:
        enum:
          - name
          - link
        type: string
    type: object
  ErrorJO:
    properties:
      attributes:
        additionalProperties:
          type: string
        type: object
      code:
        format: int32
        type: integer
      level:
        enum:
          - INFO
          - WARNING
          - ERROR
        type: string
      message:
        type: string
      name:
        type: string
    type: object
  Feature:
    discriminator: type
    properties:
      bbox:
        items:
          format: double
          type: number
        type: array
      crs:
        $ref: "#/definitions/Crs"
      geometry:
        $ref: "#/definitions/GeoJsonObject"
      id:
        type: string
      properties:
        additionalProperties:
          type: object
        type: object
    type: object
  FeatureCollection:
    allOf:
      - $ref: "#/definitions/GeoJsonObject"
      - properties:
          features:
            items:
              $ref: "#/definitions/Feature"
            type: array
        type: object
  GeoJsonObject:
    discriminator: type
    properties:
      bbox:
        items:
          format: double
          type: number
        type: array
      crs:
        $ref: "#/definitions/Crs"
    type: object
  GeometryJO:
    properties:
      centroid:
        $ref: "#/definitions/Point"
      position:
        $ref: "#/definitions/GeoJsonObject"
    type: object
  JsonCollection:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      href:
        type: string
      items:
        items:
          $ref: "#/definitions/JsonObject"
        type: array
      limit:
        format: int32
        type: integer
      offset:
        format: int32
        type: integer
      size:
        format: int64
        type: integer
    type: object
  JsonCollectionPriceJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      href:
        type: string
      items:
        items:
          $ref: "#/definitions/PriceJO"
        type: array
      limit:
        format: int32
        type: integer
      offset:
        format: int32
        type: integer
      size:
        format: int64
        type: integer
    type: object
  JsonObject:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      attributes:
        additionalProperties:
          type: object
        type: object
      description:
        type: string
      expand:
        type: string
      href:
        type: string
      name:
        type: string
      uid:
        type: string
    type: object
  LineString:
    allOf:
      - $ref: "#/definitions/GeoJsonObject"
      - type: object
  LinkJO:
    properties:
      href:
        type: string
      rel:
        type: string
      verb:
        type: string
    type: object
  LngLatAlt:
    properties:
      altitude:
        format: double
        type: number
      latitude:
        format: double
        type: number
      longitude:
        format: double
        type: number
    type: object
  MultiLineString:
    allOf:
      - $ref: "#/definitions/GeoJsonObject"
      - properties:
          coordinates:
            items:
              items:
                $ref: "#/definitions/LngLatAlt"
              type: array
            type: array
        type: object
  MultiPoint:
    allOf:
      - $ref: "#/definitions/GeoJsonObject"
      - properties:
          coordinates:
            items:
              $ref: "#/definitions/LngLatAlt"
            type: array
        type: object
  MultiPolygon:
    allOf:
      - $ref: "#/definitions/GeoJsonObject"
      - properties:
          coordinates:
            items:
              items:
                items:
                  $ref: "#/definitions/LngLatAlt"
                type: array
              type: array
            type: array
        type: object
  Point:
    discriminator: type
    properties:
      bbox:
        items:
          format: double
          type: number
        type: array
      coordinates:
        $ref: "#/definitions/LngLatAlt"
      crs:
        $ref: "#/definitions/Crs"
    type: object
  Polygon:
    allOf:
      - $ref: "#/definitions/GeoJsonObject"
      - properties:
          coordinates:
            items:
              items:
                $ref: "#/definitions/LngLatAlt"
              type: array
            type: array
        type: object
  PriceJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      attributes:
        additionalProperties:
          type: object
        type: object
      currency:
        type: string
      description:
        type: string
      expand:
        type: string
      grossamount:
        format: double
        type: number
      href:
        type: string
      interval:
        format: int32
        type: integer
      name:
        type: string
      preferredprice:
        default: false
        type: boolean
      taxrate:
        format: double
        type: number
      type:
        enum:
          - TIME
          - DISTANCE
        type: string
      uid:
        type: string
    type: object
  ProviderJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      attributes:
        additionalProperties:
          type: object
        type: object
      description:
        type: string
      expand:
        type: string
      href:
        type: string
      name:
        type: string
      uid:
        type: string
    type: object
  RentalObjectJO:
    properties:
      _links:
        items:
          $ref: "#/definitions/LinkJO"
        type: array
      attributes:
        additionalProperties:
          type: object
        type: object
      category:
        $ref: "#/definitions/CategoryJO"
      description:
        type: string
      expand:
        type: string
      href:
        type: string
      name:
        type: string
      provider:
        $ref: "#/definitions/ProviderJO"
      providerNetworkIds:
        items:
          format: int32
          type: integer
        type: array
      providerRentalObjectId:
        type: string
      rentalModel:
        enum:
          - FREEFLOATING
          - FREEFLOATINGWITHSTATION
          - STATIONBASED
          - PARKINGAREA
          - UNKNOWN
        type: string
      type:
        enum:
          - VEHICLE
          - VEHICLEPOOL
          - BIKE
          - PEDELEC
          - UNKNOWN
        type: string
      uid:
        type: string
    type: object
