[{"data":1,"prerenderedAt":338},["ShallowReactive",2],{"navigation":3,"\u002Fapi\u002Finventory":72,"\u002Fapi\u002Finventory-surround":333},[4,42,55],{"title":5,"path":6,"stem":7,"children":8,"page":41},"Api","\u002Fapi","api",[9,13,17,21,25,29,33,37],{"title":10,"path":11,"stem":12},"Cart API","\u002Fapi\u002Fcart","api\u002Fcart",{"title":14,"path":15,"stem":16},"Category API","\u002Fapi\u002Fcategory","api\u002Fcategory",{"title":18,"path":19,"stem":20},"Checkout API","\u002Fapi\u002Fcheckout","api\u002Fcheckout",{"title":22,"path":23,"stem":24},"Inventory","\u002Fapi\u002Finventory","api\u002Finventory",{"title":26,"path":27,"stem":28},"Order Numbers","\u002Fapi\u002Forder-numbers","api\u002Forder-numbers",{"title":30,"path":31,"stem":32},"Product API","\u002Fapi\u002Fproduct","api\u002Fproduct",{"title":34,"path":35,"stem":36},"Promotions API","\u002Fapi\u002Fpromotions","api\u002Fpromotions",{"title":38,"path":39,"stem":40},"Taxes","\u002Fapi\u002Ftaxes","api\u002Ftaxes",false,{"title":43,"path":44,"stem":45,"children":46,"page":41},"Getting Started","\u002Fgetting-started","getting-started",[47,51],{"title":48,"path":49,"stem":50},"Admin panel","\u002Fgetting-started\u002Fadmin-panel","getting-started\u002Fadmin-panel",{"title":52,"path":53,"stem":54},"Installation","\u002Fgetting-started\u002Finstallation","getting-started\u002Finstallation",{"title":56,"path":57,"stem":58,"children":59,"page":41},"Tasks","\u002Ftasks","tasks",[60,64,68],{"title":61,"path":62,"stem":63},"Building A Navigation","\u002Ftasks\u002Fbuilding-a-navigation","tasks\u002Fbuilding-a-navigation",{"title":65,"path":66,"stem":67},"Product Detail Page","\u002Ftasks\u002Fproduct-detail-page","tasks\u002Fproduct-detail-page",{"title":69,"path":70,"stem":71},"Product Listing Page","\u002Ftasks\u002Fproduct-listing-page","tasks\u002Fproduct-listing-page",{"id":73,"title":22,"body":74,"description":327,"extension":328,"links":329,"meta":330,"navigation":164,"path":23,"seo":331,"stem":24,"__hash__":332},"docs\u002Fapi\u002Finventory.md",{"type":75,"value":76,"toc":323},"minimark",[77,81,85,90,93,119,122,215,218,235,238,242,245,269,292,319],[78,79,22],"h1",{"id":80},"inventory",[82,83,84],"p",{},"Larasell deducts tracked stock during checkout and records an inventory\nreservation for each affected order item. A successful payment consumes the\nreservation. Cancelling the order releases the reservation and restores stock\nunless cancellation explicitly disables restocking.",[86,87,89],"h2",{"id":88},"expired-reservations","Expired reservations",[82,91,92],{},"Reservation expiration is processed by this command:",[94,95,100],"pre",{"className":96,"code":97,"language":98,"meta":99,"style":99},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","php artisan larasell:release-expired-inventory\n","bash","",[101,102,103],"code",{"__ignoreMap":99},[104,105,108,112,116],"span",{"class":106,"line":107},"line",1,[104,109,111],{"class":110},"sBMFI","php",[104,113,115],{"class":114},"sfazB"," artisan",[104,117,118],{"class":114}," larasell:release-expired-inventory\n",[82,120,121],{},"The command is not scheduled by the package. Add it to the application\nscheduler so the application controls how often cleanup runs:",[94,123,127],{"className":124,"code":125,"filename":126,"language":111,"meta":99,"style":99},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Illuminate\\Support\\Facades\\Schedule;\n\nSchedule::command('larasell:release-expired-inventory')\n    ->everyMinute()\n    ->withoutOverlapping();\n","routes\u002Fconsole.php",[101,128,129,159,166,192,204],{"__ignoreMap":99},[104,130,131,135,139,143,146,148,151,153,156],{"class":106,"line":107},[104,132,134],{"class":133},"sbssI","use",[104,136,138],{"class":137},"sTEyZ"," Illuminate",[104,140,142],{"class":141},"sMK4o","\\",[104,144,145],{"class":137},"Support",[104,147,142],{"class":141},[104,149,150],{"class":137},"Facades",[104,152,142],{"class":141},[104,154,155],{"class":137},"Schedule",[104,157,158],{"class":141},";\n",[104,160,162],{"class":106,"line":161},2,[104,163,165],{"emptyLinePlaceholder":164},true,"\n",[104,167,169,171,174,178,181,184,187,189],{"class":106,"line":168},3,[104,170,155],{"class":110},[104,172,173],{"class":141},"::",[104,175,177],{"class":176},"s2Zo4","command",[104,179,180],{"class":141},"(",[104,182,183],{"class":141},"'",[104,185,186],{"class":114},"larasell:release-expired-inventory",[104,188,183],{"class":141},[104,190,191],{"class":141},")\n",[104,193,195,198,201],{"class":106,"line":194},4,[104,196,197],{"class":141},"    ->",[104,199,200],{"class":176},"everyMinute",[104,202,203],{"class":141},"()\n",[104,205,207,209,212],{"class":106,"line":206},5,[104,208,197],{"class":141},[104,210,211],{"class":176},"withoutOverlapping",[104,213,214],{"class":141},"();\n",[82,216,217],{},"The application must also run Laravel's scheduler in production. The command\naccepts a configurable query batch size when larger stores need it:",[94,219,221],{"className":96,"code":220,"language":98,"meta":99,"style":99},"php artisan larasell:release-expired-inventory --batch-size=250\n",[101,222,223],{"__ignoreMap":99},[104,224,225,227,229,232],{"class":106,"line":107},[104,226,111],{"class":110},[104,228,115],{"class":114},[104,230,231],{"class":114}," larasell:release-expired-inventory",[104,233,234],{"class":114}," --batch-size=250\n",[82,236,237],{},"When an active reservation expires, the command safely cancels its unpaid\norder, cancels pending payments, releases all active reservations belonging to\nthe order, and restores their stock. Paid orders are not released.",[86,239,241],{"id":240},"events","Events",[82,243,244],{},"Reservation lifecycle events are dispatched after their database transaction\ncommits:",[246,247,248,254,259,264],"ul",{},[249,250,251],"li",{},[101,252,253],{},"Larasell\\Larasell\\Events\\InventoryReserved",[249,255,256],{},[101,257,258],{},"Larasell\\Larasell\\Events\\InventoryReservationConsumed",[249,260,261],{},[101,262,263],{},"Larasell\\Larasell\\Events\\InventoryReservationReleased",[249,265,266],{},[101,267,268],{},"Larasell\\Larasell\\Events\\InventoryReservationExpired",[82,270,271,272,275,276,279,280,283,284,287,288,291],{},"Each event exposes the affected reservation through its ",[101,273,274],{},"$reservation","\nproperty. Expiration dispatches both ",[101,277,278],{},"InventoryReservationReleased"," and\n",[101,281,282],{},"InventoryReservationExpired",". Stock quantity changes continue to dispatch\n",[101,285,286],{},"InventoryDecremented"," and ",[101,289,290],{},"InventoryRestocked",".",[82,293,294,295,298,299,298,302,305,306,309,310,312,313,287,316,291],{},"Both stock-change events expose ",[101,296,297],{},"$product",", ",[101,300,301],{},"$variant",[101,303,304],{},"$order",", and\n",[101,307,308],{},"$quantity",". ",[101,311,301],{}," identifies the concrete inventory record. It is\nnullable only for compatibility with historical product-only inventory paths.\nReservation events expose the same identity through\n",[101,314,315],{},"$event->reservation->variant",[101,317,318],{},"product_variant_id",[320,321,322],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":99,"searchDepth":107,"depth":161,"links":324},[325,326],{"id":88,"depth":161,"text":89},{"id":240,"depth":161,"text":241},"Reserve, consume, release, and expire product inventory.","md",null,{},{"title":22,"description":327},"ihW9iq0VOKXhnv1cwbIEAS1MF1UxaEKBW6uSiM4Yk9s",[334,336],{"title":18,"path":19,"stem":20,"description":335,"children":-1},"Turn a cart into an immutable order and collect payment.",{"title":26,"path":27,"stem":28,"description":337,"children":-1},"Generate customizable, concurrency-safe order numbers.",1789114878354]