> ## 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 a Saving

> This endpoint creates a new saving for the specified user.

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

Query Parameter: User UUID

The request body includes:

- desc (string) - A description of the saving goal
- goalAmount (number) - The goal
- currency (string) - The user's preference
- currentAmount (number) - the current amount saved
    

** The currency and currentAmount are not required.

The response is JSON object that contains all the user's savings. An individual saving contains:

- desc (string) - A description of the saving goal
    
- goalAmount (number) - The goal
    
- currency (string) - The user's preference
    
- currentAmount (number) - the current amount saved
    
- _id - the unique identifier of the saving



## OpenAPI

````yaml post /savings/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:
  /savings/add:
    post:
      tags:
        - Savings
      summary: Create a Saving
      description: >-
        This endpoint creates a new saving for the specified user.


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


        Query Parameter: User UUID


        The request body includes:


        - desc (string) - A description of the saving goal

        - goalAmount (number) - The goal

        - currency (string) - The user's preference

        - currentAmount (number) - the current amount saved
            

        ** The currency and currentAmount are not required.


        The response is JSON object that contains all the user's savings. An
        individual saving contains:


        - desc (string) - A description of the saving goal
            
        - goalAmount (number) - The goal
            
        - currency (string) - The user's preference
            
        - currentAmount (number) - the current amount saved
            
        - _id - the unique identifier of the saving
      parameters:
        - name: user
          in: query
          schema:
            type: string
          example: '{{uuid}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                desc: New Car
                goal: 950000
                currency: KSH
                currentAmount: 0
      responses:
        '200':
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 17:01:53 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: 87c0db438f1f6fad-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"b0-AejV7vmf02i002hJKbnIT1PAJAM"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: 99a15726-916c-468c
            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:
                savings:
                  - desc: New Car
                    goal: '950000'
                    currency: KSH
                    _id: 662fd2808f1d17198913a0c8
                    createdAt: '2024-04-29T17:01:52.662Z'
                    updatedAt: '2024-04-29T17:01:52.662Z'
        '500':
          description: Internal Server Error
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 17:07:43 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: 87c0e3d1de5305a9-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"31-ECl8iiAeka0ynaiMhKo/ZdbvFbI"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: 341178f9-64ee-4194
            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: Savings not added!

````