title: REST API Design: When should we use association in Uri for the resources?
body: <p>We have simple e-commerce website where we have several products. Currently, each product has "Place order" button.</p>
  
  <p>When user clicks on this button, we show user a form to fill Name, Mobile number and address. We don't support any monetary transaction. Once user fills this form, the order is saved to database. The order table has OrderId, ProductId, UserName, UserMobile.</p>
  
  <p>We are designing API to save the user order. Should we have association b/w product and order while designing this?</p>
  
  <p>For example URI to save the user order should be like:</p>
  
  <ol>
  <li>POST /api/products/1/lead/ - The request body has user information i.e. name,mobile,address. OR</li>
  <li>POST /api/lead/ - The request body has "PRODUCT ID" and user information i.e. name,mobile,address.</li>
  </ol>
  
  <p>I am confused whether productId should be in request URI or in the request body? How do we make such decision?</p>