concept account in category api

This is an excerpt from Manning's book The Design of Web APIs.
Table 3.1 HTTP methods beyond CRUD (view table figure)
HTTP method Action POST (and PUT in creation) Create a customer, add a meal to a menu, order goods, start a timer, save a blog post, send a message to customer service, subscribe to a service, sign a contract, open a bank account, upload a photo, share a status on a social network, and so on GET Read a customer, search for a French restaurant, find new friends, retrieve opened accounts for the last 3 months, download a signed contract, filter best selling books, select black-and-white photos, list friends, and so forth PATCH/PUT Update a customer, replace goods in an order, switch plane seat, edit an order’s delivery method, change an order’s currency, modify a debit card limit, temporarily block a credit card, and so on DELETE Delete a customer, cancel an order, close a case, terminate a process, stop a timer, and so on
As a first call to the Banking API, the Awesome Banking Application can request to list the user’s accounts, as shown in figure 8.5.
Figure 8.5 The Awesome Banking Application requests to list accounts.
![]()
The controls in the implementation are less simple but still feasible. The implementation checks that the source account belongs to a customer managed by the advisor. The destination account should belong to the customer owning the account or a beneficiary registered by the same customer. Everything seems to be OK, but there’s a problem. The system needs to trace which customer requested the money transfer.
If the bank account belongs to a single customer, it is easy to find the customer’s ID because it’s the one attached to the bank account, and only the owner of the account can request a transfer. But if the account is a joint one belonging to more than one customer, this doesn’t work. The goal needs to be modified in order to convey the correct customer ID to the implementation.
Listing 11.10 A GraphQL response with an error
{ "errors": [ { "message": "No balance available for account with ID 1002.", "locations": [ { "line": 6, "column": 7 } ], #1 "path": [ "owner", "accounts", 1, "balance" ] #2 } ], "data": { "owner": { "vip": true, "accounts": [ { "id": "1000", "balance": 123.4 "name": "James account" }, { "id": "1002", "balance": null, #3 "name": "Enterprise account" } ] } } } #1 Points to error in query #2 Indicates the result property affected by the error #3 The actual property affected by the error