openapi: 3.0.1
info:
  title: Parts
  contact: {}
  version: 1.0.0
servers:
  - url: https://api.autopass.pro
    description: Live server
    x-environment: live
  - url: https://api-prelive.autopass.pro
    description: Prelive server
    x-environment: prelive
paths:
  /cars-manufacturers:
    get:
      tags:
        - parts
      summary: List car manufacturers
      description: List car manufacturers.
      operationId: list-car-manufacturers
      parameters:
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CarManufacturerCollection"
        "400":
          description: Invalid parameters
          content: {}
  /cars-manufacturers/{car_manufacturer_id}:
    get:
      tags:
        - parts
      summary: Get a car manufacturer
      description: Get a car manufacturer by its ID.
      operationId: get-car-manufacturer
      parameters:
        - name: car_manufacturer_id
          in: path
          description: Car manufacturer ID
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CarManufacturerObject"
        "400":
          description: Invalid ID parameter
          content: {}
        "404":
          description: No car manufacturer found with the provided ID
          content: {}
  /cars-manufacturers/{car_manufacturer_id}/parts:
    get:
      tags:
        - parts
      summary: List the parts of a car manufacturer
      description: List the parts of a car manufacturer.
      operationId: list-parts-for-car-manufacturer
      parameters:
        - name: car_manufacturer_id
          in: path
          description: Car manufacturer ID
          required: true
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartOECollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-am:
    get:
      tags:
        - parts
      summary: List parts AM
      description: |
        This endpoint allows to list parts AM.

        It provides various paramters to help filter results.

        [A super link](https://autopassgroup.com)
      operationId: list-parts-am
      parameters:
        - name: code
          in: query
          description: Reference code
          schema:
            type: string
        - name: ean
          in: query
          description: EAN
          schema:
            type: string
        - name: part_manufacturer_id
          in: query
          description: Part manufacturer ID
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartAMCollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-am/{part_am_id}:
    get:
      tags:
        - parts
      summary: Get a part AM
      description: Get a part AM by its ID.
      operationId: get-part-am
      parameters:
        - name: part_am_id
          in: path
          description: Part AM ID
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartAMObject"
        "400":
          description: Invalid ID parameter
          content: {}
        "404":
          description: No part AM found with the provided ID
          content: {}
  /parts-am/{part_am_id}/parts-oe-crosses:
    get:
      tags:
        - parts
      summary: List OE crosses for a part AM
      description: List OE crosses for a part AM.
      operationId: list-oe-crosses-for-part-am
      parameters:
        - name: part_am_id
          in: path
          description: PartAM ID
          required: true
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrossOECollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-am/{part_am_id}/technical-information:
    get:
      tags:
        - parts
      summary: List technical information for a part AM
      description: List technical information for a part AM.
      operationId: list-technical-information-for-part-am
      parameters:
        - name: part_am_id
          in: path
          description: Part AM ID
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PartAMTechnicalInformation"
        "400":
          description: Invalid ID parameter
          content: {}
  /parts-am/{part_am_id}/vehicles:
    get:
      tags:
        - parts
      summary: List vehicle models for a part AM
      description: List vehicle models for a part AM.
      operationId: list-vehicles-for-part-am
      parameters:
        - name: part_am_id
          in: path
          description: Part AM ID
          required: true
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VehicleCollection"
        "400":
          description: Invalid ID parameter
          content: {}
  /parts-am/search:
    get:
      tags:
        - parts
      summary: Search for parts AM
      description: Search for parts AM.
      operationId: search-parts-am
      parameters:
        - name: code
          in: query
          description: Reference code
          schema:
            type: string
        - name: ean
          in: query
          description: EAN
          schema:
            type: string
        - name: part_manufacturer_id
          in: query
          description: Part manufacturer ID
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartAMCollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-manufacturers:
    get:
      tags:
        - parts
      summary: List part manufacturers
      description: List part manufacturers.
      operationId: list-part-manufacturers
      parameters:
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartManufacturerCollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-manufacturers/{part_manufacturer_id}:
    get:
      tags:
        - parts
      summary: Get a part manufacturer
      description: Get a part manufacturer by its ID.
      operationId: get-part-manufacturer
      parameters:
        - name: part_manufacturer_id
          in: path
          description: Part manufacturer ID
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartManufacturerObject"
        "400":
          description: Invalid ID parameter
          content: {}
        "404":
          description: No part manufacturer found with the provided ID
          content: {}
  /parts-manufacturers/{part_manufacturer_id}/parts:
    get:
      tags:
        - parts
      summary: List the parts of a part manufacturer
      description: List the parts of a part manufacturer.
      operationId: list-parts-for-part-manufacturer
      parameters:
        - name: part_manufacturer_id
          in: path
          description: Part manufacturer ID
          required: true
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartAMCollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-oe:
    get:
      tags:
        - parts
      summary: List parts OE
      description: List parts OE.
      operationId: list-parts-oe
      parameters:
        - name: code
          in: query
          description: Reference code
          schema:
            type: string
        - name: car_manufacturer_id
          in: query
          description: Car manufacturer ID
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartOECollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-oe/{part_oe_id}:
    get:
      tags:
        - parts
      summary: Get a part OE
      description: Get a part OE by its ID.
      operationId: get-part-oe
      parameters:
        - name: part_oe_id
          in: path
          description: Part OE ID
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartOEObject"
        "400":
          description: Invalid ID parameter
          content: {}
        "404":
          description: No part OE found with the provided ID
          content: {}
  /parts-oe/{part_oe_id}/parts-am-crosses:
    get:
      tags:
        - parts
      summary: List AM crosses for a part OE
      description: List AM crosses for a part OE.
      operationId: list-am-crosses-for-part-am
      parameters:
        - name: part_oe_id
          in: path
          description: Part OE ID
          required: true
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CrossAMCollection"
        "400":
          description: Invalid parameters
          content: {}
  /parts-oe/search:
    get:
      tags:
        - parts
      summary: Search for parts OE
      description: Search for parts OE.
      operationId: search-parts-oe
      parameters:
        - name: code
          in: query
          description: Reference code
          schema:
            type: string
        - name: car_manufacturer_id
          in: query
          description: Car manufacturer ID
          schema:
            type: integer
        - name: limit
          in: query
          description: Results limit
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          description: Results offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PartOECollection"
        "400":
          description: Invalid parameters
          content: {}
components:
  schemas:
    PartAMTechnicalInformation:
      type: object
      properties:
        label:
          type: string
        value:
          type: string
    CarManufacturerCollection:
      type: object
      properties:
        cars_manufacturers:
          type: array
          items:
            $ref: "#/components/schemas/CarManufacturerObject"
        meta:
          $ref: "#/components/schemas/Meta"
    CarManufacturerLinks:
      type: object
      properties:
        parts:
          type: string
          example: https://api.autopass.pro/cars-manufacturers/2/parts
        self:
          type: string
          example: https://api.autopass.pro/cars-manufacturers/2
    CarManufacturerObject:
      type: object
      properties:
        car_manufacturer_id:
          type: integer
          example: 2
        links:
          $ref: "#/components/schemas/CarManufacturerLinks"
        name:
          type: string
          example: B.M.W.
    CrossAMCollection:
      type: object
      properties:
        crosses:
          type: array
          items:
            $ref: "#/components/schemas/CrossAMObject"
        meta:
          $ref: "#/components/schemas/Meta"
    CrossAMObject:
      type: object
      properties:
        part_am:
          $ref: "#/components/schemas/PartAMPreviewObject"
        provider:
          $ref: "#/components/schemas/ProviderObject"
        status:
          type: string
          example: A
          enum:
            - A
            - S
            - U
        tecdoc_valid:
          type: boolean
          example: true
    CrossOECollection:
      type: object
      properties:
        crosses:
          type: array
          items:
            $ref: "#/components/schemas/CrossOEObject"
        meta:
          $ref: "#/components/schemas/Meta"
    CrossOEObject:
      type: object
      properties:
        part_oe:
          $ref: "#/components/schemas/PartOEPreviewObject"
        provider:
          $ref: "#/components/schemas/ProviderObject"
        status:
          type: string
          example: A
          enum:
            - A
            - S
            - U
        tecdoc_valid:
          type: boolean
          example: true
    GenartObject:
      type: object
      properties:
        description:
          type: string
          example: Auxiliary Water Pump (cooling water circuit)
        genartnr:
          type: integer
          example: 1351
    Meta:
      type: object
      properties:
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
    PartAMCollection:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        parts_am:
          type: array
          items:
            $ref: "#/components/schemas/PartAMPreviewObject"
    PartAMLinks:
      type: object
      properties:
        oe_crosses:
          type: string
          example: https://api.autopass.pro/parts-am/14050109/parts-oe-crosses
        parts_manufacturer:
          type: string
          example: https://api.autopass.pro/parts-manufacturers/303
        self:
          type: string
          example: https://api.autopass.pro/parts-am/14050109
        technical_information:
          type: string
          example: https://api.autopass.pro/parts-am/14050109/technical-information
        vehicles:
          type: string
          example: https://api.autopass.pro/parts-am/14050109/vehicles
    PartAMMediaObject:
      type: object
      properties:
        href:
          type: string
          example: https://api.autopass.pro/medias/tecdoc/00005/7.06033.62.0z_det1.JPG
        order:
          type: integer
          example: 1
    PartAMObject:
      type: object
      properties:
        aliases:
          type: array
          items:
            type: string
        code:
          type: string
          example: "706031150"
        code_raw:
          type: string
          example: 7.06031.15.0
        countries:
          type: array
          items:
            type: string
        description:
          type: string
          example: ""
        ean:
          type: string
          example: "6955813018152"
        genarts:
          type: array
          items:
            $ref: "#/components/schemas/GenartObject"
        kit:
          type: boolean
          example: false
        label:
          type: string
          example: PIERBURG 7.06031.15.0
        links:
          $ref: "#/components/schemas/PartAMLinks"
        medias:
          type: array
          items:
            $ref: "#/components/schemas/PartAMMediaObject"
        part_am_id:
          type: integer
          example: 15002947
        part_manufacturer:
          $ref: "#/components/schemas/PartManufacturerObject"
        provider:
          $ref: "#/components/schemas/ProviderObject"
        status:
          type: string
          example: A
    PartAMPreviewObject:
      type: object
      properties:
        code:
          type: string
          example: "706031150"
        code_raw:
          type: string
          example: 7.06031.15.0
        description:
          type: string
          example: ""
        ean:
          type: string
          example: "6955813018152"
        kit:
          type: boolean
          example: false
        label:
          type: string
          example: PIERBURG 7.06031.15.0
        links:
          $ref: "#/components/schemas/PartAMLinks"
        part_am_id:
          type: integer
          example: 15002947
        status:
          type: string
          example: A
    PartManufacturerCollection:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        parts_manufacturers:
          type: array
          items:
            $ref: "#/components/schemas/PartManufacturerObject"
    PartManufacturerLinks:
      type: object
      properties:
        parts:
          type: string
          example: https://api.autopass.pro/parts-manufacturers/67/parts
        self:
          type: string
          example: https://api.autopass.pro/parts-manufacturers/67
    PartManufacturerObject:
      type: object
      properties:
        links:
          $ref: "#/components/schemas/PartManufacturerLinks"
        name:
          type: string
          example: PIERBURG
        part_manufacturer_id:
          type: integer
          example: 303
    PartOECollection:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        parts_oe:
          type: array
          items:
            $ref: "#/components/schemas/PartOEPreviewObject"
    PartOELinks:
      type: object
      properties:
        am_crosses:
          type: string
          example: https://api.autopass.pro/parts-oe/58005960/parts-am-crosses
        car_manufacturer:
          type: string
          example: https://api.autopass.pro/cars-manufacturers/44
        self:
          type: string
          example: https://api.autopass.pro/parts-oe/58005960
    PartOEObject:
      type: object
      properties:
        car_manufacturer:
          $ref: "#/components/schemas/CarManufacturerObject"
        code:
          type: string
          example: 1109AY
        code_raw:
          type: string
          example: 1109 AY
        description:
          type: string
          example: FILTRE A HUILE
        genarts:
          type: array
          items:
            $ref: "#/components/schemas/GenartObject"
        label:
          type: string
          example: RENAULT 1109 AY
        links:
          $ref: "#/components/schemas/PartOELinks"
        part_oe_id:
          type: integer
          example: 58005960
        provider:
          $ref: "#/components/schemas/ProviderObject"
    PartOEPreviewObject:
      type: object
      properties:
        car_manufacturer:
          $ref: "#/components/schemas/CarManufacturerObject"
        code:
          type: string
          example: 1109AY
        code_raw:
          type: string
          example: 1109 AY
        description:
          type: string
          example: FILTRE A HUILE
        label:
          type: string
          example: RENAULT 1109 AY
        links:
          $ref: "#/components/schemas/PartOELinks"
        part_oe_id:
          type: integer
          example: 58005960
        provider:
          $ref: "#/components/schemas/ProviderObject"
    ProviderObject:
      type: object
      properties:
        description:
          type: string
          example: TECDOC
        name:
          type: string
          example: TE
        provider_id:
          type: integer
          example: 1
    VehicleCollection:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        vehicles:
          type: array
          items:
            $ref: "#/components/schemas/VehicleObject"
    VehicleObject:
      type: object
      properties:
        date_model_from:
          type: string
          example: 2015-08-01T00:00:00Z
        date_model_to:
          type: string
          nullable: true
          example: "null"
        date_version_from:
          type: string
          example: 2017-10-01T00:00:00Z
        date_version_to:
          type: string
          nullable: true
          example: "null"
        engine_code:
          type: string
          example: DECA
        ktypnr:
          type: integer
          example: 128816
        manufacturer:
          type: string
          example: AUDI
        model:
          type: string
          example: "A4 B9 Avant (8W5, 8WD)"
        start_and_stop:
          type: string
          example: "Y"
          enum:
            - "Y"
            - "N"
            - "?"
        version:
          type: string
          example: RS4 quattro
