MutualFundBroker-API
  1. mutual_fund_broker
MutualFundBroker-API
  • mutual_fund_broker
    • User Registration
      POST
    • User Login
      POST
    • Add Investment
      POST
    • Fetch Portfolio
      GET
    • Fetch Funds by Fund Family
      GET
  1. mutual_fund_broker

Add Investment

POST
/portfolio/invest/
Allows the user to add a new investment to their portfolio. The user provides details such as the mutual fund ID, units purchased, and the purchase price, and the investment is recorded in their portfolio for future tracking.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params

Body Params text/plain
Example
Example:{ "mutual_fund_id": 150, "units": 10, "purchase_price": 4.0 }

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:8000/portfolio/invest/' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "mutual_fund_id": 150,
  "units": 10,
  "purchase_price": 4.0
}'

Responses

🟢200Success
application/json
Body

Example
{
    "message": "Investment added successfully",
    "investment": {
        "mutual_fund_id": 150,
        "mutual_fund_name": "UTI Banking & PSU Fund",
        "units": 10,
        "purchase_price": 4
    }
}
🟠422Parameter Error
Modified at 2024-12-22 14:41:49
Previous
User Login
Next
Fetch Portfolio
Built with