title: HTTP POST or PATCH for REST API cart checkout and the payment
body: <p><strong>In short:</strong> <em>I want to know if the HTTP method PATCH is ok for my scenario.</em></p>
  <p>I have REST API <strong>which checkouts the cart and charges the customer</strong>. Essentially endpoint consists of couple steps:</p>
  <ol>
  <li>Get balance</li>
  <li>Charge</li>
  <li>Edit cart order status</li>
  </ol>
  <p>Therefore the API charges the client (<em><strong>changes</strong></em> his balance), then confirms the cart order (<em><strong>changes</strong></em> the cart status to confirmed).</p>
  <blockquote>
  <p>According to the old reference :
  <a href="https://stackoverflow.com/questions/630453/what-is-the-difference-between-post-and-put-in-http">What is the difference between POST and PUT in HTTP?</a></p>
  <ul>
  <li>POST is used to create a resource or <strong>modify</strong> it</li>
  <li>PUT is used to create resource if it does not exist or replace,    also it is    idempotent</li>
  </ul>
  </blockquote>
  <blockquote>
  <p>According to the : <a href="https://www.baeldung.com/rest-http-put-vs-post" rel="nofollow noreferrer">https://www.baeldung.com/rest-http-put-vs-post</a></p>
  <ul>
  <li>POST is only for resource creation</li>
  <li>PUT definition is the same</li>
  </ul>
  </blockquote>
  <blockquote>
  <p>Lastly according to the :
  <a href="https://www.baeldung.com/http-put-patch-difference-spring" rel="nofollow noreferrer">https://www.baeldung.com/http-put-patch-difference-spring</a></p>
  <ul>
  <li>PATCH is used for the partial update, can be not idempotent</li>
  </ul>
  </blockquote>
  <p>Therefore in my scenario <strong>endpoint is not idempotent</strong>, I can cross out the PUT, but in this case I'm lost whenever should I use the POST(which in older SO question was used for update) or PATCH(which now used for partial update). I'm leaning towards the PATCH but it seems like PATCH is used for modification of specific entity, meanwhile POST seems to fit the case but it is no longer used for updating.</p>