RESTful merge and split of resource
merge, rest, split
Solution
We had a similar issue where we wanted to merge 2 resources. After a long debate we decided that a consumer would POST a merge request resource which contained the 2 resources to be merged. Then after looking at it we decided that there was no need for both the complete source and target resource and instead a POST of just the unique identifier was sufficient. We didn't make the merge request with just the 2 ID's come in the body. It was easier to represent in a URL so that's what we did. The response from the POSTing of a merge request is the merged resource.
I guess I'm not a REST guru enough to tell you this was a good strategy or not, but for us it was a simple solution so we went with it.
Problem
I have a REST service that serves Invoice functionality, for example I can create, update and delete an invoice via the REST service. However I now need to have functionality to split an invoice into several new invoices, i.e. the method needs to create x invoices based on one invoice, and then delete the original invoice in one transaction. I also need a merge method that does the opposite, i.e. multiple invoices merged into one. How do I create such architect the RESTful way?