#hamilton_checkout-customer-phone
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/1281656667435438194
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm a bit confused about what you're doing currently. Can you point to the specific API methods you're using and elaborate on what you want to do with them?
Sure... I am using the event API endpoint /v1/events. I need to have an event type that includes customer info, shipping info, customer and shipping phone, customer and shipping email, and product description. I can do this for suscription purchases by using the type invoices.paid. When I pull with a type that includes web based orders ( with type charge.updated) I do not get phone numbers. It shows as a null field even when I know the phone number was submitted.
I am using a GET request
RIght, but what are you using to accept payments? Where is your customer providing their phone number?
ah... We added a link on our web site for products defined in stripe to the pricing table. The "require phone number" was added when the new pricing table is created.
Does that answer your question?
When I see a phone number on the customer and billing I dont see it on the GET for event type charge.updated.
Ah, okay. Yes, thank you. I would expect that phone number to be on the Customer object. Have you looked there already?
https://docs.stripe.com/api/customers/object#customer_object-phone
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The object comes back as NULL instead of the expected value
Hi ๐
I'm stepping in as my colleague needs to go. What object are you referring to here?
event API endpoint, Type charge.updated - objects data/data/object/billing_details/phone and data/data/object/shipping/phone
both come back as null even when I can see a phone number is supposed to be there. I could also be misinterpreting things
In which request are you saving the phone number?
Where does it come in to Stripe?
Let me ask a different way. If I see a phone number for a customer in the web portal UI under Customers tab > CustomerA ..... should that show for billing details?
Looking at your account logs, I'm seeing a phone number collected in this request: https://dashboard.stripe.com/logs/req_vf165LqPIZ1T8i
Is this a valid example?
in the web portal UI
I don't know what UI you are referring to here
Just a sec... You almost have it but wrong request type.
I am only having issues with web based orders.
Just a sec
I will get you a request to see
req_O6ilegof3ugti3
Thanks, taking a look
No
This is incorrect. I am looking for the requests that SET the phone number
Where this data is collected from the customer
IF your only problem is that, when you retrieve the webhook event, the customer property on the Checkout Session is null, that is expected
These phone numbers are being set directly on the Customer
Ah... I saw in the stripe dashboard
Insights
Spent
$295.00
Details
Guest details
Diana McCarty
didicoop@yahoo.com
Customer since
Sep 4
Billing details
714 Gakona Court
Fairbanks, AK 99701 US
(907) 662-5115
and assumed that customer would ahve the phone number included in billing details.
I cannot speak to what the Dashboard displays. We focus primarily on API integrations here
Because it's a Stripe owned surface, we keep building "helpful" features into the Dashboard. But it can mean it is difficult to map those data points directly back to the APIs
gotcha, it seems like a disconnect between the two.
I appreciate your time. Bummer.
Know anyone who built an API from Stripe to XPS Shipper yet? I am almost done but for this phone number hurdle.
In this case, the phone number appears to be collected by the Checkout Session. This data is then saved to the Customer object. If you want to retrieve this information you will need to include another API call using the Customer ID from the checkout session
https://docs.stripe.com/api/customers/retrieve
That endpoint is the closest I have seen to having all the info XPS requires.
Know anyone who built an API from Stripe to XPS Shipper
I am not familiar with this shipping software and do not know of anyone working on something like it.
You can check our partners directory though: https://stripe.com/partners
Thank you.
Wait a sec..
k
Why are you using the webhook events list api?
You could use the Checkout Session List API and include the Customer in the expand parameter to get all the data in one shot
I could not find another that gave all the info I needed.
EXPAND?
ooooh
I will go back to the docs... I must have missed something
Okay so first you use the LIst API and filter on status to make sure you are only getting completed session
https://docs.stripe.com/api/checkout/sessions/list#list_checkout_sessions-status
Then, you use the expand parameter to return full Customer objects instead of the IDs.
https://docs.stripe.com/expand
So it would look like (in Python)
sessions = stripe.checkout.Session.list(status='complete', expand=['customer'])
I will dive into that. Thanks for the tip!
And the phone number would be at session.customer.phone
Great ๐ Happy to help ๐