REST API - showing relationships
If you just wish to show the other tales that are related to a specific table, you can show an
endpoint
(like orders or carts or patrons) and add /related to the url. eg:
https://127.0.0.1/api/v1/orders/related
Other Examples:
https://127.0.0.1/api/v1/orders/related
Relationships for orders
https://127.0.0.1/api/v1/patrons/related
Relationships for patrons
https://127.0.0.1/api/v1/carts/related
Relationships for all cart related items
https://127.0.0.1/api/v1/orders/related?group=type+refers_to&agg=count&sort=-type
Count of other tables that refer to orders by adding aggregate,
sort
and grouping functions
Diataxis:
How To