Can't create subscriptions on Stripe

Viewed 1440

I can't create stripe subscription due to Missing required param: items.. I request it with items although.

The error:

{
  "error": {
    "code": "parameter_missing",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
    "message": "Missing required param: items.",
    "param": "items",
    "type": "invalid_request_error"
  }
}

The code:

    const stripeCustomer = await stripe.customers.create({
      name: name,
      email: email,
      plan: basicPlan,
    })
    const stripeSubscription = await stripe.subscriptions.create({
      items: [{ plan: basicPlan }],
      customer: stripeCustomer.id,
    })

Stripe Customer account was successfully added.

1 Answers

Got the same problem. I've found out I'm lacking some package details

Related