#NotP_Dot
1 messages ยท Page 1 of 1 (latest)
๐ you can use price_data with add_invoice_items to create the Price inline: https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items-price_data
yeah I've been trying that but keep receiving an error from my backend. Would you mind letting me know if I am using a false syntax
stripe.Subscription.create( customer=customerID, add_invoice_items.price_data=[{ currency: "usd", product: "xxxxxx", unit_amount_decimal: "1999" }], items=[ {"price": subPriceId}, ], )
price_data={
currency: "usd",
product: "xxxxxx",
unit_amount_decimal: "1999"
}
}],```
I believe
thank you for this, let me give it a go
would you mind giving more insights on what the product attribute should look like. I am passing in an Id but keep receiving Request req_IWx05coAIRimVQ: No such product: 'price_1LkxfpI8IkWHMKdsMuC8oH6O'
The product should be a prod_xxxx ID: https://stripe.com/docs/api/products/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You can create a Product via the API or Dashboard
But every Price has to have an attached Product