openapi: 3.0.0
info:
  title: Invoice Generator
  version: 1.0.0
servers:
  - url: http://{{backend_url}}
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
tags:
  - name: Admin
  - name: Admin > Auth
  - name: Store
paths:
  /auth/user/emailpass:
    post:
      tags:
        - Admin > Auth
      summary: Login
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                email: admin@medusajs.com
                password: supersecret
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /admin/invoice-config:
    get:
      tags:
        - Admin
      summary: Get Invoice Config
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
    post:
      tags:
        - Admin
      summary: Update Invoice Config
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                company_name: Acme
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /admin/orders/{id}/invoices:
    get:
      tags:
        - Admin
      summary: Download Invoice PDF
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /store/orders/{id}/invoices:
    get:
      tags:
        - Store
      summary: Download Invoice PDF
      parameters:
        - name: x-publishable-api-key
          in: header
          schema:
            type: string
          example: '{{PUBLISHABLE_API_KEY}}'
        - name: id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
