© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
1 reply
LazyGuard

✅ 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:
1. The first one is having two different endpoints
PATCH /orders/{orderId}/create-issue
PATCH /orders/{orderId}/create-issue
with the following body
{
  "issueDate": ......
  "reason": ......
}
{
  "issueDate": ......
  "reason": ......
}


and

PATCH /orders/{orderId}/resolve
PATCH /orders/{orderId}/resolve
with the following body
{
  "resolveDate": ......
  "solution": ......
}
{
  "resolveDate": ......
  "solution": ......
}


2. The second one is having a single endpoint

PATCH /orders/{orderId}/issue
PATCH /orders/{orderId}/issue
and we either pass an
issueDate + reason
issueDate + reason
OR
resolveDate + solution
resolveDate + solution
plus a validation if we pass inconsistent data (for example passing a body that contains a
reason + solution
reason + solution
will result in a validation error since we can not create an issue and resolve it at the same time

Question: Which option is better and why?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ which is better ?
C#CC# / help
3y ago
Generic types API design
C#CC# / help
2y ago