# Inventory

Inventory management endpoints

## Update Product Inventory

> Updates inventory quantities for product variants. Use external\_id for synced products or product\_id for unsynced products.

```json
{"openapi":"3.1.1","info":{"title":"Brand Developer API","version":"1.0.0"},"tags":[{"name":"Inventory","description":"Inventory management endpoints"}],"servers":[{"url":"https://api.maisonsafqa.com/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-MaisonSafqa-Api-Key","description":"API key authentication. Pass your API key directly in the X-MaisonSafqa-Api-Key header (e.g., 'ms_test_your_api_key_here' for test environment or 'ms_live_your_api_key_here' for production environment)"}},"schemas":{"InventoryUpdateResponse":{"type":"object","properties":{"error":{"type":"null"},"results":{"type":"array","items":{"$ref":"#/components/schemas/InventoryUpdateResult"}},"message":{"type":"string"}}},"InventoryUpdateResult":{"type":"object","properties":{"sku":{"type":"string","description":"Variant SKU"},"success":{"type":"boolean","description":"Whether the update was successful"},"old_quantity":{"type":"integer","description":"Previous inventory quantity"},"new_quantity":{"type":"integer","description":"New inventory quantity"},"error":{"type":"string","description":"Error message if update failed"}}},"ErrorResponse":{"type":"object","properties":{"error":{"oneOf":[{"type":"object","properties":{"field":{"type":"string","description":"Field that caused the error"},"message":{"type":"string","description":"Human readable error message"}}},{"type":"string","description":"Error message"}]}}},"UpdateInventoryRequest":{"type":"object","properties":{"variants":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/VariantInventoryUpdate"},"description":"Variant inventory updates"}},"required":["variants"]},"VariantInventoryUpdate":{"type":"object","properties":{"sku":{"type":"string","description":"Variant SKU"},"inventory_quantity":{"type":"integer","minimum":0,"description":"New inventory quantity"}},"required":["sku","inventory_quantity"]}}},"paths":{"/products/{id}/inventory":{"patch":{"tags":["Inventory"],"summary":"Update Product Inventory","description":"Updates inventory quantities for product variants. Use external_id for synced products or product_id for unsynced products.","parameters":[{"schema":{"type":"string"},"name":"id","in":"path","required":true,"description":"Product identifier - external_id (Shopify ID) for synced products, or product_id for unsynced products"}],"responses":{"200":{"description":"Inventory updated successfully","headers":{"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in current window"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed per minute (stricter for inventory updates)"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryUpdateResponse"}}}},"400":{"description":"Validation errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInventoryRequest"}}},"required":true}}}}}
```
