Using With API
Note: This feature is for Database driver only.
This package uses the cookies and sessions to maintain cart data during page reloads. As the APIs are stateless, we cannot use them to do the same.
To solve the issue, you can manually set the authenticated user id to maintain the cart data.
Running this code will tell the package to assign the cart data to the specified user.
Note: Guests cannot manage their carts via API as we cannot have a uniform way to track the user.