Phasio Manufacturer Expense Controller API

API for managing order expenses

OpenAPI Specification

phasio-manufacturer-expense-controller-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Phasio Activity Internal Manufacturer Expense Controller API
  description: This is the API documentation for the Phasio application.
  version: '1.0'
servers:
- url: https://m-api.eu.phas.io
  description: Generated server url
security:
- Phasio API Bearer Token: []
tags:
- name: Manufacturer Expense Controller
  description: API for managing order expenses
paths:
  /api/manufacturer/v1/expense:
    post:
      tags:
      - Manufacturer Expense Controller
      summary: Create a new expense for an order
      operationId: create_13
      parameters:
      - name: orderId
        in: query
        description: ID of the order to associate the expense with
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/CreateFixedExpenseDto'
              - $ref: '#/components/schemas/CreateHourlyExpenseDto'
        required: true
      responses:
        '200':
          description: Expense created successfully
          content:
            application/json:
              schema:
                type: integer
                format: int64
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - missing operator context
  /api/manufacturer/v1/expense/{expenseId}:
    get:
      tags:
      - Manufacturer Expense Controller
      summary: Get an expense by ID
      operationId: get_23
      parameters:
      - name: expenseId
        in: path
        description: ID of the expense to retrieve
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      responses:
        '200':
          description: Expense retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseDto'
        '401':
          description: Unauthorized - missing operator context
        '404':
          description: Expense not found
    delete:
      tags:
      - Manufacturer Expense Controller
      summary: Delete an expense
      operationId: delete_13
      parameters:
      - name: expenseId
        in: path
        description: ID of the expense to delete
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      responses:
        '204':
          description: Expense deleted successfully
        '400':
          description: Invalid expense ID or expense cannot be deleted
        '401':
          description: Unauthorized - missing operator context
  /api/manufacturer/v1/expense/order/{orderId}:
    get:
      tags:
      - Manufacturer Expense Controller
      summary: Get all expenses for an order
      operationId: getByOrder_2
      parameters:
      - name: orderId
        in: path
        description: ID of the order to get expenses for
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      responses:
        '200':
          description: Expenses retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseDto'
        '401':
          description: Unauthorized - missing operator context
components:
  schemas:
    ExpenseDto:
      type: object
      properties:
        expenseId:
          type: integer
          format: int64
        name:
          type: string
        description:
          type: string
        type:
          type: string
      required:
      - expenseId
      - name
      - type
    CreateExpenseDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        type:
          type: string
      required:
      - name
      - type
    CreateFixedExpenseDto:
      allOf:
      - $ref: '#/components/schemas/CreateExpenseDto'
      - type: object
        properties:
          quantity:
            type: number
          unitPrice:
            type: number
          costForOperator:
            type: number
      required:
      - costForOperator
      - name
      - quantity
      - type
      - unitPrice
    CreateHourlyExpenseDto:
      allOf:
      - $ref: '#/components/schemas/CreateExpenseDto'
      - type: object
        properties:
          hours:
            type: number
          rate:
            type: number
      required:
      - hours
      - name
      - rate
      - type
  securitySchemes:
    Phasio API Bearer Token:
      type: http
      name: Authorization
      in: header
      scheme: bearer
      bearerFormat: JWT