COR

COR Costs API

The Costs API from COR — 2 operation(s) for costs.

OpenAPI Specification

cor-costs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: COR Attachments Costs API
  description: The COR API lets you integrate with projectcor.com applications using simple HTTP methods, in either XML or JSON formats, making this an ideal API for developing integrations with other softwares, external clients or mobile applications
  version: 1.0.0
servers:
- url: https://api.projectcor.com/v1
  description: Production server
security:
- bearerAuth: []
tags:
- name: Costs
paths:
  /projects/{project_id}/project_cost:
    get:
      tags:
      - Costs
      summary: Get Project Costs
      description: Get a list of associated project costs
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: List of project costs
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectCost'
    post:
      tags:
      - Costs
      summary: Add Project Cost
      description: Create an associated project cost
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectCostInput'
      responses:
        '200':
          description: Project cost created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectCost'
  /projects/{project_id}/project_cost/{project_cost_id}:
    put:
      tags:
      - Costs
      summary: Update Project Cost
      description: Update an associated project cost
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: integer
      - name: project_cost_id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectCostInput'
      responses:
        '200':
          description: Project cost updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectCost'
    delete:
      tags:
      - Costs
      summary: Delete Project Cost
      description: Delete an associated project cost
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: integer
      - name: project_cost_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '204':
          description: Project cost deleted successfully
components:
  schemas:
    ProjectCost:
      type: object
      properties:
        id:
          type: integer
        title:
          type: string
        cost:
          type: number
          format: float
        datetime:
          type: string
          format: date
        label_id:
          type: integer
        project_estimate_id:
          type: integer
        id_project_history:
          type: integer
    ProjectCostInput:
      type: object
      required:
      - title
      - cost
      - datetime
      properties:
        title:
          type: string
          description: Title of cost
        cost:
          type: number
          format: float
          description: Cost
        datetime:
          type: string
          format: date
          description: Date of the estimate
        label_id:
          type: integer
          description: Related Label
        project_estimate_id:
          type: integer
          description: Related project estimate
        id_project_history:
          type: integer
          description: Related project history
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    basicAuth:
      type: http
      scheme: basic