Level 23
endpoint: products/create with a json of [ {product_id: 1, qty: 3}, {...} ]
Hi I am building an ecommerce website and I am writing api's for it. Now I have many products and each product has an unique id, for example apple has product_id = 1 and then orange has a product_id = 2 and so on. So I am writing an api to place an order and the behavior of the api would be that it would accept number of product_id's and their quantities and then place order. So what would the best practice to accept many product_ids and their quantities and also validating them ?
endpoint: products/create with a json of [ {product_id: 1, qty: 3}, {...} ]
Please or to participate in this conversation.