#bensontrent_api

1 messages ¡ Page 1 of 1 (latest)

serene birchBOT
#

👋 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/1372981492036276254

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

night beacon
humble niche
#

I'm trying to find the invoice for a Payment Intent.

#

Ahh I see.

#

Ok I was unaware of this. I'll use the stripe.invoicePayments.list method. Cheers and thank you!

night beacon
#

There is another way, wait one:

humble niche
#

ok.

night beacon
#

You can expand payments.data.payment.payment_intent when you retrieve an Invoice and you will find it there.

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.

humble niche
#

Ok. Is there any way to exapand the invoice from paymentIntents.search

serene birchBOT
supple obsidian
#

Search API doesn't support expand parameter. Could you share the use case why you're looking for expanding feature via Search API when you already have the Payment Intent?

serene birchBOT
humble niche
#

If they select the unshipped "Payments" list, we search their paymentIntents for a metadata with a key of "ship_status" and a value of "unshipped". Before the breaking change in the API, our app would automatically link a payment intent to an invoice so we could know more about their order (we need to know what is in the order to prefill customs info, and preselect the shipping rate). However, now that we can't reference the invoice, the user's experiance is degraded when shipping from a payment since we're missing more details about their order.

#

Previously when shipping from a payment, we knew the invoice number and could provide a fuller experiance. Here's what shipping from a payment on a payment detail viewport.

#

But this page should look more like the screenshot below. We're missing the invioce ID, so we'll have to do additional calls to get the invoiceID associated with a paymentIntent:

#

In a list view of payment intents, this will require considerably more API calls.

supple obsidian
#

Thanks for sharing the details. We generally don't recommend to keep track of shipping status using Stripe API. Stripe enforces rate limit to 20 read operations per second for Search API. I'd recommend storing the shipping status in your own database and retrieve the data from your system instead of using Stripe API.

humble niche
#

Ok, thanks for the info. I'll work on engineering our backend to accommodate this.