I have a flow for which I’m designing apis and I’m not sure I made the best choice.
The use-case is as follows:
I’m providing a service for users that have boxes which contains bottles of shampoo. I need to insert the bottles into a container with some limitations, the main is that all bottles from a certain box will be shipped in the same container.
The API is as follows:
The user uploads an inventory file to the UI which contains boxes of bottles of shampoo.
The 1st api is to assign on the server a size to each bottle in each box.
Then 2nd api – user needs to upload the list of boxes with their inventory of bottles. (This api i’m not sure of) and receives back a list of containers, and in each container object the boxes (which means the bottles) of shampoo that need to be loaded into it.
Regarding the 2nd api, I’m not sure if the proper way would be to upload a list of the boxes by the user, or a list of the bottles.
I’d love some thoughts on this matter.
I wrote the api in mind that the first part since I’m dealing with on the bottle level I should receive the list of bottles, and not boxes.
For the 2nd api, I’m dealing with boxes level so not to receive the bottles independantly.
work account is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.