I suggest looking at the Blueprint Replication videos on the UnrealEngine youtube channel. Even if you aren’t using Blueprint its a good introduction to the concepts of replication.
There’s nothing stopping you from doing some calculations clientside, but you always need to ‘ask’ the server to do the actual changes to gameplay-affecting variables. This is so the server as the only trustworthy entity can decide whether to perform the task at hand or not. In some cases, like this, it’s simpler to just just tell the server that you want your inventory filled, and allow it to do so.