2 ms·
So I would make a request like: POST /transfer from_account_id=12345&to_account_id=67890&amount=10 Perhaps I've misunderstood your comment, as I don'
by blowski 10y ago
So I would make a request like:
POST /transfer
from_account_id=12345&to_account_id=67890&amount=10
Perhaps I've misunderstood your comment, as I don't really understand why this is better than the original:
POST /accounts/12345/transfer
to_account_id=67890&amount=10
or even:
POST /accounts/12345/withdraw
amount=10
- qyv 10y agoHaving the /account/:accountid/transfer is not a terrible idea, but I would avoid it because the transfer resource is able to stand on it's own with making it tied to a single account resource. The key point though is that 'transfer' is the resource to perform all three of the original deposit/withdrawal/transfer actions.