[EDIT] Account_id Param Required when submitting an order as a Guest #93
-
Hi! I have been struggling with a strange error on my development storefront. The Problem: Description: Checking if the swell session is present: The API call = Desired Outcome: Can you help me provide any clue in figuring this out? EDIT: I think that I've found a cause for this problem. It seems that according to your Frontend documentation, the cart object for the unauthenticated user should have a property account_logged_in=true and guest=true, however, my cart object when the user is unauthenticated seems to have account_logged_in=null and guest=true. Is there a way that I can set this cart property to false, with the code? I think that that is why your API responds with a missing account_id error :) Take a look at the screenshots below. It has been a frustrating error that has been happening for about a month. (I have not been touching any code responsible for order placing since then.) Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@m4tt133 What you see is expected behavior and the order can't be submitted without If you want your users to submit the order without authentication, then pass only email_id as follows: await swell.cart.update({
account: {
email: '[email protected]'
}
})
await swell.cart.submitOrder() |
Beta Was this translation helpful? Give feedback.
@m4tt133 What you see is expected behavior and the order can't be submitted without
account.email
(or account_id).Please look into the below section to update email and password (if applicable) to the cart before submitting the order.
https://developers.swell.is/frontend-api/carts#update-cart-account-info
If you want your users to submit the order without authentication, then pass only email_id as follows: