Odd POST Resource in the API

I was looking at the API today and found something odd in the POST for a transaction. 

 

Right now there is an endpoint for creating a single transaction that accepts one transaction:

POST /budgets/{budget_id}/transactions

And a separate endpoint for creating multiple transactions through an array:

POST /budgets/{budget_id}/transactions/bulk

 

Why is this multiple endpoints? It would be seem to make more sense if `/transactions` accepted an array, and the size of that array for a single transaction would just be one instead of requiring two endpoints.

 

It's also a little odd from the REST standpoint because 'bulk' is not a resource of 'transactions'. The rest of the API does a great job at this, e.g. `transactions` is a resource of a specific `budget_id` which is a resource of `budgets`.

 

Just a piece of feedback for potential improvements regarding REST in the API!

2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Thanks for the feedback Alex Hatzenbuhler - I provided a bit of an explanation of why we made this design decision here: https://support.youneedabudget.com/r/h4p75z.  An argument can certainly be made that the /budgets/{budget_id}/transactions/bulk doesn't conform to "pure" REST design but there were some design concerns that had to be balanced.   Having said that, we appreciate the feedback and will look at seeing if we can get the /budgets/{budget_id}/transactions/ to simply accept a single item or an array so that is can accommodate both.  Have fun with the API!

    Reply Like
    • Brady Interesting read! Definitely interesting trying to maintain a standard across other resources. Thanks for the info 👍

      Reply Like
Like1 Follow
  • 1 Likes
  • 1 yr agoLast active
  • 2Replies
  • 1000Views
  • 2 Following