#pierre06-updating-sub-price
1 messages Β· Page 1 of 1 (latest)
Hey! Can you please share the ID of an API request where you're seeing this behaviour? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Hello ynnoj π prhaps this one : (ID of element of subscription) : si_KeDZkmDAiBvZpo
If it is not good where can I find this ID ?
Checking on it now
Does this request look like the issue you're seeing? https://dashboard.stripe.com/test/logs/req_h2Ipmt38O1lKQy
That's a request to the same Subscription ID you shared
Can you share the ID of the actual request? Form here: https://dashboard.stripe.com/test/logs
Looks like req_xx
Yes now I made a new request : price_1JyvWjHPTdlDaHhkgNqKIpDI / si_KeDy41R1ttMuhX
OK I'm in the log and the last request didn't made any error (but created a new line while I would like to update)
Ok, let me check
So when you're updating a subscription item, you need to provide the id parameter (https://stripe.com/docs/api/subscriptions/update#update_subscription-items-id) β looks like si_xxx. Otherwise you're just adding a new subscription item, with the Price object you passed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
See example here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
Very good, please could you show me how to put this id in : $stripe->subscriptions->update(
'sub_JbUh2dGdG2qVJd',
['metadata' => ['order_id' => '6735']]
);
I tried to put it a few ways but no one worked
my line which add is items[0][price] if I put items[0][price][id]Β it doesn't work
oups sorry it is in your example !
sorry one more time, let me try it
Something like:
$stripe->subscriptions->update(
'sub_JbUh2dGdG2qVJd',
[
'items' => [
[
'id' => 'si_xxx',
'price' => 'price_xxx'
]
]
'metadata' => ['order_id' => '6735']
]
);
Glad to hear it! π
Have a good day, bye !