Outdoorsy Bundles API

The bundles API from Outdoorsy — 3 operation(s) for bundles.

OpenAPI Specification

outdoorsy-bundles-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'The Outdoorsy API (or simply "API") is organized around REST. It uses

    predictable, resource-oriented URLs and implements standard HTTP response

    codes, verbs, authentication mechanisms, and a variety of request encodings.


    ## Versioning


    The API implements semantic versioning.'
  title: Outdoorsy API Documentation Bundles API
  version: 0.0.1
servers:
- url: /v0
security:
- Bearer:
  - '[]'
- API-Key:
  - '[]'
tags:
- name: bundles
paths:
  /bundles:
    get:
      description: List insurance bundles
      tags:
      - bundles
      operationId: listBundles
      responses:
        '200':
          $ref: '#/components/responses/bundlesResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
    post:
      description: Create a bundle
      tags:
      - bundles
      operationId: createBundle
      responses:
        '201':
          $ref: '#/components/responses/bundleResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFoundError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Bundle'
  /bundles/{id}:
    get:
      description: Retrieve bundle by id
      tags:
      - bundles
      operationId: getBundleById
      parameters:
      - x-go-name: ID
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/bundleResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFoundError'
    delete:
      description: Delete insurance bundle
      tags:
      - bundles
      operationId: deleteBundle
      parameters:
      - x-go-name: ID
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '204':
          $ref: '#/components/responses/noContentResponse'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFoundError'
    patch:
      description: Update insurance bundle
      tags:
      - bundles
      operationId: updateBundle
      parameters:
      - x-go-name: ID
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/bundleResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFoundError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Bundle'
  /users/{user_id}/bundles:
    get:
      description: List insurance bundles available to renter of the user (owner) who calls this endpoint
      tags:
      - bundles
      operationId: listBundlesAvailableForUser
      parameters:
      - x-go-name: UserID
        name: user_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      - x-go-name: RenterID
        name: renter_id
        in: query
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/bundlesResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
    post:
      description: Creates a bundle rule with the specified bundle and the specified uptake percents for the user (owner) who calls this endpoint
      tags:
      - bundles
      operationId: setBundleUptake
      responses:
        '204':
          $ref: '#/components/responses/noContentResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFoundError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetPercentUptake'
    delete:
      description: Deletes a bundle rule with the specified bundle for the user (owner) who calls this endpoint
      tags:
      - bundles
      operationId: deleteBundleUptake
      responses:
        '204':
          $ref: '#/components/responses/noContentResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFoundError'
components:
  schemas:
    BundleRule:
      type: object
      properties:
        bundle_id:
          type: string
          x-go-name: BundleID
        created:
          type: string
          x-go-name: Created
          x-go-type: github.com/outdoorsy/api/clocks.RfcTime
        id:
          type: string
          x-go-name: ID
        owner_id:
          type: integer
          format: int64
          x-go-name: OwnerID
        rental_id:
          type: integer
          format: int64
          x-go-name: RentalID
        rule:
          $ref: '#/components/schemas/MSI'
        type:
          type: string
          x-go-name: Type
        updated:
          type: string
          x-go-name: Updated
          x-go-type: github.com/outdoorsy/api/clocks.RfcTime
      x-go-package: github.com/outdoorsy/api/internal/bundle
    BundleFeatures:
      type: array
      items:
        $ref: '#/components/schemas/BundleFeature'
      x-go-package: github.com/outdoorsy/api/internal/bundle
    MSI:
      type: object
      additionalProperties: {}
      x-go-package: github.com/outdoorsy/api/internal/platform/db
    BundleFeature:
      type: object
      properties:
        bundle_id:
          type: string
          x-go-name: BundleID
        category:
          type: string
          x-go-name: Category
        created:
          type: string
          x-go-name: Created
          x-go-type: github.com/outdoorsy/api/clocks.RfcTime
        details:
          type: string
          x-go-name: Details
        id:
          type: string
          x-go-name: ID
        name:
          type: string
          x-go-name: Name
        position:
          type: integer
          format: int64
          x-go-name: Position
        regions:
          $ref: '#/components/schemas/DBStringSlice'
        service_id:
          type:
          - integer
          - 'null'
          format: int64
        type:
          type: string
          x-go-name: Type
        updated:
          type: string
          x-go-name: Updated
          x-go-type: github.com/outdoorsy/api/clocks.RfcTime
      x-go-package: github.com/outdoorsy/api/internal/bundle
    SetPercentUptake:
      type: object
      properties:
        bundle_id:
          type: string
          x-go-name: BundleID
        percent_uptake_drivable:
          type: number
          format: double
          x-go-name: PercentDrivable
        percent_uptake_towable:
          type: number
          format: double
          x-go-name: PercentTowable
        rental_id:
          type: integer
          format: int64
          x-go-name: RentalID
      x-go-package: github.com/outdoorsy/api/internal/bundle
    DBStringSlice:
      description: DBStringSlice is a []string with database conversion methods
      type: array
      items:
        type: string
      x-go-package: github.com/outdoorsy/api/utils
    Bundle:
      type: object
      properties:
        active:
          type: boolean
          x-go-name: Active
        country:
          type: string
          x-go-name: Country
        created:
          type: string
          x-go-name: Created
          x-go-type: github.com/outdoorsy/api/clocks.RfcTime
        dealer_owned_renter:
          type: boolean
          x-go-name: DealerOwnedRenter
        delivery:
          type: boolean
          x-go-name: Delivery
        description:
          type: string
          x-go-name: Description
        estimated_miles_per_day:
          type: integer
          format: int64
          x-go-name: EstimatedMilesPerDay
        features:
          $ref: '#/components/schemas/BundleFeatures'
        id:
          type: string
          x-go-name: ID
        internal_description:
          type: string
          x-go-name: InternalDescription
        line_item_name:
          type: string
          x-go-name: LineItemName
        name:
          type: string
          x-go-name: Name
        owner_id:
          type: integer
          format: int64
          x-go-name: OwnerID
        per_mile_price:
          type: integer
          format: int64
          x-go-name: PerMilePrice
        per_mile_price_fsd:
          type: integer
          format: int64
          x-go-name: PerMilePriceFSD
        percent_uptake_drivable:
          type: number
          format: double
          x-go-name: PercentUptakeDrivable
        percent_uptake_towable:
          type: number
          format: double
          x-go-name: PercentUptakeTowable
        qualifies_per_mile_pricing:
          type: boolean
          x-go-name: QualifiesPerMilePricing
        rental_category:
          type: string
          x-go-name: RentalCategory
        rental_id:
          type: integer
          format: int64
          x-go-name: RentalID
        rules:
          type: array
          items:
            $ref: '#/components/schemas/BundleRule'
          x-go-name: Rules
        tax_rate_ids:
          type: array
          items:
            type: integer
            format: int64
          x-go-name: TaxRateIDs
        tier:
          type: integer
          format: int64
          x-go-name: Tier
        updated:
          type: string
          x-go-name: Updated
          x-go-type: github.com/outdoorsy/api/clocks.RfcTime
        use_day_pricing:
          type: boolean
          x-go-name: UseDayPricing
        use_per_mile_pricing:
          type: boolean
          x-go-name: UsePerMilePricing
      x-go-package: github.com/outdoorsy/api/internal/bundle
  responses:
    notFoundError:
      description: Not found error
    bundleResponse:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Bundle'
    bundlesResponse:
      description: ''
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/Bundle'
    badRequestError:
      description: Invalid input or state means you're bad
      headers:
        Error:
          schema:
            type: string
    noContentResponse:
      description: Everything went as planned
    unauthorizedError:
      description: Unauthorized error
  securitySchemes:
    API-Key:
      type: apiKey
      name: API-Key
      in: header
    Bearer:
      type: apiKey
      name: Authorization
      in: header