I have REST API for my SPA application. My domain model has Order entity, it has Commission property which calculated on backend, it is number value
For get Order entity SPA calls this endpoint, this endpoint returns saved order
This endpoint returns basicly filled model for new Order
User fills other data and saves new Order by
But user would like know value of Commission for Customer before Order saved, and it is problem, we call REST API when user changes several fields which connected with value of commission, but I do not undestand how to choouse name and method of this REST endpoint
For existed Order it is simple, this endpoint can calculate commission and returns it for SPA
But what about not saved Order without Id? For calculating commission we need send many fields from Order model which is really complex and we can not use GET, simple way define such endpoint by POST
And send Order model JSON in this endpoint, but it is not REST way. What is good way for do it?