Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am using Laravel and kyon147/laravel-shopify package to create an app. When I wanted to create a liquid file through asset API, I got the below error. Let me know what is wrong.
"exception" Client error: `PUT my-shop-domain/admin/api/2023-10/themes/161834598681/assets.json` resulted in a `404 Not Found`
Controller Method:
public function index() { /** @var IShopModel $shop*/ $shop = Auth::user(); $themes = $shop->api()->rest('GET', '/admin/api/2023-10/themes.json'); $activeThemeId = ''; foreach ($themes['body']['themes'] as $theme) { if ($theme['role'] === 'main') { $activeThemeId = $theme['id']; } } if ($activeThemeId) { $content = "test content"; $liquidFile = [ 'asset' => [ 'key' => 'templates/out-of-stock.liquid', 'value' => "test content" ] ]; $response = $shop->api()->rest('PUT', '/admin/api/2023-10/themes/' . $activeThemeId . '/assets.json', $liquidFile); dd($response); } }
I have the exact same issue right now.
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025