#bobbyz-checkout-customer
1 messages · Page 1 of 1 (latest)
In Stripe checkout, the customer has to input postal code and country (to pay with credit card).
A successful session creates a customer object.
How can i make the object contain the postal code and country?
It already contains the Full Name.
Can you give me an example Session to look at?
Here's the customer object.
{
id: ‘xxxx’,
object: 'customer',
address: null,
balance: 0,
created: xxxx,
currency: 'usd',
default_source: null,
delinquent: false,
description: null,
discount: null,
email: ‘xxxx,
invoice_prefix: ‘xxxx,
invoice_settings: { custom_fields: null, default_payment_method: null, footer: null },
livemode: false,
metadata: {},
name: 'bz',
next_invoice_sequence: 2,
phone: null,
preferred_locales: [],
shipping: null,
tax_exempt: 'none'
}
You want the session object?
It's got a lot of sensitive information. Is that what you want tho?
Sorry I should have been a little bit clearer. I was asking for a clear example of a Session id, cs_test_123456
I'm asking because on my end I see the postal code and country on the Customer object after completing the Session
cs_test_b1oBdxCQobAxZ2UmqJXFkyxvs22bDc5UNudEKZJ14HJwFrWbDn6Q8zbTBW
In Stripe dashboard, in the customer objects created by the successful checkout sessions, I also don't see postal code, country
All I need is the postal code and country that the customer inputs into Stripe Checkout.
It appears the information is on the "payment" but not on the customer...
What is this and how do i get it with the API? This has the postal code and country.
Payment is not an object in the Stripe API.
@boreal glacier A Payment Intent is associated with each invoice in the subscription, that's where you'll find the "payments" like the above
Specifically here: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
Okay. I have the subscription object. How do I go from that to postal code and country?
let me quickly create a test myself using the same params so we're looking at the same thing
when you do this, the billing information is associated with the payment method used for the payment
so if you have the subscription id, for example, you could inspect that by retrieving the subscription and using expansion to get at those billing details: https://stripe.com/docs/api/expanding_objects
expand[]=latest_invoice.payment_intent.payment_method
Okay. I'll try that out. And the info is just in billing_details?
If you want to have the customer billing address saved on a customer, you can provide a customer id for the Checkout session and set the parameter customer_update[address]=auto
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_update
correct
but with the customer_update approach, you'd have the billing address info saved as the customer[address]
Thanks, it works.
Great, thanks for highlighting this. I'm going to file this as feedback internally so we can try to improve this experience for you.