I'm new to REST, so forgive me if this is a stupid question.
So, I have a client resource. The client has a lot of loans. So, I believe that the URL for receiving customer loans will be
client / 21 / loans
(where 21 is the customer identifier)
Now, how can I add to loans if I do not have the full amount of loans? For instance. the client has 10 credits, and I want to add 5. As I understand it, if I use the message, I would do something like:
customer / 21 / credits? amount = 15 (is that even right?)
However, what if I just want to add to existing loans? That is, I want to send 5 credits and say add them to what the client currently has? Am I defining some phantom resource like addedCredits?
client / 21 / addedCredits? Amount = 5
then backstage, am I just making loans + = 5?
source share