Beetoven
Beetoven3w ago

API error with FlutterFlow

I have a WorFlow (“Stripe Payment Checkout Link Creator”) that works manually in BuildShip 2.0. The input is in the format: [{ "price": (x) Price ID, "quantity": (x) Quantity }] In FlutterFlow I call the API with the following JSON file: { "PriceID": "<varpriceId>", "Quantity": <varquantity> } I've tried other variations: { "PriceId": "<varpriceId>", "quantity": <varquantity> } { "Price ID": "<varpriceId>", "Quantity": <varquantity> } It's always a mistake: "type": "StripeInvalidRequestError", "raw": { "message": "The line_items parameter... Has anyone experienced this problem and been able to solve it? Could you post the solution here? Thank you.
Solution:
I did it simply by recreating a new, similar workflow. I conclude that I made a mistake in changing the original template.
Jump to solution
5 Replies
AI Support
AI Support3w ago
AI Support Bot Information
<@717368497705058375> you can react on the relevant answer (message) with a ✅ in this thread when you think it has been solved, by the bot or by a human! Anyone can react on this message with a ❌ if the GPT bot is unhelpful or hallucinating answers. Please note: Team members will review and answer the questions on best efforts basis.
AI Support
AI Support3w ago
AI Response
The error you are encountering, "The line_items parameter," suggests that there might be a mismatch in how the line_items are structured in your API calls compared to what Stripe expects. The line_items parameter in Stripe generally requires a specific structure. It's crucial to ensure that the JSON body you send matches the expected format for creating a Checkout Session. Here's a generalized example of how the line_items should be structured:
{
"line_items": [
{
"price": "price_id", // Replace with your actual price ID
"quantity": 1 // Adjust the quantity as needed
}
]
}
{
"line_items": [
{
"price": "price_id", // Replace with your actual price ID
"quantity": 1 // Adjust the quantity as needed
}
]
}
Based on this format, make sure your API call aligns with this structure. Your FlutterFlow JSON call should reflect this structure, with the price key exactly matching your Price ID from Stripe and quantity being a number. If you haven't done so already, you can use the Stripe dashboard or the API documentation to verify that your Price ID is correct and exists in your Stripe account. Also, ensure that you have included it in the line_items properly. If you continue to experience issues, it may be beneficial to check the API documentation for any additional required fields specific to your setup or validate your JSON format and keys within the context of the BuildShip and Stripe integration guidance【4:7†source】.
BuildShip AI Support
Beetoven
BeetovenOP3w ago
When calling the API in FlutterFlow, the body displayed is: { "price": "price_1QN9AjJEAEYO5vN4ikHJTe3i", "quantity": 1 } Log BuildShip: Error: The line_items parameter is required in payment mode. Logs Stripe: { "error": { "message": "The line_items parameter is required in payment mode.", "request_logurl": "https://dashboard.stripe.com/test/logs/req**", "type": "invalid_request_error" } } Post Body: { "mode": "payment", "payment_method_types": { "0": "card" }, "success_url": "https://aur25w.buildship.run/checkout-message-******" } It should be: { "line_items": { "0": { "price": "price_1QN9AjJEAEYO5vN**", "quantity": "1" } }, "mode": "payment", "payment_method_types": { "0": "card" }, "success_url": "https://aur25w.buildship.run/checkout-message-******" }
Stripe Login | Sign in to the Stripe Dashboard
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Beetoven
BeetovenOP3w ago
I can't export the API, it seems that this is only possible with paid plans. I called BuildShip Support asking if I could export the API if I bought credits (U$10.00) before signing up for a plan. I'm waiting for a reply, but if anyone knows about this, please let me know.
Solution
Beetoven
Beetoven2w ago
I did it simply by recreating a new, similar workflow. I conclude that I made a mistake in changing the original template.