Would it help you to have more resources?
- /packages/12345/status
- /packages/12345/status/latest
- /packages/12345/status/versions/7
- /packages/12345/status?at=20150630T1138-0600
- /packages/12345/history/delivery/status
- /packages/12345/history/latest/status
- /paclages/12345/history/20150630/updates/2
Ceci n'est-pas un package. Different use cases can use different identifiers to manipulate "the same" data.
Put another way, it's a uniform resource identifier, not a uniform domain entity identifier. Having many resources that represent a single entity offers you a lot of flexibility.
References
The specification of PUT in RFC 2616 support the notion that a single resource can by represented by more than one URI
A single resource MAY be identified by many different URIs. For
example, an article might have a URI for identifying "the current
version" which is separate from the URI identifying each particular
version. In this case, a PUT request on a general URI might result in
several other URIs being defined by the origin server.
This language is substantially changed in RFC 7231
A PUT request applied to the target resource can have side effects on
other resources. For example, an article might have a URI for
identifying "the current version" (a resource) that is separate from
the URIs identifying each particular version (different resources
that at one point shared the same state as the current version
resource). A successful PUT request on "the current version" URI
might therefore create a new version resource in addition to changing
the state of the target resource, and might also cause links to be
added between the related resources.
Fielding's thesis has this to say
For example, the “authors’ preferred version” of an academic paper is a mapping whose value changes over time, whereas a mapping to “the paper published in the proceedings of conference X” is static. These are two distinct resources, even if they both map to the same value at some point in time. The distinction is necessary so that both resources can be identified and referenced independently.
packages/:id/delivery
that can be created viaPUT
and retrieved viaGET
, acting in a 1-to-1 relation?