openapi: 3.0.0
info:
  title: Phone Auth
  version: 1.0.0
servers:
  - url: http://{{backend_url}}
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
paths:
  /auth/{actorType}/phone-auth:
    post:
      tags:
        - default
      summary: Authenticate User
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                phone: '+19077890116'
      parameters:
        - name: actorType
          in: path
          schema:
            type: string
          required: true
          example: customer
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /auth/{actorType}/phone-auth/callback:
    post:
      tags:
        - default
      summary: Verify OTP
      requestBody:
        content: {}
      parameters:
        - name: phone
          in: query
          schema:
            type: string
          example: '%2B19077890116'
        - name: otp
          in: query
          schema:
            type: integer
          example: '476588'
        - name: actorType
          in: path
          schema:
            type: string
          required: true
          example: customer
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /store/customers:
    post:
      tags:
        - default
      summary: Create Customer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                email: +19077890116@gmail.com
                phone: '19077890116'
                first_name: John
                last_name: Smith
      security:
        - bearerAuth: []
      parameters:
        - name: x-publishable-api-key
          in: header
          schema:
            type: string
          example: '{{PUBLISHABLE_API_KEY}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /auth/{actorType}/phone-auth/register:
    post:
      tags:
        - default
      summary: Retrieve Registration Token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                phone: '+19077890116'
      parameters:
        - name: actorType
          in: path
          schema:
            type: string
          required: true
          example: customer
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
