CategoryForSKU retusns the category for a given SKU Since the category is only available on the listing level, this will return the category and potentially save a call to GetBySKU if only the variant is needed
You call thisScope not enforced
GET
/v2/storefront/listing/sku/{sku}/category
const url = 'https://api.zentail.com/v2/storefront/listing/sku/example/category';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.zentail.com/v2/storefront/listing/sku/example/category \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”sku
required
string
Responses
Section titled “ Responses ”A successful response.
Media typeapplication/json
object
categoryId
string
Examplegenerated
{ "categoryId": "example"}default
Section titled “default”An unexpected error response.
Media typeapplication/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Examplegenerated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}