#eple0030_api

1 messages · Page 1 of 1 (latest)

paper ospreyBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1257266347805642774

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

woven linden
#

hi

woven linden
#

in my use case, i do not want to create a payment link (because of redirect url that can be specific to users). I want to use the checkout sessions

#

I would like that a client is able to offer a field where anyone can add coupon code in his checkout session page.

pine ibexBOT
somber hatch
paper ospreyBOT
woven linden
#

In my use case : I have a platform where a customer can log to his stripe account using Oauth. He can create coupon codes through my platform, to be used through his checkout session. In case his checkout session does not allow promotion code, the checkout session has to be updated by adding "allow_promotion_codes": yes.
-> I guess i cannot do this through my platform on his behalf because there is no API to update a specific checkout session.
--> In case this client is not a developper, is there a way that he can "allow promotion code" through the stripe dashboard (with the link provided through my platform)
--> Or are there other solution (that are not payment links) ?

keen abyss
#

So you're using Stripe Connect and the "customer" is a merchant with a Stripe account connected to your platform? usually you just call the API for the user who is your connected account and you control everything.

woven linden
#

In my use case, i do not want to use connected account. I just want a user to be able to create coupons through my platform (and that his checkout session allows coupon with the coupon field available)

keen abyss
#

it's not a matter of "wanting" ,if the user of your system is selling something/recieving money, you have to use Connect.

#

maybe I don't understand your flow and what the user personas are

woven linden
#

Yes, sorry maybe i am not clear enought. I would like that clients can create coupon code through my platform and that my platoform can monitor when coupons code were used

keen abyss
#

who is the client? do they receive money?

#

ultimately if you use Connect you can build all this, you can call the API on behalf of the connected account and create Coupons and PromotionCodes through the API, and you can listen to webhooks and notify the connected account users when coupons are used, or query the API and build per-user reports you can share with them, etc etc

woven linden
#

Client is for exemple a SAAS.

  1. the saas team log to his stripe account in my platform using oauth (through pathfix),
  2. they can access forms to create a coupon code A
  3. when created, my platform configure the coupon code A through the stripe API.
  4. a end user (Paul) wants to pay for the saas service and use the coupon code A in the saas checkout page.
  5. Then my platform monitor when Paul has used the coupon A, through a webhook or the stripe API

my issue is : if the saas team has not allowed "allow promotion code" = yes in the checkout configuration. i guess they cannot accept coupon codes
in case the saas team is a solo entrepreneur and is not a developper, i would like to find an easy way so that he does not have to modify his checkout configuration to allow promotion code".
I understand i cannot to do this on behalf of the saas (i cannot update his checkout config on his behalf) and i was wondering if it was possible for exemple to do it through the dashboard that is more user friendly (meaning friendly for non developpers)

keen abyss
#

ok. So your 1->5 is just a normal Standard Connect + Direct Charge scenario.

if the saas team has not allowed "allow promotion code" = yes. i guess they cannot accept coupon codes
I understand i cannot to do this on behalf of the saas (i cannot update his checkout config on his behalf)

Ultimately this is all exactly what I said earlier — the way you would build this is that you call the API for the client and build their payments integration, you create the CheckoutSessions or PaymentLinks for them via Connect, and you can control everything and pass https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-allow_promotion_codes when you create the CheckoutSession on their account, and so on. So it doesn't matter what settings they have on their account really, you are the one building the payment pages and integration so you can control if coupons are accepted.

That's the only way this works.

woven linden
#

OK, sorry. thanks for your feedback and your time 🙂

I am only afraid that his success redirect url can be very spécific (eg. i created one for a project and i was using result of previous bubble worfklow like https://www.mysite/?v=ordered&o= result of of step 1 (create a unique order …)unique ID.

So in this case i guess i cannot create the checkout sessions (as the saas would like to use his own config that i cannot recreate)

keen abyss
#

not sure I follow; you can pass any value you like to success_url when you create a CheckoutSession, and you can build something in your site/application that lets the client configure what URL they want to use, and then your code can access and pass that value from your database.

#

but yes you can't really just "plug into" some existing payment integration the client has, you don't control it

#

to me the only way this works is if your platform is providing the payment integration to the business, and the "coupon tracking" is a feature of that , it doesn't really work as a standalone concept since you can't control the payment integration otherwise

woven linden
#

Yes, it's clear. thanks for that! Can ask you another question : in the same use case, which endpoint can i use to retrieve the saas monthly revenue ? to create a graph with the evolution of its revenue, month by month ?

keen abyss
woven linden
#

Ok, so i have to use for ex. 12 times the charge API (to retrieve the last 12 months ?

keen abyss
woven linden
#

Ok i will have a look and test it. Thanks!

paper ospreyBOT