Although there are multiple questions in SO about naming conventions in a RESTful API I can't find any reference on how to deal with boolean endpoints (endpoints that return a boolean value).
Consider an API with the resources /products and /orders.
An order may reference multiple products, so it's not possible to delete a product without messing with related orders.
Calling DELETE /products/:id in a product that is referenced by an order would return a 409 Conflict.
So far, everything is very straight forward, but what if the client wants to confirm if this one product can or cannot be deleted?
A boolean endpoint would return true or false (or a JSON structure containing this value somehow).GET /products/:id/can-be-deleted
The problem here is that can-be-deleted isn't a (sub)resource, it's an action to check something...
I feel that if RESTful APIs should use nouns and shouldn't have verbs in endpoints it also shouldn't have adjectives (/deletable, /completed) or predicates (/can-be-deleted, /is-ready).
If that is the case, what is the convention on this?
Should this information have it's own endpoint?
If so, how this endpoint should be named?
If not, should this information be part of another endpoint (something like GET /products/:id returning this information)?