#bastien_93455
1 messages ยท Page 1 of 1 (latest)
request POST BODY : {
"mode": "payment",
"line_items": "[{"price":"price_1NzJnkKyMBSMZ5jqxwSrpF6p","quantity":1},{"price":"price_1NzJnlKyMBSMZ5jqCg3JtHw6","quantity":2}]",
"cancel_url": "https://example.com/cancel",
"success_url": "https://example.com/success",
"payment_method_types": [
"card"
]
}
Found the request https://dashboard.stripe.com/logs/req_uTKuoTDbpI5an2
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It looks like your setup is wrapping and escape quoting the line items array, so we get one long string instead of a valid json array
Thanks, any idea on how could I resolve this? I feel like I've tried everything ๐ฆ
๐ catching up, give me a sec
Ah are you using netsuite connector or trying to integrate API natively?
Natively
I think the issue is somewhere in this line
'&line_items=' + JSON.stringify(lineItems) +
Your JSON.stringify call is creating a string from the line items
we expect an array of hashes
I've tried without ... and I have another error
without the JSON.stringify I have this in the logs : {
"success_url": "https://example.com/success",
"line_items": "[object Object],[object Object]",
"cancel_url": "https://example.com/cancel",
"mode": "payment",
"payment_method_types": [
"card"
]
}
Can you provide request IDs?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_dpWf9CUuH5triU
yeah seems like your code is somehow passing [object Object],[object Object] as line items
sorry these are netsuite basics, we can't help with those sort of questions.
Would recommend looking for right netsuite docs on this
yes this is when I remove the JSON.stringify
going back with my first post, my call seems correct, this is my line_items : [{"price":"price_1NzL7ZKyMBSMZ5jq72YcFdAp","quantity":1},{"price":"price_1NzL7ZKyMBSMZ5jqC5UqCuwU","quantity":2}] and still the response is invalid array
req_oSD8EmD1RgrPQd
Look at the request body
https://dashboard.stripe.com/logs/req_oSD8EmD1RgrPQd
You're passing string into a field that expects an array of hashes
Yes I understand, when I format my array with stringify it is a string and I have an error and when I don't use the stringify it is another error ๐ฆ anyway, thanks for your help