DEV Community

Discussion on: Building Consistent RESTful APIs

Collapse
 
nepz_sonze profile image
nepz_sonze

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

Collapse
 
richardigbiriki profile image
Richard Igbiriki

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.