woothemes/woocommerce — pull request #6847 by harrisonde (2014-11-26 21:10:58+00:00)
Title: Look up product by sku

Extending products REST API GET request to lookup a product by sku. Register new route @ /products/sku/ and call get_product_by_sku(). Iterate over product collection, match SKU, validate related product ID, and return.

Request

https://www.example.com/products/sku/1111

Return

{
products: [
{
title: "Charleston, Then and Now hardcover book",
id: 57,
created_at: "2014-10-06T17:27:48Z",
updated_at: "2014-11-04T19:54:13Z",
type: "simple",
...

Conforms to current error type(s) if no SKU returned

errors: [
{
code: "woocommerce_api_invalid_sku",
message: "Error - sku not found"
}
]