How to fix create-checkout-session 400 error after recent changes to offer and signup pages?
I made a tweak to my Offerage and signup and seem to be getting a 400 error. I have the offer page where the user clicks the plan they want. They are redirected to the create account/signup screen. On click the button should redirect user to make the account and redirected to Stripe for payment. But it is creating the account in MemberStack but returning:
memberstack.js:2
POST https://client.memberstack.com/member/plans/create-checkout-session 400 (Bad Request)
could you please go here: https://www.productm8.io/ and click one of the plans and start to sign up and let me know what the issue is
regards C.
productm8.io
ProductM8 – AI-Powered Tools to Build & Validate Business Ideas Faster
Transform your business ideas into actionable plans with ProductM8. Use AI to map business models, define value propositions, and generate product strategies in minutes.
Comments
7 comments
Hey Craig Quilkey, a couple of things that I noticed would be:
window.MemberStack.openCheckoutbut you can find the right function to call for launching the checkout as per the developer docs here.The base code is as follows:
And in the place of "PRICE_ID" in the code, you can pass on the URL parameter that you fetch from 'planoffer' as per your setup and launch it after the signup.Also I am wondering is there a reason why you are taking a custom code approach for this?Since all of this can be done just with the use of attributes and the entire flow should be handled automatically.
yeah its this page im having issues with:
https://www.productm8.io/sign-up
i have tried to add the data-ms-price:add attribute to the signup form as i was told by support dont add to the attribute to the create account button
Even I have disabled the custom script on the pages and just tried adding the relevant attributes shared in the guide above. That approach should work without any errors, but still I face issues after adding attributes directly to the plan's get started button and disabling any custom script which affects the signup form or the buttons which have the attributes. I’m so close but I’m still getting an error on the signup page.
I created a free subscription for some special guest but in the checkout im getting an error:
memberstack.js:2 POST https://client.memberstack.com/member/plans/create-checkout-session 400 (Bad Request).
The Voucher is simply revealing the 3rd panel to the user.
Here is the URL
https://www.productm8.io/pricing?voucherpass=CraigsVoucher
any advice would be great
Hey Craig Quilkey,
For the 3rd panel's 'Get Started' button, can you have the custom attribute as data-ms-plan:add="pln_free-k31n90nvk" instead of data-ms-price:update="pln_free-k31n90nvk" as it is currently?
That should solve the error and assign the free plan to the user when they click on the Get started button for the free plan.
Hope this helps.
Hi AJ, I applied this and tried both dynamically adding the attributes to the button or the attributes just being on the button. the Free returns an error both the start and the business buttons work fine. but the free panel does not let the user through.
could you have another look at the URL and let me know what you think:
https://www.productm8.io/pricing?voucherpass=CraigsVoucher
I can still see that the free panel's 'Get Started' button has the custom attribute as data-ms-price:update="pln_free-k31n90nvk".
Can you please change it to data-ms-plan:add="pln_free-k31n90nvk" and test the flow out and see if you still face any blockers?
A J you might need to refresh as it is set to add
Whether it is set to add or update the error is happening on the next screen once the subscribe button is pressed
But A J i hugely appreciate your help!! thank you so much
Hey Craig Quilkey,
Welcome 😇
The difference in the attributes I shared earlier is not just of add / update. Both the attributes are different in the use-case, such that the data-ms-price is used for paid plans and data-ms-plan is used for free ones.
While I can see you have changed it to data-ms-price:add, what I had mentioned was to have the custom attribute as data-ms-plan:add="pln_free-k31n90nvk".
You can also find this information by clicking the "Install & Publish" button when you select the respective free plan in Memberstack dashboard, in case you want to double-check.
Can you make the changes and test it out to see if it helps?
Please sign in to leave a comment.