I have the resource OrderRequest which I guess can be qualified as process. The OrderRequest can be create of update. The create should be idempotent, because creating the same order request 2 times is undesired. At the same time the
POST is not idempotent and it does not always return the same result. I use a combination of Client side generated Id and server side generated Id. When create is executed the client side generated Id is used so it ends up as
It will return also a server generated Id that can be used. There is a subtle difference between the two Ids because having
clientGeneratedtID means also that there is a "dealer order" associated with the order.
Once created a modification is modified via
clientGeneratedID or server generated Id.
Reading through various posts I understand there is some confusion about
PUT with regards of what is create and what is
My understanding is that since I supply the Id and the URL the correct verb for my create is
PUT. At the same time since I am creating a process it does not sound correct for me that
PUT should be also update I am not entirely replacing the resource which is a prerequisite for using
PUT for update. So I have decided to use
Is it wrong that I have both
POST in such way? Am I doing it right? I understand that I can do an idempotent
POST for create. But is there a general guideline that you should use either
POST but don't combine and what about the fact that I use them in reverse
PUT for create and
POST for update?