openapi: 3.0.0
servers:
  - url: http://api.staging-ecotaco.com
info:
  description: |-
    The API ecotaco allows you to connect, create an account,
    manage your credit cards and order rides.

    # Authentication

    Ecotaco API use a system of application key and authentification token.

    ## Application key :

    The application key is generated by Ecota.co and unique to an application.

    Before accessing EcoTa.co APIs, you need to register your application. Please supply the following information to dev@ecota.co:

    - Application name

    - Company (if appropriate)

    - Contact name, phone and address

    - Contact email

    - Is this a web application, a desktop application, or an application running on a device?

    - Short description of your application

    It **must** be passed on request : "accounts -> login", "accounts -> facebook login" and "accounts -> register" .

    ## Authentification token :

    The authentification token is retrieved at login or register of an user.

    It **must** be passed in request for authenticate action in Authorization HTTP header.

    Example :

    Authorization: Token token=e55887022c1aca4c86abcc49e85ceb8a0c855d2af4d9fac75c08040a583dcde4

    # Language

    On some of our resources, we filter the content displayed based on the Accept-Language header.
    If the language is not defined or if we don't use the language defined in this header, we automatically use French as the default language.
    EcoTa.co currently support two languages: English, French. ("en" and "fr")

    # Encoding

    All requests and answers on EcoTa.co are in UTF-8.
  title: api.ecota.co v2
  version: 1.0.0
  x-apisguru-categories:
    - location
  x-logo:
    backgroundColor: "#FFFFFF"
    url: https://api.apis.guru/v2/cache/logo/https_pbs.twimg.com_profile_images_674904964125368320_5Z7DncLT_400x400.png
  x-origin:
    - converter:
        url: https://github.com/mermade/oas-kit
        version: 7.0.4
      format: openapi
      url: https://ecotaco.docs.apiary.io/api-description-document
      version: "3.0"
  x-providerName: staging-ecotaco.com
tags:
  - name: EcoTa.co API Root
  - description: |-
      The account methods use the User ressource.

      The User ressource has the following attributes :

      - **id** (required, unique, integer) : ID of the User

      - **name** (required, string) : Name of the User

      - **first_name** (required, string) : First name of the User

      - **email** (required, unique, string) : Email of the User

      - **phone** (required, string) : Phone of the User

      - **birth_date** (optional, string) : Birth date of the User

      - **language** (required, string) : Language of the User (fixed by the application)

      - **referral_code** (optional, string) : Driver referal code

      - **avatar_url** (optional, string) : Avatar Url of the User (fixed by the application, gravatar or facebook)

      - **newsletter** (required, boolean) : True if User want to receive the newsletter

      - **addresses** : An Array of addresses (see *Addresses*)

      - **companies** : An Array of companies (see *Companies*)

      The User have a array of **Addresses** with the following attributes :

      - **city** (required, string) : City

      - **country** (required, string) : Country

      - **latitude** (required, float) : Latitude of the Address

      - **longitude** (required, float) : Longitude of the Address

      - **postal_code** (required, integer) : Postal Code

      - **type_address** (required, string) : Address Type (HOME of User)

      - **address_complement** (optional, string) : Address complement

      - **label** (optional, string) : Address Type (HOME of User)

      The User have a array of **Companies** with the following attributes :

      - **id** (required, string) : Id

      - **user_id** (required, string) : Id of user attached to the company

      - **type_relation** (required, float) : Relation and role in the company

      - **name** (required, float) : Name of company

      **type_relation** :

      - company_manager : Can manage user and reserve for others user with relation on the company

      - visitor : Visitor of the company

      - collaborator : Collaborator of the company
    name: Accounts
  - description: |-
      CreditCards resource

      The Credit Card ressource has the following attributes :

      - **id** (required, unique, integer) : ID of the credit card

      - **card_id** (required, string) : External stripe ID

      - **card_type** (required,string) : Card Type

      - **client** (required,string) : External stripe Customer ID

      - **expire_month** (required, integer) : Expire Mouth

      - **expire_year** (required, integer) : Expire Year

      - **label** (required, string) : Label of the Card

      - **last4** (required, string) : Last four digit in the card

      - **type_transaction** (required, string) : Type transaction (default : card)

      - **user_id** (required, integer) : ID of the User
    name: CreditCards
  - description: |-
      The Ride resource has the following attributes :

      - **id** (required, unique, integer) : ID of the Ride

      - **booking_user_id** (integer) : ID of user who have create the ride

      - **company_id** (integer) : ID of company who have create the ride

      - **requested_start** (required, date) : Requested date of the ride

      - **flight_number** (string) : Fligth number

      - **train_number**  (string) : Train number

      - **nb_passengers** (required, integer) : Number of passengers (de 1 à 8)

      - **pick_up_or_tacking_out** (boolean) : If pick up or tacking out in station or other

      - **comment** (string) : Comment of ride forward to driver

      - **points** : Array of Points (see *Points*)
       one start point and one end point is required to create a ride

      - **passengers** : Array of Passengers (see *Passengers*)
       One passenger (attribute main: true) is mandatory to book a ride

      - **distance** (float) : Distance in Km

      - **driver_arrival** (date) : Date of real driver arrival

      - **duration** (integer) : Duration of the Ride in seconds

      - **price** (float) : price of the ride (without promotion)

      - **total_price** (float) : total price of the Ride

      - **real_end** (date) : Date of real end of ride

      - **real_start** (date) : Date of real start of ride

      - **refused_label** (string) : Refused Label (see *REFUSED_LABELS*)

      - **status** (string) : Status of the ride (see *STATUSES*)

      - **eta** (integer) : Estimated Time of arrival

      - **driver** (hash) : Information about driver (see *Driver*)

      - **vehicle** (hash) : Information about vehicle (see *Vehicle*)

      - **estimated_start** (date) : Estimated Start date of the ride

      - **estimated_end** (date) : Estimated End date of the ride

      - **promotional_code_used** : Promotional code use if any

      **STATUSES** :

      - NONE = ''

      - REFUSED = 'refused'
      The ride can not be reserved

      - ESTIMATED = 'estimated'
      We have availability for the ride, it can be reserved

      - RESERVED = 'reserved'

      - AFFECTED = 'affected'

      - SENT = 'sent'

      - IN_PROGRESS = 'in_progress'

      - CANCELLED = 'cancelled'

      - CUSTOMER_MISSING = 'customer_missing'

      - FINISHED = 'finished'

      - FAILED = 'failed'

      **REFUSED_LABELS** :

      - NOT_IN_A_CATCHEMENT_AREA = 'not_in_a_catchement_area'

      - ROUTE_COULD_NOT_BE_CALCULATE = 'route_could_not_be_calculate'

      - NO_DRIVER_AVAILABLE_WITH_MORE_THAN_4_PLACES = 'no_driver_available_with_vehicle_with_more_4_places'

      - NO_DRIVER_AVAILABLE = 'no_driver_available'

      - PLANNED_DRIVERS_BUT_NOT_CONNECTED = 'planned_drivers_but_not_conected'

      - ERROR_ON_ONLINE_AND_NEAR_OF = 'error_on_online_and_near_of'

      - TOMTOM_QUOTA_REACHED = 'tomtom_error_request_quota_reached'

      - AUTHORIZATION_REFUSED = 'authorization_refused'

      The Ride have a array of **Points** with the following attributes :

      Only one point with type start and only one point with type start

      - **id** (required, unique, integer) : ID of the Point

      - **longitude** (required, float) : Longitude of the Point

      - **latitude** (required, float) : Latitude of the Point

      - **type_point** (required, string) : Point Type ( 'start' or 'end' )

      - **address** (optional, string) : Address of the Point

      - **address_complement** (optional, string) : Address Complement of the Point

      - **postal_code** (optional, integer) : Postal Code of the Point

      - **city** (optional, string) : City of the Point

      - **country** (optional, string) : Country of the Point

      - **user_input** (optional, string) : User Input for the Point

      - **catchement_areas_id** (required, string) : Catchement Areas ID of the Point (fixed by the application)

      - **ride_id** (required, integer) : The Ride ID (fixed by the application)

      - **comment** (optional, string): Additionnals informations or comment

      - **contacts** (optional, array): Array of Contacts (see *Contacts*)

      The Point may have a array of **Contacts** with the following attributes :

      The contact on the pick up or drop off point

      - **email** (optional, string) : Email of the Contact

      - **first_name** (optional, string) : Fist Name of the Contact

      - **last_name** (optional, string) : Name of the Contact

      - **phone** (optional, string) : Phone number of the Contact

      The Ride have a array of **Passengers** with the following attributes :

      One main passenger (with main attribute at true) is required to book a ride

      - **main** (required, boolean) : If the passenger is the main passenger

      - **first_name** (optional, string) : Fist Name of the Passenger

      - **name** (optional, string) : Last Name of the Passenger

      - **phone** (optional, string) : Phone number of the Passenger (in international format)

      - **email** (optional, string) : Email of the Passenger (required for create user)

      - **user_id** (optional, integer) : The User ID related to the passenger if exist

      - **company_relation** (optional, integer) : The type of relation with the company for the passenger (if register is true)

      - **register** (optional, integer) : for register the passenger

      The Ride have a hash of **Driver** with the following attributes :

      This information is provided when the ride is in_progress status

      - **first_name** (optional, string) : Fist Name of the driver

      - **phone** (optional, string) : Phone number of the driver

      - **latitude** (optional, string) : Latitude of driver

      - **longitude** (optional, string) : Longitude of driver

      The Ride have a hash of **Vehicle** with the following attributes :

      This information is provided when the ride is in_progress status

      - **manufacturer** (optional, string) : Manufacturer of the vehicle

      - **color** (optional, string) : Color of the vehicle

      - **model** (optional, string) : Model of the vehicle
    name: Rides
  - description: |-
      Promotional Codes resource

      The Promotional Codes ressource has the following attributes :

      - **id** (required, unique, integer) : ID of the affected promotional code

      - **status** (required, string) : Status of the affected promotional code ('used' or 'notused')

      - **code** (required, string) : The code of the promotional code

      - **label** (required, string) : Label of the promotional code

      - **promotional_type** (required, string) : The type of promotional code ('pourcent', 'amount' or 'km')

      - **value** (required, float) : the value of the promotional code

      - **start_date** (required, date) : Start Date for the promotional code

      - **end_date** (required, date) : End Date for the promotional code
    name: Promotional Codes
  - description: The Addresses use google API for searching places, and also user favorite or best places.
    name: Adresses
  - description: |-
      Catchement area resource

      The catchement area ressource has the following attributes :

      - **id** (required, unique, integer) : ID of the catchement area

      - **label** (required, string) : Label

      - **launch_at** (required, date) : Launch date of catchement area

      - **coordinates** (required, array) : coordinates

      **Coordinates** :

      - **id** (required, unique, integer) : ID of the coordinates

      - **latitude** (required, float) : Latitude of the coordinates

      - **longitude** (required, float) : Longitude of the coordinates

      - **rank** (required, integer) : Rank to order coordinates of th catchement area

      We provide json or geojson format
    name: Catchement Areas
  - description: |-
      Product resource

      The product ressource has the following attributes :

      - **id** (required, unique, integer) : ID of the product

      - **product_type** (required, string) : Product type (See *TYPES*)

      - **name** (required, dastringte) : Name of product

      - **description** (required, string) : Description of product

      **TYPES** :

      - transport_person : On demand transport person

      - package_delivery : Package delivery
    name: Products
paths:
  /:
    get:
      description: ""
      operationId: Retrieve the version API
      responses:
        "200":
          content:
            application/vnd.siren+json:
              examples:
                response:
                  value:
                    links:
                      self: https://api.ecota.co
                      v2: https://api.ecota.co/v2
          description: OK
          headers: {}
      summary: Retrieve the version API
      tags:
        - EcoTa.co API Root
  /accounts:
    get:
      description: ""
      operationId: Get current user
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    user:
                      addresses:
                        - address_complement: null
                          city: null
                          company_id: null
                          country: null
                          id: 29
                          label: null
                          latitude: null
                          longitude: null
                          postal_code: null
                          street: null
                          type_address: home
                      auth_token: c1cb860b4fa68ff9f3d94791d28a8c89f89f4b4eceded8eec9f1e6fc10ee4e8c
                      avatar_url: https://gravatar.com/avatar/45def3303a8c2b379605f3db4f61ebcc.png?s=200&d=http%3A%2F%2Fapp.ecota.co%2Fassets%2Fguest.png
                      birth_date: 1983-05-12
                      companies:
                        - id: 10
                          name: EcoTa.co
                          type_relation: company_manager
                          user_id: 18
                      created_at: 2015-05-25T13:37:43+02:00
                      email: maxime.lenne@ecota.co
                      first_name: Lenne
                      free_km_counter: 0
                      free_used_km_counter: 0
                      id: 18
                      language: fr
                      name: Maxime
                      newsletter: "1"
                      phone: "0629453814"
                      referral_code: v8dlb
                      updated_at: 2015-05-25T15:41:11+02:00
          description: OK
          headers: {}
      summary: Get current user
      tags:
        - Accounts
    post:
      description: ""
      operationId: Create a new account with an application key
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              examples:
                response:
                  value:
                    user:
                      addresses:
                        - address_complement: null
                          city: null
                          company_id: null
                          country: null
                          id: 29
                          label: null
                          latitude: null
                          longitude: null
                          postal_code: null
                          street: null
                          type_address: home
                      auth_token: c1cb860b4fa68ff9f3d94791d28a8c89f89f4b4eceded8eec9f1e6fc10ee4e8c
                      avatar_url: https://gravatar.com/avatar/45def3303a8c2b379605f3db4f61ebcc.png?s=200&d=http%3A%2F%2Fapp.ecota.co%2Fassets%2Fguest.png
                      birth_date: 1983-05-12
                      companies:
                        - id: 10
                          name: EcoTa.co
                          type_relation: company_manager
                          user_id: 18
                      created_at: 2015-05-25T13:37:43+02:00
                      email: maxime.lenne@ecota.co
                      first_name: Lenne
                      free_km_counter: 0
                      free_used_km_counter: 0
                      id: 18
                      language: fr
                      name: Maxime
                      newsletter: "1"
                      phone: "0629453814"
                      referral_code: v8dlb
                      updated_at: 2015-05-25T15:41:11+02:00
          description: Created
          headers: {}
      summary: Create a new account with an application key
      tags:
        - Accounts
    put:
      description: ""
      operationId: Update User
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    user:
                      addresses:
                        - address_complement: null
                          city: null
                          company_id: null
                          country: null
                          id: 29
                          label: null
                          latitude: null
                          longitude: null
                          postal_code: null
                          street: null
                          type_address: home
                      auth_token: c1cb860b4fa68ff9f3d94791d28a8c89f89f4b4eceded8eec9f1e6fc10ee4e8c
                      avatar_url: https://gravatar.com/avatar/45def3303a8c2b379605f3db4f61ebcc.png?s=200&d=http%3A%2F%2Fapp.ecota.co%2Fassets%2Fguest.png
                      birth_date: 1983-05-12
                      companies:
                        - id: 10
                          name: EcoTa.co
                          type_relation: company_manager
                          user_id: 18
                      created_at: 2015-05-25T13:37:43+02:00
                      email: maxime.lenne@ecota.co
                      first_name: Lenne
                      free_km_counter: 0
                      free_used_km_counter: 0
                      id: 18
                      language: fr
                      name: Maxime
                      newsletter: "1"
                      phone: "0629453814"
                      referral_code: v8dlb
                      updated_at: 2015-05-25T15:41:11+02:00
          description: OK
          headers: {}
      summary: Update User
      tags:
        - Accounts
  /accounts/password:
    post:
      description: ""
      operationId: Forget password with email
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "201":
          description: Created
          headers: {}
      summary: Forget password with email
      tags:
        - Accounts
  /accounts/payment_methods:
    get:
      description: ""
      operationId: Payment Methods
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    payment_methods:
                      - at: ride_end
                        by_id: 13
                        by_type: User
                        credit_card_id: 1
                        credit_card_label: perso
                        method: credit_card
                        to: ecotaco
                      - at: ride_end
                        by_id: 7
                        by_type: Company
                        credit_card_id: 2
                        credit_card_label: Pro entrep
                        method: credit_card
                        to: ecotaco
                      - at: month_end
                        by_id: 7
                        by_type: Company
                        method: transfer
                        to: ecotaco
                      - at: ride_end
                        by_id: 13
                        by_type: User
                        method: cash
                        to: driver
          description: OK
          headers: {}
      summary: Payment Methods
      tags:
        - Accounts
  /accounts/settings:
    post:
      description: ""
      operationId: Settings
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    user:
                      addresses:
                        - address_complement: null
                          city: null
                          company_id: null
                          country: null
                          id: 29
                          label: null
                          latitude: null
                          longitude: null
                          postal_code: null
                          street: null
                          type_address: home
                      auth_token: c1cb860b4fa68ff9f3d94791d28a8c89f89f4b4eceded8eec9f1e6fc10ee4e8c
                      avatar_url: https://gravatar.com/avatar/45def3303a8c2b379605f3db4f61ebcc.png?s=200&d=http%3A%2F%2Fapp.ecota.co%2Fassets%2Fguest.png
                      birth_date: 1983-05-12
                      companies:
                        - id: 10
                          name: EcoTa.co
                          type_relation: company_manager
                          user_id: 18
                      created_at: 2015-05-25T13:37:43+02:00
                      email: maxime.lenne@ecota.co
                      first_name: Lenne
                      free_km_counter: 0
                      free_used_km_counter: 0
                      id: 18
                      language: fr
                      name: Maxime
                      newsletter: "1"
                      phone: "0629453814"
                      referral_code: v8dlb
                      updated_at: 2015-05-25T15:41:11+02:00
          description: OK
          headers: {}
      summary: Settings
      tags:
        - Accounts
  /accounts/sign_in:
    post:
      description: ""
      operationId: Login with email, password and application key
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    user:
                      addresses:
                        - address_complement: null
                          city: null
                          company_id: null
                          country: null
                          id: 29
                          label: null
                          latitude: null
                          longitude: null
                          postal_code: null
                          street: null
                          type_address: home
                      auth_token: c1cb860b4fa68ff9f3d94791d28a8c89f89f4b4eceded8eec9f1e6fc10ee4e8c
                      avatar_url: https://gravatar.com/avatar/45def3303a8c2b379605f3db4f61ebcc.png?s=200&d=http%3A%2F%2Fapp.ecota.co%2Fassets%2Fguest.png
                      birth_date: 1983-05-12
                      companies:
                        - id: 10
                          name: EcoTa.co
                          type_relation: company_manager
                          user_id: 18
                      created_at: 2015-05-25T13:37:43+02:00
                      email: maxime.lenne@ecota.co
                      first_name: Lenne
                      free_km_counter: 0
                      free_used_km_counter: 0
                      id: 18
                      language: fr
                      name: Maxime
                      newsletter: "1"
                      phone: "0629453814"
                      referral_code: v8dlb
                      updated_at: 2015-05-25T15:41:11+02:00
          description: OK
          headers: {}
      summary: Login with email, password and application key
      tags:
        - Accounts
  /accounts/update_password:
    put:
      description: ""
      operationId: Update Password
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    user:
                      addresses:
                        - address_complement: null
                          city: null
                          company_id: null
                          country: null
                          id: 29
                          label: null
                          latitude: null
                          longitude: null
                          postal_code: null
                          street: null
                          type_address: home
                      auth_token: c1cb860b4fa68ff9f3d94791d28a8c89f89f4b4eceded8eec9f1e6fc10ee4e8c
                      avatar_url: https://gravatar.com/avatar/45def3303a8c2b379605f3db4f61ebcc.png?s=200&d=http%3A%2F%2Fapp.ecota.co%2Fassets%2Fguest.png
                      birth_date: 1983-05-12
                      companies:
                        - id: 10
                          name: EcoTa.co
                          type_relation: company_manager
                          user_id: 18
                      created_at: 2015-05-25T13:37:43+02:00
                      email: maxime.lenne@ecota.co
                      first_name: Lenne
                      free_km_counter: 0
                      free_used_km_counter: 0
                      id: 18
                      language: fr
                      name: Maxime
                      newsletter: "1"
                      phone: "0629453814"
                      referral_code: v8dlb
                      updated_at: 2015-05-25T15:41:11+02:00
          description: OK
          headers: {}
      summary: Update Password
      tags:
        - Accounts
  /addresses/places_autocomplete:
    post:
      description: |-
        For searching places just send the following attributes :

        - **longitude** (optional, float) : The location longitude for the seach

        - **latitude** (optional, float) : The location latitude for the seach

        - **search** (required, string) : The search text (most than 3 char)
      operationId: Get autocomplete places
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          headers: {}
      summary: Get autocomplete places
      tags:
        - Adresses
  /addresses/places_details:
    post:
      description: ""
      operationId: Get autocomplete places details
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    city: Lille
                    country: France
                    formatted_address: Lille, France
                    lat: 50.637528
                    lng: 3.070923
                    name: Gare Lille Flandres
                    postal_code: "59800"
                    reference: CnRtAAAAnFiSmz9OFYi4ee_IeN8WgX0kjB50NtCCTTxJdTQzz9F33kC5eit_Z2DIW-MyrbwN9_cJ7lkBznVZ6o_Da52wCTzmKvbHvImkYTD24su-vjUfszNnJRWnV2M0ckZEdJ5vpG1S02m6jgzJ_FmOnImI2BIQh6x7kos53RZHQujnMlRkABoU28Ivbhnf72dh3L6yfqeB-oaIHYs
                    region: null
                    street: null
                    street_number: null
                    vicinity: Lille
          description: OK
          headers: {}
      summary: Get autocomplete places details
      tags:
        - Adresses
  /catchement_areas:
    get:
      description: ""
      operationId: List all catchement areas
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/vnd.geo+json:
              examples:
                response:
                  value:
                    features:
                      - geometry:
                          coordinates:
                            - - - 2.653829
                                - 50.642377
                              - - 2.648937
                                - 50.627461
                              - - 2.780256
                                - 50.586548
                              - - 2.900204
                                - 50.663704
                              - - 2.831196
                                - 50.705252
                              - - 2.778325
                                - 50.700468
                              - - 2.653829
                                - 50.642377
                          type: Polygon
                        properties:
                          id: 4
                          label: Lille forbidden
                        type: Feature
                      - geometry:
                          coordinates:
                            - - - 2.85468817138667
                                - 50.7209296468011
                              - - 2.82172918701167
                                - 50.6948395473376
                              - - 2.75512457275386
                                - 50.6582890133086
                              - - 2.69401312255854
                                - 50.6391321348964
                              - - 2.80318975830073
                                - 50.5240267810597
                              - - 2.92953253173823
                                - 50.4803527849672
                              - - 3.02772283935542
                                - 50.4742352023462
                              - - 3.25980902099604
                                - 50.4571891900493
                              - - 3.31817388916011
                                - 50.5558832982945
                              - - 3.43709230804438
                                - 50.6039001101805
                              - - 3.34576845550532
                                - 50.6888041447647
                              - - 3.32585573577876
                                - 50.7431491302235
                              - - 3.11780214691157
                                - 50.8208614514023
                              - - 2.89120912933345
                                - 50.7431491302235
                              - - 2.85468817138667
                                - 50.7209296468011
                          type: Polygon
                        properties:
                          id: 1
                          label: Lille
                        type: Feature
                      - geometry:
                          coordinates:
                            - - - 1.34239196777344
                                - 43.665388118352
                              - - 1.37603759765625
                                - 43.7284369679607
                              - - 1.54838562011719
                                - 43.6713483259687
                              - - 1.54220581054688
                                - 43.4947753137023
                              - - 1.34925842285156
                                - 43.5002543647898
                              - - 1.22085571289062
                                - 43.5788986029537
                              - - 1.34239196777344
                                - 43.665388118352
                          type: Polygon
                        properties:
                          id: 2
                          label: Toulouse
                        type: Feature
                      - geometry:
                          coordinates:
                            - - - 2.874408
                                - 50.702182
                              - - 2.918353
                                - 50.753905
                              - - 2.833212
                                - 50.772398
                              - - 2.812956
                                - 50.702651
                              - - 2.861475
                                - 50.656127
                              - - 2.979921
                                - 50.661786
                              - - 2.874408
                                - 50.702182
                          type: Polygon
                        properties:
                          id: 3
                          label: Lille exclusive
                        type: Feature
                    type: FeatureCollection
          description: OK
          headers: {}
      summary: List all catchement areas
      tags:
        - Catchement Areas
  "/catchement_areas/{id}":
    get:
      description: ""
      operationId: Get a Catchement Area
      parameters:
        - description: Numeric `id` of the Catchement Area
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/vnd.geo+json:
              examples:
                response:
                  value:
                    geometry:
                      coordinates:
                        - - - 2.85468817138667
                            - 50.7209296468011
                          - - 2.82172918701167
                            - 50.6948395473376
                          - - 2.75512457275386
                            - 50.6582890133086
                          - - 2.69401312255854
                            - 50.6391321348964
                          - - 2.80318975830073
                            - 50.5240267810597
                          - - 2.92953253173823
                            - 50.4803527849672
                          - - 3.02772283935542
                            - 50.4742352023462
                          - - 3.25980902099604
                            - 50.4571891900493
                          - - 3.31817388916011
                            - 50.5558832982945
                          - - 3.43709230804438
                            - 50.6039001101805
                          - - 3.34576845550532
                            - 50.6888041447647
                          - - 3.32585573577876
                            - 50.7431491302235
                          - - 3.11780214691157
                            - 50.8208614514023
                          - - 2.89120912933345
                            - 50.7431491302235
                          - - 2.85468817138667
                            - 50.7209296468011
                      type: Polygon
                    properties:
                      id: 1
                      label: Lille
                    type: Feature
          description: OK
          headers: {}
      summary: Get a Catchement Area
      tags:
        - Catchement Areas
  /credit_cards:
    get:
      description: ""
      operationId: List all CreditCards for the current User
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          headers: {}
      summary: List all CreditCards for the current User
      tags:
        - CreditCards
  "/credit_cards/{id}":
    get:
      description: ""
      operationId: Get a CreditCard
      parameters:
        - description: Numeric `id` of the Credit Card
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
      responses:
        "200":
          description: OK
          headers: {}
      summary: Get a CreditCard
      tags:
        - CreditCards
  /products:
    get:
      description: ""
      operationId: List all products
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    - product:
                        description: Transport de personne à la demande (VTC / DREAL / Taxi)
                        id: 1
                        name: Transport à la demande
                        product_type: transport_person
                    - product:
                        description: Transport de colis
                        id: 2
                        name: Transport de colis
                        product_type: package_delivery
          description: OK
          headers: {}
      summary: List all products
      tags:
        - Products
  "/products/{id}":
    get:
      description: ""
      operationId: Get a Product
      parameters:
        - description: Numeric `id` of the Product
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    product:
                      description: Transport de personne à la demande (VTC / DREAL / Taxi)
                      id: 1
                      name: Transport à la demande
                      product_type: transport_person
          description: OK
          headers: {}
      summary: Get a Product
      tags:
        - Products
  /promotional_codes:
    get:
      description: ""
      operationId: Get all promotional codes for user
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    - promotional_code:
                        code: PROMOCODE
                        created_at: 2014-07-02T17:38:42+02:00
                        end_date: 2099-01-31T00:00:00+01:00
                        id: 4
                        label: Parrainage chauffeur
                        promotional_type: pourcent
                        start_date: 2012-11-01T00:00:00+01:00
                        status: notused
                        value: 10
          description: OK
          headers: {}
      summary: Get all promotional codes for user
      tags:
        - Promotional Codes
    post:
      description: ""
      operationId: Add a promotional code
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
      responses:
        "201":
          description: Created
          headers: {}
      summary: Add a promotional code
      tags:
        - Promotional Codes
  "/rides/{id}":
    get:
      description: ""
      operationId: Get a ride
      parameters:
        - description: Numeric `id` of Ride
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    ride:
                      booking_user_id: 11
                      comment: null
                      company_id: null
                      distance: 10.079
                      driver:
                        first_name: Céline
                        phone: "0629453814"
                      driver_arrival: null
                      duration: 1096
                      estimated_end: 2014-06-12T17:03:55+02:00
                      estimated_start: 2014-06-12T16:45:39+02:00
                      eta: 1357
                      flight_number: null
                      id: 322
                      nb_passengers: 1
                      passengers:
                        - email: admin@ecota.co
                          first_name: Jean-Phil
                          id: 315
                          main: true
                          name: Monslip
                          phone: "0629453814"
                          user_id: 11
                      pick_up_or_tacking_out: false
                      points:
                        - address: 53-57 Rue Masséna
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Lille
                          comment: null
                          contacts:
                            - email: ""
                              first_name: ""
                              last_name: ""
                              phone: ""
                          country: France
                          id: 631
                          latitude: 50.63217
                          longitude: 3.054924
                          postal_code: 59800
                          type_point: start
                          user_input: 53-57 Rue Masséna
                        - address: Rue de l'Harmonie
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Villeneuve-d'Ascq
                          country: France
                          id: 632
                          latitude: 50.60511
                          longitude: 3.15199
                          postal_code: 59650
                          ride_id: 322
                          type_point: end
                          user_input: Rue de l'Harmonie
                      price: 19.8
                      product_id: 1
                      promotional_code_used: null
                      real_end: null
                      real_start: null
                      refused_label: ""
                      requested_start: 2014-06-12T16:23:02+02:00
                      reserved_by_phone: false
                      status: in_progress
                      total_price: 19.8
                      train_number: null
                      vehicle:
                        color: gris
                        manufacturer: Audi
                        model: A4
          description: OK
          headers: {}
      summary: Get a ride
      tags:
        - Rides
  "/rides/{id}/cancel":
    get:
      description: "**Must be authenticate**"
      operationId: Cancel a Ride
      parameters:
        - description: Numeric `id` of Ride
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    ride:
                      booking_user_id: 11
                      comment: null
                      company_id: null
                      created_at: 2014-07-02T17:33:55+02:00
                      distance: 24.248
                      driver:
                        first_name: Céline
                        phone: "0629453814"
                      driver_arrival: null
                      duration: 1424
                      estimated_end: 2014-07-02T18:05:48+02:00
                      estimated_start: 2014-07-02T17:42:04+02:00
                      eta: 397
                      flight_number: null
                      id: 378
                      nb_passengers: 1
                      passengers:
                        - main: true
                          user_id: 11
                        - company_relation: null
                          email: passager@gmail.com
                          first_name: Non registered
                          main: false
                          name: Passenger
                          phone: "0606060606"
                          register: false
                        - company_relation: collaborator
                          email: passager2@gmail.com
                          first_name: To registered
                          main: false
                          name: Passenger
                          phone: "0606060606"
                          register: true
                      pick_up_or_tacking_out: false
                      points:
                        - address: 53-57 Rue Masséna
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Lille
                          comment: null
                          contacts:
                            - email: ""
                              first_name: ""
                              last_name: ""
                              phone: ""
                          country: France
                          id: 631
                          latitude: 50.63217
                          longitude: 3.054924
                          postal_code: 59800
                          type_point: start
                          user_input: 53-57 Rue Masséna
                        - address: Rue de l'Harmonie
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Villeneuve-d'Ascq
                          country: France
                          id: 632
                          latitude: 50.60511
                          longitude: 3.15199
                          postal_code: 59650
                          ride_id: 322
                          type_point: end
                          user_input: Rue de l'Harmonie
                      price: 39.8
                      promotional_code_used: null
                      real_end: null
                      real_start: null
                      refused_label: ""
                      requested_start: 2014-07-02T17:35:27+02:00
                      reserved_by_phone: false
                      status: cancelled
                      total_price: 39.8
                      train_number: null
                      updated_at: 2014-07-02T17:35:34+02:00
                      vehicle:
                        color: gris
                        manufacturer: Audi
                        model: A4
          description: OK
          headers: {}
      summary: Cancel a Ride
      tags:
        - Rides
  "/rides/{id}/cancel_fees":
    get:
      description: "**Must be authenticate**"
      operationId: Cancel fee of a Ride
      parameters:
        - description: Numeric `id` of Ride
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    fee_percent: 0
                    fee_total: 0
                    message: No cancellation fee.
          description: OK
          headers: {}
      summary: Cancel fee of a Ride
      tags:
        - Rides
  "/rides/{id}/estimate":
    get:
      description: ""
      operationId: Estimate a ride
      parameters:
        - description: Numeric `id` of Ride
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    ride:
                      booking_user_id: 11
                      comment: null
                      company_id: null
                      created_at: 2014-07-02T17:33:55+02:00
                      distance: 24.248
                      driver:
                        first_name: Céline
                        phone: "0629453814"
                      driver_arrival: null
                      duration: 1424
                      estimated_end: 2014-07-02T18:03:56+02:00
                      estimated_start: 2014-07-02T17:40:12+02:00
                      eta: 397
                      flight_number: null
                      id: 378
                      nb_passengers: 1
                      pick_up_or_tacking_out: false
                      points:
                        - address: 53-57 Rue Masséna
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Lille
                          comment: null
                          contacts:
                            - email: ""
                              first_name: ""
                              last_name: ""
                              phone: ""
                          country: France
                          id: 631
                          latitude: 50.63217
                          longitude: 3.054924
                          postal_code: 59800
                          type_point: start
                          user_input: 53-57 Rue Masséna
                        - address: Rue de l'Harmonie
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Villeneuve-d'Ascq
                          country: France
                          id: 632
                          latitude: 50.60511
                          longitude: 3.15199
                          postal_code: 59650
                          ride_id: 322
                          type_point: end
                          user_input: Rue de l'Harmonie
                      price: 39.8
                      promotional_code_used: null
                      real_end: null
                      real_start: null
                      refused_label: ""
                      requested_start: 2014-07-02T17:33:35+02:00
                      reserved_by_phone: false
                      status: estimated
                      total_price: 39.8
                      train_number: null
                      updated_at: 2014-07-02T17:34:02+02:00
                      vehicle:
                        color: gris
                        manufacturer: Audi
                        model: A4
          description: OK
          headers: {}
      summary: Estimate a ride
      tags:
        - Rides
  "/rides/{id}/reserve":
    post:
      description: |-
        To book, the ride must belong to the connected user. The ride must have a main passenger at least, the booking user id and the payment hash must be set.

        **Must be authenticate**
      operationId: Reserve a ride
      parameters:
        - description: Numeric `id` of Ride
          example: "1"
          in: path
          name: id
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              examples:
                response:
                  value:
                    ride:
                      booking_user_id: 11
                      comment: null
                      company_id: null
                      created_at: 2014-07-02T17:33:55+02:00
                      distance: 24.248
                      driver:
                        first_name: Céline
                        phone: "0629453814"
                      driver_arrival: null
                      duration: 1424
                      estimated_end: 2014-07-02T18:05:48+02:00
                      estimated_start: 2014-07-02T17:42:04+02:00
                      eta: 397
                      flight_number: null
                      id: 378
                      nb_passengers: 1
                      passengers:
                        - main: true
                          user_id: 11
                        - company_relation: null
                          email: passager@gmail.com
                          first_name: Non registered
                          main: false
                          name: Passenger
                          phone: "0606060606"
                          register: false
                        - company_relation: collaborator
                          email: passager2@gmail.com
                          first_name: To registered
                          main: false
                          name: Passenger
                          phone: "0606060606"
                          register: true
                      pick_up_or_tacking_out: false
                      points:
                        - address: 53-57 Rue Masséna
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Lille
                          comment: null
                          contacts:
                            - email: ""
                              first_name: ""
                              last_name: ""
                              phone: ""
                          country: France
                          id: 631
                          latitude: 50.63217
                          longitude: 3.054924
                          postal_code: 59800
                          type_point: start
                          user_input: 53-57 Rue Masséna
                        - address: Rue de l'Harmonie
                          address_complement: null
                          catchement_areas_id:
                            - 1
                          city: Villeneuve-d'Ascq
                          country: France
                          id: 632
                          latitude: 50.60511
                          longitude: 3.15199
                          postal_code: 59650
                          ride_id: 322
                          type_point: end
                          user_input: Rue de l'Harmonie
                      price: 39.8
                      promotional_code_used: null
                      real_end: null
                      real_start: null
                      refused_label: ""
                      requested_start: 2014-07-02T17:35:27+02:00
                      reserved_by_phone: false
                      status: sent
                      total_price: 39.8
                      train_number: null
                      updated_at: 2014-07-02T17:35:30+02:00
                      vehicle:
                        color: gris
                        manufacturer: Audi
                        model: A4
          description: OK
          headers: {}
      summary: Reserve a ride
      tags:
        - Rides
  "/rides?page={page}&per_page={per_page}":
    get:
      description: ""
      operationId: Get all user rides
      parameters:
        - description: Number of the page to load
          example: "1"
          in: path
          name: page
          required: true
          schema:
            type: number
        - description: Number of items per page to load
          example: "1"
          in: path
          name: per_page
          required: true
          schema:
            type: number
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          headers:
            Current-Page:
              schema:
                type: string
            Link:
              schema:
                type: string
            Per-Page:
              schema:
                type: string
            Total-Entries:
              schema:
                type: string
            Total-Page:
              schema:
                type: string
      summary: Get all user rides
      tags:
        - Rides
    post:
      description: ""
      operationId: Create a ride
      parameters:
        - description: e.g. application/json
          example: application/json
          in: header
          name: Accept
          required: false
          schema:
            type: string
        - description: e.g. en
          example: en
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              examples:
                response:
                  value:
                    ride:
                      booking_user_id: 11
                      comment: null
                      company_id: null
                      created_at: 2014-07-02T17:33:55+02:00
                      distance: null
                      driver:
                        first_name: Céline
                        phone: "0629453814"
                      driver_arrival: null
                      duration: null
                      estimated_end: null
                      estimated_start: 2014-07-02T17:33:35+02:00
                      eta: 0
                      flight_number: null
                      id: 378
                      nb_passengers: 1
                      passengers: []
                      pick_up_or_tacking_out: false
                      points:
                        - address: Rue de l'Harmonie
                          city: Villeneuve-d'Ascq
                          comment: Sonner
                          contacts:
                            - email: ""
                              first_name: ""
                              last_name: ""
                              phone: ""
                          country: France
                          latitude: 50.60511
                          longitude: 3.15199
                          postal_code: 59650
                          type_point: start
                          user_input: Rue de l'Harmonie Villeneuve-d'Ascq France
                        - address: 101 Rue de l'Echauffour..e
                          city: Mouscron
                          comment: Sonner
                          country: Belgium
                          latitude: 50.75434
                          longitude: 3.181706
                          postal_code: 7700
                          type_point: end
                          user_input: 101 Rue de l'Echauffour..e
                      price: null
                      promotional_code_used: null
                      real_end: null
                      real_start: null
                      refused_label: null
                      requested_start: 2014-07-02T17:33:35+02:00
                      reserved_by_phone: false
                      status: null
                      total_price: 0
                      train_number: null
                      updated_at: 2014-07-02T17:33:55+02:00
                      vehicle:
                        color: gris
                        manufacturer: Audi
                        model: A4
          description: Created
          headers: {}
      summary: Create a ride
      tags:
        - Rides
  "/{version}":
    get:
      description: ""
      operationId: Retrieve the Entry Point on Version
      parameters:
        - description: Ecotaco API version
          in: path
          name: version
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/vnd.siren+json:
              examples:
                response:
                  value:
                    links:
                      accounts: https://api.ecota.co/v2/accounts
                      addresses: https://api.ecota.co/v2/addresses
                      catchement_areas: https://api.ecota.co/v2/catchement_areas
                      products: https://api.ecota.co/v2/products
                      promotional_codes: https://api.ecota.co/v2/promotional_codes
                      rides: https://api.ecota.co/v2/rides
                      self: https://api.ecota.co/v2
          description: OK
          headers: {}
      summary: Retrieve the Entry Point on Version
      tags:
        - EcoTa.co API Root
components:
  schemas:
    Autocomplete_places: {}
    Autocomplete_places_details: {}
    Cancel_Ride: {}
    Cancel_fee: {}
    Catchement_Area: {}
    Collection_of_catchement_areas: {}
    Collection_of_products: {}
    Credit_card: {}
    Current_User: {}
    Endpoint: {}
    Estimate_Ride: {}
    Forget_password: {}
    Login: {}
    Password: {}
    Payment_Methods: {}
    Product: {}
    Register: {}
    Reserve_Ride: {}
    Settings: {}
    User_Credit_Cards: {}
    User_Promotional_Codes: {}
    User_Ride: {}
    User_Rides: {}
    Version: {}
