I'm trying to use swell-js to build a custom checkout flow i.e. not using the hosted checkout. I'm following the swell-js docs for a basic checkout flow as follows (create cart, add items, update card, convert to order):
swell.init(SWELL_STORE_ID, SWELL_PUBLIC_KEY, { useCamelCase: true });
...
await swell.cart.addItem({
productId: product.id,
quantity: 1,
});
...
await swell.cart.update({
billing: {
method: "cash", // <-- note that I am using a manual payment method
.....
},
shipping: { ... }
});
...
await swell.cart.submitOrder(); // <--- the error happens from this
but I'm getting this error about account_id parameter missing. From what I understand, this is the account_id of my own Swell account, and isn't something that I should have to pass as a parameter anywhere during the steps above (the cart should already contain this read-only value).
I'm trying to use
swell-js
to build a custom checkout flow i.e. not using the hosted checkout. I'm following theswell-js
docs for a basic checkout flow as follows (create cart, add items, update card, convert to order):but I'm getting this error about
account_id
parameter missing. From what I understand, this is theaccount_id
of my own Swell account, and isn't something that I should have to pass as a parameter anywhere during the steps above (the cart should already contain this read-only value).