Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 772 Bytes

post.md

File metadata and controls

61 lines (41 loc) · 772 Bytes

Create transaction

Description

Add new transaction in .csv file and return modified date

URL: /api/transaction

Method: POST

Auth required: no

Data constraints

{
  "date": "[valid iso date format]",
  "status": "[boolean]"
}

Data example

{
  "date": "2015-01-02",
  "status": "false"
}

Success Response

Code: 200 OK

Context example

{ "modifiedDate": "2012-03-02T00:00:00.000Z" }

Error Response

Code: 400 BAD REQUEST

Condition: If date is wrong.

{
  "err": "Bad date format. String has to be date format"
}

Code: 400 BAD REQUEST

Condition: If status is wrong.

{
  "err": "Bad status type. Status has to be either 'true' or 'false'"
}