✅ Which API design is better
I have orders that can be put in an issue status and then resolve that issue
There is two options:
Question: Which option is better and why?
There is two options:
- The first one is having two different endpoints
PATCH /orders/{orderId}/create-issuewith the following body
PATCH /orders/{orderId}/resolve with the following body- The second one is having a single endpoint
PATCH /orders/{orderId}/issue and we either pass an issueDate + reason OR resolveDate + solution plus a validation if we pass inconsistent data (for example passing a body that contains a reason + solution will result in a validation error since we can not create an issue and resolve it at the same timeQuestion: Which option is better and why?