0 votes
Can anyone let me know how the correct answer is 8000. I double checked and I'm getting 2444.

How I did it:

1. from the /shops path I got all the shops and their id

2. by using id, I got all the products they are being sold in shops by /shops/{id}/products path

3. after getting all the product id, I got value of amount, number of item has been sold and value of products by /shops/products/{id} path.

Let me know what is the correct way of solving this question. Thank you for reading this question!
in ex11 by
edit history

1 Answer

0 votes

There is a field called profit returned in one of the API endpoints that contains the value.

Your approach was not intended. Unfortunately, the calculation gives the revenue of the shop instead of the profit. (For a real shop, the revenue would be higher than the profit, of course.)

by (860 points)
edit history