This feature request comes from #1825736: product resources: create, update, delete where the ability to GET products a /product/[SKU] was needed, because an external system is more likely to share SKUs in common with a Drupal Commerce site than Commerce product IDs. However, if we do offer this support, it needs to toggle URIs for every operation - retrieve, update, and delete - not just retrieve.
Additionally, we weren't really sure where to make this option toggle-able. I'm inclined to say it must just be done via the API through an alter hook, but if I was going to put it in the UI it would probably be fine to use a single variable and make the variable editable through the server resources form. This is what the user/logout resource does. We just need to ensure it's clear wherever it is that the SKU must be used for any operation.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | sku.patch | 4.32 KB | jeremylichtman |
Comments
Comment #1
jeremylichtman commentedThe attached patch adds an endpoint /product-sku/%sku