openapi: 3.1.0
info:
  title: Live Local Garage Sales & Deals
  version: 0.1.0
servers:
  - url: https://api.swiperbuy.com
paths:
  /v1/marketplace/geofence:
    get:
      operationId: listGeofenceListings
      summary: List listings visible at a lat/lng given the collapsing radius
      parameters:
        - in: query
          name: lat
          schema: { type: number }
          required: true
        - in: query
          name: lng
          schema: { type: number }
          required: true
        - in: query
          name: passport
          schema: { type: boolean, default: false }
      responses:
        "200":
          description: Visible listings
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Listing"
  /v1/marketplace/lock:
    post:
      operationId: holdListing
      summary: Hold a listing with a refundable deposit plus the $2.50 platform fee
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [listing_id]
              properties:
                listing_id: { type: string }
                buyer_id: { type: string }
      responses:
        "200":
          description: Hold created
components:
  schemas:
    Listing:
      type: object
      properties:
        id: { type: string }
        title: { type: string }
        price_cents: { type: integer }
        earnest_deposit_cents: { type: integer }
        current_radius_meters: { type: integer }
        lat: { type: number }
        lng: { type: number }
        status: { type: string }
