You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POST /portfolio
+ Request
+ Headers
Accept: 'application/json'
Authorization: Basic [email protected]:secret
+ Body
{
coin_id: int
amount: float, (could be negative)
price_usd: float,
traded_at: date, ('2018-04-20T16:40:51.620Z', Iso8601)
notes: 'I want that lambo!' (optional)
}
+ Response 200
{
trade: {
"coin_id": "2",
"user_id": 1,
"amount": "-2.2183",
"price_usd": "675.982",
"total_usd": -1499.5308706,
"notes": null,
"traded_at": "2018-04-20T16:40:51+00:00",
"updated_at": "2018-05-03T09:08:26+00:00",
"created_at": "2018-05-03T09:08:26+00:00",
"id": 5
}
}
+ Response 400
{
coin_id: [
"The coin id field is required.",
"The selected coin id is invalid."
],
amount: [
"The amount field is required.",
"The amount must be a number."
],
price_usd: [
"The price usd field is required.",
"The price usd must be a number.",
"The price usd must be at least 0."
],
traded_at: [
"The traded at field is required.",
"The traded at must be a date before 2018-05-03T09:14:39+00:00."
]
}
+ Response 401 Unauthorized