#alexesch_api

1 messages ¡ Page 1 of 1 (latest)

winged trailBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

split monolith
#

hi
code example
$subscription = $stripe->subscriptions->create([
'customer' => $customer_id,
'items' => [
[
'price' => $bundle['sub_plan_id'],
'quantity' => $qty,
],
],
'add_invoice_items' => [
[
'price' => $bundle['bundle_with_subscription_stripe_product_price'],
'quantity' => $qty,
],
],
'payment_behavior' => 'default_incomplete',
'metadata' => $metadata,
'expand' => ['latest_invoice', 'latest_invoice.payment_intent'],
]);

execution time, about 2.5 seconds

$stripe->paymentIntents->update(
$subscription->latest_invoice->payment_intent->id,
[
'metadata' => $metadata,
'receipt_email' => '',
]
);
execution time, about 1.7 seconds

#

is this normal? or maybe i'm missing something

#

the code is executed from both, my local env, and production server, pretty much the same results

winged trailBOT
fluid prawn
#

Can you share the request id?

#

That's not that slow really

#

Creating a Subscription is a pretty heavy operation

split monolith
#

req_Z4EB8ts7bHNnGk

#

well, update payment intent is also slow

bronze parrot
#

It looks like your create subscription calls are returning about as fast as normal. Your median calls are about as fast as the median for all calls to that endpoint, same with p90

#

Checking in to your intent update call

split monolith
#

is that possible to merge this 2 requests?
i mean, set payment intent data during subscription creation?

bronze parrot
#

Same with payment intent update calls, they are taking about the same time as the average.

#

I don't think setting the metadata is possible from the subscription call but I will double check

winged trailBOT
bronze parrot
#

Also it does look like we are experiencing some slower API calls around subscription creation at the moment and we are working to address that. I was looking at your overall call times over a longer period of time so there which may have smoothed over the issues that you are seeing now

split monolith
#

ok, thank you

bronze parrot
#

Also apologies for the delay but I did double check and confirm that you can't set payment intent metadata from the subscription creation call. It looks like updating the intents as you are is the best way to do that for now

split monolith
#

ok, understood