openapi: 3.1.0
info:
  title: API LeasingSH.ro
  version: 1.0.0
  description: |
    API public read-only, folosit pentru a căuta și a consulta oferte de leasing auto noi și rulate
    listate pe LeasingSH.ro. Ideal pentru integrare cu asistenți AI, aplicații externe sau
    servicii de analiză.

    Public read-only API, used to search and query new and used car leasing offers listed on LeasingSH.ro.
    Ideal for integration with AI assistants, external applications or analysis services.
servers:
  - url: https://leasingsh.ro

paths:
  /api/public/v1/list-offers:
    get:
      operationId: listOffers
      summary: Caută oferte auto folosind filtre / Search car offers with filters
      description: |
        Returnează o listă paginată de oferte auto în funcție de filtrele furnizate.
        Această rută este optimizată pentru consum rapid de către aplicații, integratori și asistenți AI.

        Returns a paginated list of car offers based on the provided filters.
        This route is optimized for AI assistants and external integrations.
      parameters:
        - in: query
          name: makeName
          schema: { type: string }
          description: 'Marca (ex: Dacia, BMW) / Car make (e.g. Dacia, BMW)'
        - in: query
          name: modelName
          schema: { type: string }
          description: |
            Modelul (ex: Duster, Seria 3) / Car model (e.g. Duster, 3 Series)
            **Poate fi furnizat numai dacă makeName este prezent / Only allowed if makeName is provided**
        - in: query
          name: bodyTypeName
          schema: { type: string }
          description: Tipul caroseriei / Body type (e.g. SUV, Sedan)
        - in: query
          name: gearboxTypeName
          schema: { type: string }
          description: Tipul cutiei de viteze / Gearbox type (e.g. manual, automatic)
        - in: query
          name: drivetrainTypeName
          schema: { type: string }
          description: Tipul tracțiunii / Drivetrain (e.g. AWD, FWD)
        - in: query
          name: fuelTypeName
          schema: { type: string }
          description: Tipul combustibilului / Fuel type (e.g. diesel, petrol, electric)
        - in: query
          name: minYear
          schema: { type: integer, minimum: 1900 }
          description: Anul minim de fabricație / Minimum manufacturing year
        - in: query
          name: maxYear
          schema: { type: integer, minimum: 1900 }
          description: |
            Anul maxim de fabricație / Maximum manufacturing year
            **Trebuie să fie ≥ minYear / Must be ≥ minYear**
        - in: query
          name: minPrice
          schema: { type: integer, minimum: 0 }
          description: Prețul minim în euro / Minimum price in EUR
        - in: query
          name: maxPrice
          schema: { type: integer, minimum: 0 }
          description: |
            Prețul maxim în euro / Maximum price in EUR
            **Trebuie să fie ≥ minPrice / Must be ≥ minPrice**
        - in: query
          name: sortBy
          schema:
            type: string
            enum: [date, price, year, km]
            default: date
          description: Criteriul de sortare / Sort criterion
        - in: query
          name: sortDir
          schema:
            type: string
            enum: [asc, desc]
            default: desc
          description: Direcția de sortare / Sort direction
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Pagina de rezultate / Results page number
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: Numărul maxim de rezultate per pagină / Maximum results per page
      responses:
        '200':
          description: Ofertele auto filtrate / Filtered car offers
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    description: Numărul total de rezultate disponibile / Total available results
                  pageCount:
                    type: integer
                    description: Numărul total de pagini / Total number of pages
                  page:
                    type: integer
                    description: Numărul paginii curente / Current page number
                  limit:
                    type: integer
                    description: Numărul maxim de rezultate per pagină / Maximum results per page
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        sku:
                          type: string
                          description: ID-ul unic al ofertei / Unique offer ID
                        url:
                          type: string
                          format: uri
                          description: Link absolut către oferta / Absolute offer URL
                        title:
                          type: string
                          description: Titlul ofertei / Offer title
                        makeSlug:
                          type: string
                          description: Slug-ul mărcii pentru link / Make slug for deep linking
                        modelSlug:
                          type: string
                          description: Slug-ul modelului pentru link / Model slug for deep linking
                        makeName:
                          type: string
                          description: Marca / Car make
                        modelName:
                          type: string
                          description: Modelul / Car model
                        trim:
                          type: string
                          nullable: true
                          description: Varianta / Trim
                        year:
                          type: integer
                          description: Anul fabricației / Manufacturing year
                        bodyTypeName:
                          type: string
                          nullable: true
                          description: Tipul caroseriei / Body type
                        gearboxTypeName:
                          type: string
                          nullable: true
                          description: Tipul cutiei de viteze / Gearbox type
                        drivetrainTypeName:
                          type: string
                          nullable: true
                          description: Tipul tracțiunii / Drivetrain type
                        fuelTypeName:
                          type: string
                          nullable: true
                          description: Tipul combustibilului / Fuel type
                        engineDisplacement:
                          type: integer
                          nullable: true
                          description: Capacitatea motorului în cm³ / Engine displacement in cc
                        enginePower:
                          type: integer
                          nullable: true
                          description: Puterea motorului în CP / Engine power in HP
                        km:
                          type: integer
                          description: Kilometraj / Mileage in km
                        price:
                          type: integer
                          description: Prețul în EUR / Price in EUR
                        pictureUrl:
                          type: string
                          format: uri
                          description: URL-ul pozei principale a mașinii / URL to main car picture
                      required:
                        - sku
                        - url
                        - title
                        - makeSlug
                        - modelSlug
                        - makeName
                        - modelName
                        - year
                        - km
                        - price
                        - pictureUrl
              examples:
                example_ro:
                  summary: Căutare Dacia Duster sub 21.000€
                  value:
                    total: 124
                    limit: 20
                    pageCount: 7
                    page: 1
                    items:
                      - sku: 'DAC141561'
                        url: 'https://leasingsh.ro/dacia-duster-2025-10km-DAC141561'
                        title: 'Dacia Duster Eco-G 100 Journey din 2025 cu 10 km - oferta DAC141561'
                        makeSlug: 'dacia'
                        modelSlug: 'duster'
                        makeName: 'Dacia'
                        modelName: 'Duster'
                        trim: 'Eco-G 100 Journey'
                        year: 2025
                        bodyTypeName: 'SUV'
                        gearboxTypeName: 'Manuală'
                        drivetrainTypeName: 'Față'
                        fuelTypeName: 'Benzină + GPL'
                        engineDisplacement: 999
                        enginePower: 100
                        km: 10
                        price: 20950
                        pictureUrl: 'https://leasingsh.ro/api/pictures/products/019a34a4-7316-779b-bffd-5a095e5d1b1b-358x239.webp'
                example_en:
                  summary: Search for Volkswagen Golf under €20,000
                  value:
                    total: 98
                    limit: 20
                    pageCount: 5
                    page: 1
                    items:
                      - sku: 'VOL141606'
                        url: 'https://leasingsh.ro/volkswagen-golf-2021-120900km-VOL141606'
                        title: 'Volkswagen Golf 1.0 TSI Comfortline din 2021 cu 120.900 km - oferta VOL141606'
                        makeSlug: 'volkswagen'
                        modelSlug: 'golf'
                        makeName: 'Volkswagen'
                        modelName: 'Golf'
                        trim: null
                        year: 2021
                        bodyTypeName: null
                        gearboxTypeName: 'Manuală'
                        drivetrainTypeName: 'Față'
                        fuelTypeName: 'Benzină'
                        engineDisplacement: 999
                        enginePower: 110
                        km: 120900
                        price: 12789
                        pictureUrl: 'https://leasingsh.ro/api/pictures/products/019a34a4-aa46-7e01-b09f-38f291114084-358x239.webp'
      x-ai-examples:
        - role: user
          language: 'ro-RO'
          prompt: 'Caută BMW X4 fabricate după 2022, până în 50.000€.'
          action:
            method: GET
            url: https://leasingsh.ro/api/public/v1/list-offers?makeName=BMW&modelName=X4&minYear=2022&maxPrice=50000
        - role: user
          language: 'en-US'
          prompt: 'Find Toyota Corolla cars newer than 2024 under €30,000.'
          action:
            method: GET
            url: https://leasingsh.ro/api/public/v1/list-offers?makeName=Toyota&modelName=Corolla&minYear=2024&maxPrice=30000

  /api/public/v1/list-filters:
    get:
      operationId: listFilters
      summary: Listează filtre disponibile pentru oferte / List available filters for offers
      description: |
        Returnează filtrele disponibile pentru ofertele auto.
        - Dacă se furnizează `makeName`, output-ul nu include `makeNames` și conține doar `modelNames` pentru marca selectată.
        - Dacă nu se furnizează `makeName`, output-ul listează toate `makeNames` și nu include `modelNames`.
        Această rută este optimizată pentru consum rapid de către aplicații, integratori și asistenți AI.

        Returns available filters for car offers.
        - If `makeName` is provided, the output does not include `makeNames` and lists only `modelNames` for the selected make.
        - If `makeName` is not provided, the output lists all `makeNames` and does not include `modelNames`.
        This route is optimized for AI assistants and external integrations.
      parameters:
        - in: query
          name: makeName
          required: false
          schema: { type: string }
          description: |
            Marca selectată / Selected car make.
            Dacă este furnizată, `modelNames` va fi returnat. / If provided, `modelNames` will be returned for this make.
      responses:
        '200':
          description: Liste de filtre disponibile / Available filter lists
          content:
            application/json:
              schema:
                type: object
                properties:
                  makeNames:
                    type: array
                    items: { type: string }
                    description: Lista tuturor mărcilor disponibile / List of all available car makes
                  modelNames:
                    type: array
                    items: { type: string }
                    description: Lista modelelor disponibile pentru marca selectată / List of available models for the selected make
                  bodyTypes:
                    type: array
                    items: { type: string }
                    description: Tipurile de caroserie disponibile / Available body types
                  gearboxTypes:
                    type: array
                    items: { type: string }
                    description: Tipurile de cutii de viteze disponibile / Available gearbox types
                  drivetrainTypes:
                    type: array
                    items: { type: string }
                    description: Tipurile de tracțiune disponibile / Available drivetrain types
                  fuelTypes:
                    type: array
                    items: { type: string }
                    description: Tipurile de combustibil disponibile / Available fuel types
              examples:
                example_make_provided_ro:
                  summary: Filtre pentru marca Dacia
                  value:
                    modelNames: ['Duster', 'Spring', 'Logan']
                    bodyTypes: ['SUV', 'Hatchback', 'Sedan']
                    gearboxTypes: ['Manuală', 'Automată']
                    drivetrainTypes: ['Față', 'Integrală']
                    fuelTypes: ['Benzină', 'Benzină + GPL', 'Diesel', 'Electric']
                example_make_provided_en:
                  summary: Filters for the brand Dacia
                  value:
                    modelNames: ['Duster', 'Spring', 'Logan']
                    bodyTypes: ['SUV', 'Hatchback', 'Sedan']
                    gearboxTypes: ['Manuală', 'Automată']
                    drivetrainTypes: ['Față', 'Integrală']
                    fuelTypes: ['Benzină', 'Benzină + GPL', 'Diesel', 'Electric']
                example_no_make_ro:
                  summary: Filtre pentru toate mărcile disponibile
                  value:
                    makeNames: ['Dacia', 'BMW', 'Volkswagen']
                    bodyTypes: ['SUV', 'Hatchback', 'Sedan']
                    gearboxTypes: ['Manuală', 'Automată']
                    drivetrainTypes: ['Față', 'Integrală']
                    fuelTypes: ['Benzină', 'Benzină + GPL', 'Diesel', 'Electric']
                example_no_make_en:
                  summary: Filters for all available makes
                  value:
                    makeNames: ['Dacia', 'BMW', 'Volkswagen']
                    bodyTypes: ['SUV', 'Hatchback', 'Sedan']
                    gearboxTypes: ['Manuală', 'Automată']
                    drivetrainTypes: ['Față', 'Integrală']
                    fuelTypes: ['Benzină', 'Benzină + GPL', 'Diesel', 'Electric']
      x-ai-examples:
        - role: user
          language: 'ro-RO'
          prompt: 'Afișează filtrele disponibile pentru marca Dacia.'
          action:
            method: GET
            url: https://leasingsh.ro/api/public/v1/list-filters?makeName=Dacia
        - role: user
          language: 'ro-RO'
          prompt: 'Afișează filtrele pentru toate mărcile disponibile.'
          action:
            method: GET
            url: https://leasingsh.ro/api/public/v1/list-filters
        - role: user
          language: 'en-US'
          prompt: 'Show available filters for BMW.'
          action:
            method: GET
            url: https://leasingsh.ro/api/public/v1/list-filters?makeName=BMW
        - role: user
          language: 'en-US'
          prompt: 'Show filters for all available makes.'
          action:
            method: GET
            url: https://leasingsh.ro/api/public/v1/list-filters

  /api/public/v1/get-offer/{sku}:
    get:
      operationId: getOffer
      summary: Get full details for a specific offer by SKU
      description: |
        Returnează informații complete despre o ofertă de auto, inclusiv prețul, specificațiile tehnice, pozele și opțiunile de finanțare.
        Dacă oferta nu există, returnează o eroare **HTTP 404 Not Found**.

        Returns complete information about a vehicle offer, including pricing, technical specs, pictures and financing options.
        If the offer does not exist, returns a **HTTP 404 Not Found** error.

      parameters:
        - name: sku
          in: path
          required: true
          schema:
            type: string
          description: ID-ul unic al ofertei / Unique offer ID.
      responses:
        '200':
          description: Oferta a fost găsită și returnată / Offer successfully retrieved
          content:
            application/json:
              schema:
                type: object
                required:
                  - sku
                  - url
                  - title
                  - makeSlug
                  - makeName
                  - modelSlug
                  - modelName
                  - year
                  - km
                  - price
                  - pictures
                properties:
                  sku:
                    type: string
                    description: ID-ul unic al ofertei / Unique offer ID.
                  url:
                    type: string
                    format: uri
                    description: Link absolut către oferta / Fully qualified deep-link to the offer page.
                  title:
                    type: string
                    description: Titlul ofertei / Offer title
                  makeSlug:
                    type: string
                    description: Slug-ul mărcii pentru link / Make slug for deep linking
                  makeName:
                    type: string
                    description: Marca / Car make
                  modelSlug:
                    type: string
                    description: Slug-ul modelului pentru link / Model slug for deep linking
                  modelName:
                    type: string
                    description: Modelul / Car model
                  trim:
                    type: string
                    nullable: true
                    description: Varianta / Trim
                  year:
                    type: integer
                    description: Anul fabricației / Manufacturing year
                  km:
                    type: integer
                    description: Kilometrajul / Mileage in km
                  gearboxTypeName:
                    type: string
                    nullable: true
                    description: Tipul cutiei de viteze / Gearbox type
                  drivetrainTypeName:
                    type: string
                    nullable: true
                    description: Tipul tracțiunii / Drivetrain type
                  fuelTypeName:
                    type: string
                    nullable: true
                    description: Tipul combustibilului / Fuel type
                  engineDisplacement:
                    type: integer
                    nullable: true
                    description: Capacitatea cilindrică a motorului în cm³ / Engine displacement in cc
                  enginePower:
                    type: integer
                    nullable: true
                    description: Puterea motorului în CP / Engine power in HP
                  features:
                    type: array
                    description: Lista caracteristicilor mașinii / List of car features
                    items:
                      type: object
                      properties:
                        category:
                          type: string
                          description: Categoria caracteristicii / Feature category
                        items:
                          type: array
                          description: Lista elementelor caracteristicii / List of feature items
                          items:
                            type: string
                            description: Elementul caracteristicii / Feature item
                  price:
                    type: integer
                    description: Prețul / Price
                  priceTaxPercent:
                    type: integer
                    nullable: true
                    description: Procentul TVA-ului / Tax percent
                  priceTaxExcl:
                    type: integer
                    nullable: true
                    description: Prețul fără TVA / Price excluding tax
                  pictures:
                    type: array
                    description: Lista URL-urilor imaginilor / List of picture URLs
                    items:
                      type: string
                      format: uri
                      description: URL-ul imaginii / Picture URL
                  financingOptions:
                    type: array
                    description: |
                      Opțiuni de finanțare precalculate pentru oferta curentă.
                      Opțiunile includ numărul de ani, avansul procentual și rata lunată.

                      Precomputed leasing/financing payment examples.
                      Each option describes years, downpayment % and resulting monthly rate.
                    items:
                      type: object
                      properties:
                        years:
                          type: integer
                          description: Perioada de finanțare în ani / Financing duration in years
                        downpaymentPercentage:
                          type: integer
                          description: Avans procentual / Downpayment percentage
                        monthlyPayment:
                          type: integer
                          description: Rata lunată / Monthly payment

              examples:
                ro:
                  summary: Exemplu (RO)
                  value:
                    sku: 'AUD123555'
                    url: 'https://leasingsh.ro/audi-q7-2021-69990km-AUD123555'
                    title: 'Audi Q7 55 TFSI Quattro S Line din 2021 cu 69.990 km - oferta AUD123555'
                    makeSlug: 'audi'
                    makeName: 'Audi'
                    modelSlug: 'q7'
                    modelName: 'Q7'
                    trim: '55 TFSI Quattro S Line'
                    year: 2021
                    km: 69990
                    gearboxTypeName: 'Automată'
                    drivetrainTypeName: null
                    fuelTypeName: 'Benzină'
                    engineDisplacement: 2995
                    enginePower: 340
                    features:
                      - category: 'Dotări generale'
                        items:
                          - 'ABS'
                          - 'ESP'
                      - category: 'Interior'
                        items:
                          - 'Scaune cu încălzire'
                          - 'Sistem audio premium'
                    price: 60149
                    priceTaxPercent: 21
                    priceTaxExcl: 49710
                    pictures:
                      - 'https://leasingsh.ro/api/pictures/products/019a1254-4033-7791-ab04-a3218a0532bc-1920.webp'
                    financingOptions:
                      - { years: 3, downpaymentPercentage: 20, monthlyPayment: 1470 }

                en:
                  summary: Example (EN)
                  value:
                    sku: 'AUD123555'
                    url: 'https://leasingsh.ro/audi-q7-2021-69990km-AUD123555'
                    title: 'Audi Q7 55 TFSI Quattro S Line din 2021 cu 69.990 km - oferta AUD123555'
                    makeSlug: 'audi'
                    makeName: 'Audi'
                    modelSlug: 'q7'
                    modelName: 'Q7'
                    trim: '55 TFSI Quattro S Line'
                    year: 2021
                    km: 69990
                    gearboxTypeName: 'Automată'
                    drivetrainTypeName: null
                    fuelTypeName: 'Benzină'
                    engineDisplacement: 2995
                    enginePower: 340
                    features:
                      - category: 'Dotări generale'
                        items:
                          - 'ABS'
                          - 'ESP'
                      - category: 'Interior'
                        items:
                          - 'Scaune cu încălzire'
                          - 'Sistem audio premium'
                    price: 60149
                    priceTaxPercent: 21
                    priceTaxExcl: 49710
                    pictures:
                      - 'https://leasingsh.ro/api/pictures/products/019a1254-4033-7791-ab04-a3218a0532bc-1920.webp'
                    financingOptions:
                      - { years: 3, downpaymentPercentage: 20, monthlyPayment: 1470 }

        '404':
          description: Oferta nu a fost găsită / Offer not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: 'Offer not found'
