API Request from POS UI Extensions(I'd like to get Order Details using orderId)

This is my first time using POS UI Extensions, and I would like to know the following:

When I call pos.order-details.action.render in POS UI Extensions, I want to get the Order Details (Total Price, Total Tax Price, Line Items, etc.) using the Order ID obtained from the Order API. I would like to know the structure of this app in that case.

My idea is to first create a file called order-details.jsx in the backend app/routes/api directory, and create code in it to get the Order details, such as a Gpraphql query. Then, POS UI Extensions sends an API request to the backend. At that time, the Order ID is attached, and the backend retrieves the order information that matches the received Order ID and returns it to POS UI Extensions in JSON format.

Is there any problem with this structure? Or is there an easier way?