Stripe checkout wont accept metadata

For anyone still coming across this issue, simply placing a client_reference_id or metadata parameter did not work for me even with the 2020-08-27 API.

Adding payment_intent_data with metadata is what got it to work for me. You can try adding the following code:

'payment_intent_data'=>['metadata' => ["order_id" => $orderID, "type" => "myProduct"],

You can do this

stripe.checkout.sessions.create({
    payment_intent_data: {
        application_fee_amount: this.booking_fee,
        metadata: {
            key1 : value1,
            key2 : value2,
            .
            .
            key N : value N
        }
    }
})