#lucknighton

1 messages · Page 1 of 1 (latest)

nocturne anchorBOT
fossil gazelle
#
        line_items: [
          {
            // Provide the exact Price ID (for example, pr_1234) of the product you want to sell
            price: 'price_1Nb7HkJXmoDaPvqQQU0mzduj',
            quantity: 1,
          },
        ],
        mode: 'subscription',
        success_url: `${req.headers.origin}/?session_id={CHECKOUT_SESSION_ID}`,
        cancel_url: `${req.headers.origin}/?canceled=true`,
        subscription_data: {
          trial_period_days: 14,
        },
        custom_fields: {
          key: 'full_name',
          label: {
            custom: "Full Name",
            type: 'custom'
          },
          type: 'text'
        }
      });```
#

Yes

proud dagger
#

What is the response you get from the request?

fossil gazelle
#

Invalid array

proud dagger
#

Right, because custom_fields needs to be an array, not an object

#

like our docs state

#

You need to wrap your object in []

fossil gazelle
#

Oh right!

#

Thank you my bad

proud dagger
#

No worries

#

It's why we're here

fossil gazelle
#

Much appreciated. Got it working