Magento REST icon

Magento REST

Consume Magento REST API

Inventory → Get Stock

AI-generated

Summary

Fetch stock information for a product SKU from Magento REST

Inputs

  • sku (required) — Product SKU
  • simplifyOutput — When enabled, flattens the response structure. Converts custom_attributes array to an object, flattens extension_attributes, and simplifies nested structures.

Output shape

Magento stock item JSON, optionally flattened per simplifyOutput setting

When simplifyOutput is true, the response undergoes flattenResponse transformation with resource 'inventory', which converts custom_attributes to attributes object, flattens extension_attributes into top-level extension_* keys, and sanitizes the sku field.

Examples

Example 1: Retrieve stock for SKU 'ABC123'

Set sku to 'ABC123', leave simplifyOutput disabled (default) for unmodified API response.

Links

Discussion