#alex-connect
1 messages ยท Page 1 of 1 (latest)
Can't I create a checkout session with a connected account product's price?
you can but you have to use Stripe-Account again and thus do a Direct Charge instead
if you're using transfer_data][destination] then that's a Destination charge so it use Price details on your account
not the connected account
so if you want to do Destination, use a Price you create on your platform instead. If you want to do Direct, then you can remove transfer_data and use Stripe-Account and a Price on the connected account instead.
I want to do destination charges
But it feels a bit heavy to create and maintain prices that are a copy of the connected account prices (same for products then). So I guess I won't be using prices id for that
as you wish
Thank you for the help!
I've created the destination charges and proceeded to a test payment that was successful. I'm wondering: how does the customer get the invoice for the payment they just made?
they get an email receipt automatically(in live mode) if you have that setting turned on https://stripe.com/docs/receipts
Ok thanks!
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
hey @past gulch I see you made some progress on your decision from yesterday, props! ๐
Oh thanks! I was just writing a new question: I created a checkout session with destination charges for a connected account, but I realized that when I payed it, I couldn't use a coupon.
where was the coupon created?
Oh yes, I'm progressing slowly but surely (french expression, I don't know if it works well in english)!
In the platform account
But there's not even an input to enter a code
I know what you mean ๐
could you please share the checkout session id?
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center 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.
Here is a checkout session : cs_test_a1LpwkxzVMUvCa7XZLrLk86nmQH9dihiG6xOsxC4k8XKSIioUjdQJ8c18W
Hi! I'm taking over this thread.
Hi and thank you!
You want customer to be able to enter promo codes in the Checkout Session?
If so, you need to set this parameter when creating the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-allow_promotion_codes
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Hello again!
I used the allow_promotion_codes parameter to enable them so that's a win on my side!
When a customer applies a promotion codes during checkout, the amount changes but the application fee stays the same. Is there a way for me to change the application fee or it will stay the same?
the application fees are in regards to what the Connect Accounts "owes you" from that transaction
today this is a fixed amount
Ok so it has to be clear with our conditions that if sellers want customers to apply a promotion code, it won't change the amount we take on the transaction
the idea is that the checkout session already has the application_fee_amount field https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-application_fee_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so you can't update that while the user is already in the checkout session
so either you collect the promocode before redirecting to Checkout and then apply the promocode on the Checkout Session and change the application fee
or you leave the application fee as is
Oh right, with the discounts parameter
yes exactly
you would be able to verify if a coupon exists or not based on https://stripe.com/docs/api/coupons/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you!
or even better if you have a promocode (user readable code) you could search for it with https://stripe.com/docs/api/promotion_codes/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh right, I see the difference between those two
I tried to pass metadata to the checkout session but I can't see it display on either dashboard (platform or connected). Here is the call I made:
curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_4N7H...: \
-d "line_items[][name]"="Paul Atreides" \
-d "line_items[][amount]"=2000 \
-d "line_items[][currency]"="eur" \
-d "line_items[][quantity]"=1 \
-d "allow_promotion_codes"="true" \
-d "payment_intent_data[application_fee_amount]"=800 \
-d "payment_intent_data[transfer_data][destination]"="acct_1LUY1aQTEyybitrV" \
-d "mode"="payment" \
-d "metadata[product_name]"="Paul Atreides" \
-d "client_reference_id"="userId" \
-d "success_url"="https://example.com/success" \
-d "cancel_url"="https://example.com/cancel"
The checkout session id is cs_test_b1CfjqLd42tj65dodNyKlMoc6aJJDTYor0fyLzWlg2pg7D0XKL89DwQf5L
I thought I could retrieve the client reference id on the dashboard as well but I couldn't find it
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I see they appear on the checkout session when I request it with /v1/checkout/sessions/cs_test_b1CfjqLd42tj65dodNyKlMoc6aJJDTYor0fyLzWlg2pg7D0XKL89DwQf5L but I'd like the seller to see that the payment is linked to their product Paul Atreides
if you want the metadata to be saved on the payment intent then you'd have to use https://stripe.com/docs/api/checkout/sessions/create?lang=curl#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh I'll try it out
Ok so I can see that on the platform account, on https://dashboard.stripe.com/test/payments/pi_3LUs8646T03ISJOc1S3948xI the metadata is here, but on the connected account, on the url https://dashboard.stripe.com/test/payments/py_1LUs8xQTEyybitrVIIUJJrbI, the metadata is absent
yep, since those are separate objects
it's not inherited, if you want the metadata to appear on the connected account object you have to manually update it via callinhttps://stripe.com/docs/api/charges/update using the intent.charges.data[0].transfer.destination_payment ID (and the Stripe-Account header)and set the metadata manually
So there is no way to pass metadata through checkout then payment intent then payment?
Oh yes I was going that path
also, you're using Destination charges with Standard accounts it looks like. That's not generally a recommended path
Yes I figured but that's what fits best our business model
issues like this are one of them(since all the payment processing happens on your platform, the Standard account has no visibility into any details of the payment or the customer unless you provide it, all they get is the transfer of funds from you; so they also rely on your for refunds/disputes)
no worries, it can work but it's just something to be aware of operationally as the connected account by default will get a pretty simplistic view(just the incoming payments) which might confuse them if they are existing merchants. Usually you'd use Express accounts for Destination-style charge
Ok I see, thanks for reassuring me, I don't master Stripe so it's good having some positive feedback !
Apart from a few of our sellers, they won't be existing merchants.
And we're using destination charges because:
- We don't want sellers to configure a payment page
- We want control over the coupons
- We want to take the Stripe fee for ourselves so that they only see our platform fee on their dashboard
makes total sense, but then why use Standard over Express?
Because the amounts will be quite low and the price of express accounts endangers the business model
We may have a lot of users selling only one good worth 15$ per month. So if we take 50% that's 7ish$ for us, minus 2$ for the express account
fair I guess, I don't have an answer to that
Thank you for your help, once again. This support really works well and really helps me setting up Stripe and everything
Just a thing about your recommendation here:
The charge already has the metadata I want. But I tried to update the destination_payment with the endpoint you provided and with the Stripe-Account header and it does not work.
what happens when you try, what's the error exactly?
I feel like I have to update the Payment object but there seems to be no endpoint for that.
it uses the /v1/charges API (I know it's a bit confusing)
curl https://api.stripe.com/v1/payments/py_1LUs8xQTEyybitrVIIUJJrbI
-u sk_test_4N7Hpo0HKjh3PtQ3mPtu5ZEg:
-d "metadata[product_name]"="Paul Atreides"
-H "Stripe-Account: acct_1LUY1aQTEyybitrV"
{
"error": {
"message": "Unrecognized request URL (POST: /v1/payments/py_1LUs8xQTEyybitrVIIUJJrbI). Please see https://stripe.com/docs or we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}
I'll try with the /v1/charges
that will work
Alright, that's all good!