REpresentational State Transfer, also known as REST, is a common standard, but it is not actually a defined standard, it is in fact an architectural style, or way of working. Whilst REST is a common "style" it does not lay down the rules on everything. When an API is implemented using a REST style, then it is usually said to be RESTful. This section is my view based on what I have seen, done and learnt, however there is nothing to say it is right. Given that REST is an architectural style then there is also nothing to say I am wrong....
See What is REST, or possibly The RESTful cookbook
This is a big, complex, non-trivial subject.... However, here is some personal opinion:
/bookshop/invoice/lineitem
It is very important to agree on what HTTP methods (HTTP request methods - HTTP | MDN) to implement and also what HTTP response codes (HTTP response status codes - HTTP | MDN) each of these is going to possibly return. This is what I would suggest.
PUT and DELETE are "idempotent", meaning that multiple identical requests have the same effect as any one of those requests.
REST can work with XML, JSON, YAML or anything else, it is not limited to one format of data and indeed can support many types.