#Implicit
1 messages · Page 1 of 1 (latest)
👋 happy to help
are you using Checkout Sessions or your own custom code with Payment Elements?
Custom code with payment elements
@ruby urchin please don't enter other threads
I don't think there's an easy way of doing that if there is one in the first place
why not just use Checkout Sessions? https://stripe.com/docs/payments/checkout/shipping
We would love to, but we have a existing codebase right now with custom code. We will migrate to sessions
If there is a workaround that would be great for us, otherwise we would need to delay our release until we convert back to sessions
to be clear you use the Invoices API today?
and you want to add an invoice item that is representing shipping, and have that item excluded from coupons/discounts?
We are using subscriptions API, with shipping fee added with add_invoice_items parameter. Then we use subscription.latest_invoice.payment_intent to create a payment element.
Second question almost yes, but we use the invoice generated from subscriptions API.
well it's mostly impossible in that context I think.
if not using Subscriptions, you can use https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-discounts to have item-level discounts. So instead of a coupon on the Invoice as a whole, you add coupons to individual items, and don't add it to the ones you don't want a discount on. But that doesn't work for subscriptions, they don't support this item-level discount feature
Alright, we might need to convert to sessions API now then. But will we have recurring shipping fees available on subscriptions then? Because I couldn't see it in the demo
Another question, if we set customer's address before the checkout session; will it prefill the address?
I'm not sure, would have to test it
We are motivated to switch to sessions API if we meet these requirements. If you could provide if these are possible we will switch right now.
the Discord server is extremely busy , I might get around to it in a while
in the meantime you can read the docs at https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
in any case I don't really think the situation is any different with Checkout, discounts are mostly applied to the whole payment in all our integrations
but again comes down to you experimenting with the different options, there's many ways of using the API