The problem most people make when starting out with restful services is thinking that everything applies to one resource, in your case order.
In fact you are working with 3 resources, orders
, payments
and deliveries
- when you realize this then your options suddenly expand.
Now you could do something like this:
POST /order (creates order, returns Order Id)
POST /order/{OrderId}/cancel (updates order to cancelled **)
POST /order/{OrderId}/payments (creates a payment for Order, returns Payment Id ***)
POST /payments/{PaymentId}/deliveries (creates a delivery for a Payment, returns Delivery Id ***)
** This is a debatable point in RESTful design, could be a PUT as well, the choice is ultimately yours. there is a ton of discussions on the topic
*** This makes sense because you would only create a Payment or Delivery in relation to another resource
Then you could access or modify the additional resources as such:
GET /payments
GET /payments/{PaymentId}
DELETE /payments/{PaymentId}
PUT /payments/{PaymentId}
GET /deliveries
GET /deliveries/{DeliveryId}
DELETE /deliveries/{DeliveryId}
PUT /deliveries/{DeliveryId}
Hope this gives you some more ideas.