Deposit - WHG-Students/Bankingsystem GitHub Wiki

Deposit Amount

Deposit a specific amount to your account.

Request Method

POST

Request Endpoint

https://students.trade/api/v1/deposits

Request body

In the request body, provide the following JSON keys with values.

Key Type Description Required
amount integer The amount to be sent in cents

Headers

Name Value
Authorization Bearer <access_token>

Example

Request
curl -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbG..."
  -X POST \
  -d '{"amount": 5000}' \
  https://students.trade/api/v1/deposits
Response
Status Code 201
Content-Type application/json
{
  "id": 4,
  "type": "withdrawal",
  "amount": 325,
  "creditAccount": 1,
  "createdAt": "2020-07-01T21:10:14.000Z"
},
Other possible responses
  • 400 Bad Request
  • 401 Unauthorized
  • 404 Not Found
  • 412 Precondition Failed
  • 428 Precondition Required
  • 500 Internal Server Error

Get All Deposits

Get Deposit history of your account.

Request Method

GET

Request Endpoint

https://students.trade/api/v1/deposits

Headers

Name Value
Authorization Bearer <access_token>

Example

Request
curl -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbG..."
  -X GET \
  https://students.trade/api/v1/deposits
Response
Status Code 200
Content-Type application/json
[
  {
   "id": 4,
    "type": "withdrawal",
    "amount": 325,
    "creditAccount": 1,
    "createdAt": "2020-07-01T21:10:14.000Z"
  },
  ...
]
Other possible responses
  • 401 Unauthorized
  • 404 Not Found
  • 412 Precondition Failed
  • 428 Precondition Required
  • 500 Internal Server Error