title: HTTP REST Response in CQRS
body: <p>I am building HTTP REST API and implementing CQRS, DDD, ES, and microservices concept for the API. </p>
  
  <p>For example, I want to build API for ordering system. The order contains order status, customer data, employee data, cart items, shipping data. The order command service and order query service are using different code, different databases. and different ip / port.</p>
  
  <p>Customer data consists of customer id, first name, last name, contact numbers, etc. Employee data like sales and staff consists of employee id, email, name, and role. Shipping data consists of shipping address, city, zipcode, shipping note, shipping method, and shipping cost. Cart items contains product id and qty. Customer data, product data, employee data, and shipping method data are produced from other services. </p>
  
  <p>I have two questions when I want to developing it.</p>
  
  <ol>
  <li>When I build the POST method to create new order from sales / staff, what should be in a <strong>request</strong> payload? Is it possible to only send customer id and the employee id as request payload? Or should I send the customer name and contact numbers as payload?</li>
  <li>When I build the POST / PUT method, should I return response code 200? What should be in the <strong>response</strong>? For example, I only send the customer id and employee id when a staff create new order to the order command service. Should the response body shows the full order data that contains other services result (like name and contact numbers from customer id, and so on)? Not only that, the denormalizer system is rather slow. The denormalizer is needed to get the customer and employee detail. It depends on network latency and other services responses. But, user want to get the order data instantly.</li>
  </ol>
  
  <p>What should I do to develop HTTP REST API in a correct way?</p>
  
  <p>Thank you.</p>