> ## 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.

# Update Investment

> This endpoint updates an investment's balance by incrementing its value. It can be used for crediting an investment account.

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

Query Parameters: User UUID

Path Parameters: Investment ID

The response body is a JSON object that contains:

- 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 put /investment/{id}
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/{id}:
    put:
      tags:
        - Investments
      summary: Update Investment
      description: >-
        This endpoint updates an investment's balance by incrementing its value.
        It can be used for crediting an investment account.


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


        Query Parameters: User UUID


        Path Parameters: Investment ID


        The response body is a JSON object that contains:


        - 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}}'
        - name: id
          in: path
          schema:
            type: string
          required: true
          example: 662ff8a5712cd9fd793e1fb7
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                amount: 12000
                account: 662fbf9eac827e370c18d4b9
                date: 04/27/2024
      responses:
        '200':
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 19:59:18 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: 87c1df280a382028-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"c3-5SFPIoEZcmlj1kjCqdOCpQlqyWg"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: 58d3e66a-53bb-43e5
            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:
                investment:
                  desc: Bitcoin
                  currentAmount: 107000
                  category: Cryptocurrency
                  _id: 662ff8a5712cd9fd793e1fb7
                  createdAt: '2024-04-29T19:44:37.441Z'
                  updatedAt: '2024-04-29T19:59:18.070Z'
        '500':
          description: Internal Server Error
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 19:58:12 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: 87c1dd900f5e3922-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"36-RuiVu6xbE99ypi8Ue9/iHaOgAqw"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: 704a6fbb-75fa-41e1
            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 not updated.

````