#Peter Boyd
1 messages ยท Page 1 of 1 (latest)
hey
Only thing you need to be aware of would be rate limits when creating Products
currently we aren't cataloging our products in Stripe but we're considering it
ah interesting
We'd like to switch to the Checkout flow instead of doing custom payment intents
and we're looking into whether we should catalog all of our products in Stripe or if we should create "price_data" line items on the fly just prior to the creation of the Checkout Session
Our concern is that if we use "price_data", we won't be able to create coupons for the products
whereas if we catalog all of our items as Products, we can obvious create a coupon and use the "applies_to" field to apply discounts on individual items or Product Classes
What would you recommend as best practice?
Our business is basically a marketplace like eBay
This mostly just depends on where you want to manage your catalogue as you noted.
You can either manage it all from your database and then use price_data and just keep track of the coupons in your database as well
Or you can catalogue within Stripe
I wouldn't really say one is better than the other -- it is mostly just preference
Yeah, sounds like the trade-off is the heavier dev lift to catalog all products and keep them in sync vs not syncing products but managing the coupons and promo_codes and handling the coupon logic on our end prior to the checkout session
Yep I agree with that
Sure!
One more question sorry. We grant customers the ability to "trade" items with one side of the transaction offering cash optionally. I.e. I trade you my soccer ball for your basketball and give you $10 in cash the deal
in the deal*
in order to do this, our thoughts are that we would generate a "free" price for the products in the trade, then create a "price_data" line-item which is just "cash" with the appropriate amount
Is there a better way to accomplish this?
๐ hopping in here since bismarck has to head out soon
hey awesome
so the scenario is
I give you items A + B + $10
You give me items C + D
if A, B, C, and D are all Stripe Products that have prices greater than zero, how would we properly reflect this during the checkout session?
if I'm going through the checkout session, I am purchasing "C + D" for $10
sorry if this is confusing, I can clarify more if so
Quick clarification - what do you mean when you say A,B,C, and D all have prices greater than zero? If these are trades wouldn't you want these products to be $0?
yes they will be $0 at the time of trade, but lets say they have prices prior to the trade
lets say I list all of my items for $5 and you list all of your items for $5
if I want to trade you some of your items + $10 for some of my items, I'm not necessary paying the listed price for each item
typically it's a cash price that is less than the list price of the items
is there a way to add the items as line items, but set a custom price during the checkout flow?
so if item A and B have a price of $20
and C and D have a price of $20
could I initiate a trade with you like this:
I give you:
[{
price: A.price_id,
price_amount: 0,
}, {
price: B.price_id,
price_amount: 0,
}, {
price_data: {
name: 'Cash',
unit_amount: 10,
}
}]
and you give me:
[{
price: C.price_id,
price_amount: 0,
}, {
price: D.price_id,
price_amount: 0,
}
this being psuedocode, I know the format for the objects is differnet
So there's no way to specify a price ID and give it a custom amount for that checkout sessions, but some alternatives would be:
- Pass in a discount when creating the Checkout Session (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts)
- Do a new custom one-off price for $0
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
got it, thanks
thats what I was thinking
ok great I think that's all the help I need
very much appreicate your hlep
help
๐
If a customer uses a promo code for an item that is being sold by another user on the marketplace, is there a way we can apply the discount for the buyer, but still pay full price to the seller?
i.e. the buyer has a 10% off promo code,
the seller lists item for $100
The buyer pays $90 in the checkout session, but we still transfer $100 to the seller.
where the $10 comes out of our Stripe business account
is this possible?
Yes, this is definitely possible
You would just have to do this with separate charges and transfers, and not destination charges that set transfer_data
Basically, once the Checkout Session is complete you'd make an API call to create a Transfer for the amount you choose
oh interesting
so the checkout session would still move the $90
but the $10 would be completely separate? like a separate payment_intent?
Actually let's pause for a quick second - are you currently using connect? I assumed you were based on what you said, but realize I never checked
right now we use connect as in the sellers have to create a Connect account
but the buyers use their "customer_id" and we create a Payment Intent
but for item purchases, we aren't currently applying promo codes, so we don't have to worry about this use case
We would like to switch to Stripe Checkout instead of custom Payment Intents
are you currently doing direct charges or destination charges?
destination charges
customer: buyer.stripeCustomerId,
transfer_data: {
destination: seller.stripeAccountId as string,
amount: subtotalCents - appFeeCents
},
this is how we're doing it now
and we set an amount using
amount: subtotalCents + transactionFeeCents,
when we apply a promo code, we'd like the seller to still receive the full amount. our Stripe Account will cover the difference
Perfect
So what I'm recommending is that you don't set transfer_data at all anymore. You just create a normal PaymentIntent, and then you can seaprate create a Transfer (which is what send the funds to the seller account)
Ah, so a Transfer is different from a payment intent
yup!
got it
so we'd create the transfer after receiving the webhook that the Checkout Session was successful
yup!
happy to help! (and definitely test all that separate charges/transfers stuff in test mode first just to make sure you don't hit any snags)
yup absolutely