#corbin_api
1 messages Ā· Page 1 of 1 (latest)
š Welcome to your new thread!
ā²ļø We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
ā±ļø We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1242873017537662986
š Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! Can you give me the ID of an Invoice where the shipping address showed up as expected, and the ID of another one where it didn't?
yeah one sec
With shipping: in_1PIqfhGTpOhCAFHy4IoD6BIf
Without shipping: in_1PJHKPGTpOhCAFHyUgYzhQku
I'm wondering if it's a problem with the product? If I remove the shipping_address_collection config from the checkout.sessions.create call, it only asks for zip code...
I think it's related to the Customer. For the first Invoice, the Checkout Session you created specified a customer_email, but for the other one you specified an existing customer ID. The Customer created for the first Invoice ended up with a shipping address, but the Customer you specified for the second Invoice doesn't have one.
If you want the shipping address to show up on the Invoice you need to add the shipping address to the Customer.
Is there a way to save the shipping information provided in a checkout session to the customer object? Ideally I would only make customers go through a single flow, instead of having them fill it out in a customer portal and then checkout.
When I was just using the email, I kept ending up with duplicate customer accounts. My hope with using customer id was that it would eliminate that duplication. But now it seems that the behavior of the checkout is pretty different based on using id vs email.
When I create the customer's stripe account, the only thing I know is their email.
Yeah, after the Checkout Session is completed you can update the Customer with the shipping address provided during Checkout: https://docs.stripe.com/api/customers/update#update_customer-shipping
Hmm, I'm also trying to use the invoice.paid event to send the invoice to our shipping integration. If I have to make a separate api call to update the shipping, it won't make it onto the first invoice, right?
When the subscription is paid for, the invoice.paid event fires almost immediately.
Yeah, it won't show up if the Customer doesn't have a shipping address at that point in time.
Is it expected that you have Customers in your system without a shipping address?
Checkout and providing address info is the last step of our user experience. Prior to checkout, we get other information from the customer, but not their address.
Currently, when a user signs up on our app (the beginning of our UX), we get their email and I use it to create their stripe account right then, a while before they get to the subscription/shipping part. I was hoping that the Stripe checkout session would have an option for updating their shipping information, but it sounds like it does not?
Perhaps I have to either use their email on the first checkout, or use some other type of session, like a setup session and then redirect them to a checkout session?
I have to have the shipping info on all invoices when they trigger the invoice.paid event so I can send it to our shipping integration.
Ah, I see. There is an option to have Checkout update the existing Customer's shipping address: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer_update-shipping
Try setting that and see if it does the trick.
That worked! Thank you so much!
The one parameter I didn't expand in the API docs š¤¦āāļø
Glad to hear it's working!
Is there a significant difference between the events invoice.paid and invoice.payment_succeeded?
We recommend invoice.paid. invoice.payment_succeeded won't fire if the Invoice is marked as paid out of band.
Perfect, that's what I was wondering.