openapi: 3.1.0
info:
  title: EV Charger Valet & Supercharger Pitstop
  version: 0.1.0
  description: Create Pitstop servicing jobs on the SwiperBuy core API.
servers:
  - url: https://api.swiperbuy.com
paths:
  /v1/servicing/jobs:
    post:
      operationId: createServicingJob
      summary: Dispatch a plug-in, unplug, sensor wipe, cabin reset, or valet bailout job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PitstopJobCreate"
      responses:
        "200":
          description: Job accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PitstopJobOut"
components:
  schemas:
    PitstopJobCreate:
      type: object
      required: [vin, stall_id, lat, lng, requested_services]
      properties:
        vin: { type: string }
        stall_id: { type: string }
        lat: { type: number }
        lng: { type: number }
        requested_services:
          type: array
          items:
            type: string
            enum: [PLUG_IN, UNPLUG, SENSOR_WIPE, CABIN_RESET, VALET_BAILOUT]
        target_soc_percent: { type: integer, default: 80 }
        callback_url: { type: string, format: uri }
        external_fleet_id: { type: string }
    PitstopJobOut:
      type: object
      properties:
        job_id: { type: string }
        status: { type: string }
        requested_services:
          type: array
          items: { type: string }
        todo: { type: string }
