#CHIΞFMCCONNΞLL.ΞTH - connect products
1 messages · Page 1 of 1 (latest)
Hello, can you tell me a bit more about your connect setup here? Are the accounts connected to your platform Standard, Express, or Custom accounts?
Hi Popmey, thanks for the help with this!
So we are building a marketplace for digital files and want to use Stripe Connect
The goal would be to use this method for paying our artists https://stripe.com/docs/connect/charges-transfers#collecting-fees
But we don't quite understand how to create a checkout session. Is it possible to send over the information for the checkout session when creating it or do we need to create products in stripe ahead of time?
You can do either. We have price_data and product_data parameters that you can use to pass in product data without creating prices and products on the connected account https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-product_data
It would probably be easier to do that. If you go the path of creating the prices and products on your connected account, you would need to do it for every account you are connected to and you would need to manage updates and whatnot for each of them yourself. Here it would probably just be easier to keep all the data on your side and pass it in as product_data and price_data as appropriate
I agree, we have been trying to do that but have run into problems with the calls
when I performed a product_data only call it ended up creating a product in the strip account
if I add the price_data call will it not create a product?
It is expected that the create price call will create a product if you provide data in product_data https://stripe.com/docs/api/prices/create#create_price-product_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I don't believe that that happens on Checkout but can double check
Is your problem that this is creating objects or is your problem something else?
Ideally we wouldn't create a product, just pass the user to the checkout session
also this was on a /prices session.. and it created a product in the stripe dashbaord. when we tried what we actually need using /checkout/sessions it would not take the price_data and threw some errors, and checkout sessions is what we are really trying to use. this was just some testing in postman to strip everything away and see what was working or not
The /v1/prices endpoint doesn't make a session, just a price object
What errors did you get on the checkout session call?
This line indicates that we got an empty price parameter from you rather than the price_data param that we are talking about line_items: { 0: { quantity: "1", price: "" } }
Can you show me how you tried to send price_data?
The price_data parameter takes an entire object https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
we would have to add all of these params as well right?
Correct
so in the code that I have above would it just be to add keypairs of price_data.currency , etc etc with values along with the original code?
or would it understand those as keypair values on their own in the context of price_data
so currency: usd, product: xyz.. etc
I am unclear on the distinction that you are trying to make. Can you show me examples of each?
for this snip of code [{"key":"0.price_data","value":"500"},{"key":"0.quantity","value":"1"}] would I just add another object inline with the price_data object
Im guessing it would look like [{"key":"0.price_data.currency","value":"usd"},{"key":"0.price_data.product_data.name","value":"new product"}, etc etc
or is this not the right way to add these parameters?
I am unfamiliar with that format unfortunately. Can you try each and see if either work here?
maybe something like this
[{"key":"0.price_data.currency","value":"usd"},{"key":"0.price_data.product_data.name","value":"CMS_NAME"},{"key":"0.price_data.unit_amount_decimal","value":"CMS_PRICE_DECIMAL"},{"key":"0.price_data.product_data.description","value":"CMS_DESCRIPTION"},{"key":"0.price_data.product_data.images":"value":"CMS_IMAGE_HERO"}]
ahh sorry.. ok let me try to push this into the API call and see what results I get back.
brb
👋 Hopping in since @mint tide had to head out