DEV Community

Discussion on: Building Consistent RESTful APIs

nepz_sonze profile image

I think even the /detail is not needed. "/transactions/:id" sounds fine.

richardigbiriki profile image
Richard Igbiriki Author

This is entirely optional and depends solely on your implementation choice. You could have a Transactions table with minute information about each transaction and a Details table with more detailed information about each transaction. I am using this approach of two related tables.

Yes, you can also get all the details in /transaction/:id but it depends on the use case.