> ## Documentation Index
> Fetch the complete documentation index at: https://mitchsorg.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an Investment

> This endpoint is used to create an investment.

Endpoint: https://cashboard-f5x2.onrender.com/investment/add

Query Parameter: User UUID

The request body contains:

- desc (string) - A description of the investment account
- category (string) - Category for the investment
- currentAmount (number) - the investment's balance
    

The response body is a JSON object that contains an array of all investments. An individual investment includes:

- desc (string) - A description of the investment account
    
- category (string) - Category for the investment
    
- currentAmount (number) - the investment's balance
    
- _id (string) - the unique identifier for the investment
    
- createdAt (timestamp) - whenthe investment was created
    
- updatedAt (timestamp) - when the investment was last updated



## OpenAPI

````yaml post /investment/add
openapi: 3.0.0
info:
  title: Cashboard API
  description: >-
    Cashboard is a personal finance tool that helps users keep track of their
    income, expenses, savings and investments.


    API URL: `https://cashboard-f5x2.onrender.com`


    The Cashboard API has endpoints for:


    - Users

    - Accounts

    - Income

    - Expenses

    - Savings

    - Investments
  version: 1.0.0
servers:
  - url: https://cashboard-f5x2.onrender.com
security: []
tags:
  - name: User
    description: |-
      Cashboard uses the users endpoint to:

      - create a new user
      - get a user details
      - update user details
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/user`
  - name: Account
    description: |-
      These endpoints are used to:

      - create account
      - get all user's accounts
      - get account
      - update accounts
      - delete accounts.
          

      The endpoint URL is: `https://cashboard-f5x2.onrender.com/account`
  - name: Income
    description: |-
      These endpoints are used to:

      - create an income source
      - get all income source
      - get an income source
      - update income source
      - delete income source
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/income`
  - name: Expenses
    description: |-
      These endpoints are used to:

      - create an expense
      - get all expenses
      - get an expense
      - update an expense
      - delete an expense
          

      The endpoint URL is: `https://cashboard-f5x2.onrender.com/expenses`
  - name: Savings
    description: |-
      These endpoints are used to:

      - create a saving
      - get all savings
      - get a saving
      - update a saving
      - delete a saving
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/savings`
  - name: Investments
    description: |-
      These endpoints are used to:

      - create an investment
          
      - get all investments
          
      - get an investment
          
      - update an investment
          
      - delete an investment
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/investments`
paths:
  /investment/add:
    post:
      tags:
        - Investments
      summary: Create an Investment
      description: >-
        This endpoint is used to create an investment.


        Endpoint: https://cashboard-f5x2.onrender.com/investment/add


        Query Parameter: User UUID


        The request body contains:


        - desc (string) - A description of the investment account

        - category (string) - Category for the investment

        - currentAmount (number) - the investment's balance
            

        The response body is a JSON object that contains an array of all
        investments. An individual investment includes:


        - desc (string) - A description of the investment account
            
        - category (string) - Category for the investment
            
        - currentAmount (number) - the investment's balance
            
        - _id (string) - the unique identifier for the investment
            
        - createdAt (timestamp) - whenthe investment was created
            
        - updatedAt (timestamp) - when the investment was last updated
      parameters:
        - name: user
          in: query
          schema:
            type: string
          example: '{{uuid}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                desc: Bitcoin
                category: Cryptocurrency
                account: 662fbf9eac827e370c18d4b9
                date: 03/21/2024
                amount: 5000
      responses:
        '200':
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 19:53:29 GMT
            Content-Type:
              schema:
                type: string
                example: application/json; charset=utf-8
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Connection:
              schema:
                type: string
                example: keep-alive
            CF-Ray:
              schema:
                type: string
                example: 87c1d6a09bd79c16-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"22b-bC4UAFQ+wh2+YnfuCqrsPisQuIk"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: bc3e66e0-f1c0-4e98
            x-powered-by:
              schema:
                type: string
                example: Express
            x-render-origin-server:
              schema:
                type: string
                example: Render
            Server:
              schema:
                type: string
                example: cloudflare
            Content-Encoding:
              schema:
                type: string
                example: br
            alt-svc:
              schema:
                type: string
                example: h3=":443"; ma=86400
          content:
            application/json:
              schema:
                type: object
              example:
                investments:
                  - desc: Bitcoin
                    currentAmount: 95000
                    category: Cryptocurrency
                    _id: 662ff8a5712cd9fd793e1fb7
                    createdAt: '2024-04-29T19:44:37.441Z'
                    updatedAt: '2024-04-29T19:44:37.441Z'
                  - desc: Bitcoin
                    currentAmount: 5000
                    category: Cryptocurrency
                    _id: 662ff9e36e0d87944a3c4cf7
                    createdAt: '2024-04-29T19:49:55.065Z'
                    updatedAt: '2024-04-29T19:49:55.065Z'
                  - desc: Bitcoin
                    currentAmount: 5000
                    category: Cryptocurrency
                    _id: 662ffab8df4fbf42a526c6d5
                    createdAt: '2024-04-29T19:53:28.755Z'
                    updatedAt: '2024-04-29T19:53:28.755Z'
        '500':
          description: Internal Server Error
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 19:42:11 GMT
            Content-Type:
              schema:
                type: string
                example: application/json; charset=utf-8
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Connection:
              schema:
                type: string
                example: keep-alive
            CF-Ray:
              schema:
                type: string
                example: 87c1c6161b6f0821-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"3d-ho10A4fYqnx8/QwCzEmfNIRFXpc"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: 14587ba1-6083-4e8f
            x-powered-by:
              schema:
                type: string
                example: Express
            x-render-origin-server:
              schema:
                type: string
                example: Render
            Server:
              schema:
                type: string
                example: cloudflare
            alt-svc:
              schema:
                type: string
                example: h3=":443"; ma=86400
          content:
            application/json:
              schema:
                type: object
              example:
                status: error
                message: Investment could not be added!

````