3

I'm trying to test paddle subscriptions on localhost. When I use the product id and vendor id from an example git repo everything works.

When I use my own vendor id and product id (plan id) I get a 400 error:

{"errors":[{"status":400,"code":"validation","details":"The checkout id must be a valid checkout id.","source":{"pointer":"\/checkout_id"}}]}

I have created a subscription on the portal which gives me a'Plan Id'. Is the plan id the wrong id to be using here?

Paddle.Checkout.open({ product: 752932 });
Starchand
  • 684
  • 1
  • 9
  • 23

2 Answers2

3

I had the exact same setup and symptoms. I assume you're using the Paddle sandbox since you're testing on localhost. What helped me is that I had to add

Paddle.Environment.set('sandbox')

right above the

Paddle.Setup({ vendor: xxxx })

This did it for me, but annoyingly enough wasn't well documented at all so it took a bunch of digging.

Hope this helps you too!

user1507558
  • 444
  • 3
  • 7
  • 15
  • Did you get answer? – AgentNirmites Jun 10 '22 at 06:11
  • This doesn't work for me in my localhost. but in the checkout url, the sandbox url has already been added which is returned from paddle. why do you think it should be added above on the `Paddle.Setup({ vendor: xxxx })`. The url return from paddle is `https://sandbox-create-checkout.paddle.com/checkout/custom/eyJ0Ij.........` – Ziaur Rahman Dec 15 '22 at 01:34
1

Generally, this type error occurs when checkout request goes from localhost. I faced the same problem. When I test it on my hosting server, it works fine. The weghook_url should be approved by the paddle. You can set up the web hook here paddle web hook setup.

paddle web hook setup section

Ziaur Rahman
  • 1,148
  • 11
  • 24