Help needed for Stripe Create Session API with coupon (no such coupon error)

I have encountered a problem with Stripe’s create session API with coupon ID. I have created a coupon that can be applied to a product. I have supplied a price ID (from the product) and the coupon ID. But the API results in a “no such coupon” error. Did I do something wrong?

Here is the API spec for passing in a coupon in create session API.

It turns out that it needs to be discounts[0][promotion_code].