#lucknighton
1 messages · Page 1 of 1 (latest)
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
What is the response you get from the request?
Invalid array
Right, because custom_fields needs to be an array, not an object
like our docs state
You need to wrap your object in []
Much appreciated. Got it working