#edutomesco

1 messages · Page 1 of 1 (latest)

terse palmBOT
hazy fog
#

hello! i'm afraid i don't understand the question. Can you try rephrasing?

light tide
#

I can manage to do a downgrade

#

can't*

#

I have a subscription of 4 prices and then I operate a subscription update of 3 prices

hazy fog
#

alright, so when you update the subscription, what happens? do you get an error?

light tide
#

no error

hazy fog
#

do you have the request id for this downgrade?

light tide
#

what do you mean?

hazy fog
light tide
#

where can I found this?

#

it's an event that generates?

hazy fog
#

or do you have the subscription id? it'll look like sub_...

light tide
#

sub_1LsKl5G1fQyuUuzXot47dpFJ

#

I'm using the test clock functionality to recreate the test

#

This is my code

#

I did the invoice.GetNext() to know if it's an update or downgrade

#

When it's an upgrade I just do a sub.Update

#

if it's a downgrade I schedule the new subscription when it finalizes the actual

hazy fog
#

so did your application send out the request to get the upcoming invoice?

#

i.e. did invoice.GetNext run?

light tide
#

it should appear to the dashboard not?

#

but yes it works it pass and don't return any error

#

req_pQV5yRaa2hJgyx

#

I think this is the request you mean?

hazy fog
#

for context, invoice.GetNext() is a preview

#

it doesn't actually apply the update

#

so i'm a bit confused over what's the issue

light tide
#

Yes the update I did it before

#

after*

#

I think the next invoice it's not well calculated so I'm doing a downgrade so the billing price it's less than the actual so the GetNext() should have a total of 0 or less

#

sorry I see my error

#

Not it works I was passing an invalid parameter that I have internally to control

#

But there is something doesn't work correctly

#

if a subscription have 4 prices associated and I want to do a downgrade eliminating one price the invoice.GetNext() doesn't reflect that

hazy fog
#

do you have the invoice.GetNext request id where you downgraded by eliminating one price? I know that the response doesn't show for GET requests, but i would like to see the request parameters passed in

light tide
#

req_OoFtDYvjEOmaru

hazy fog
#

req_OoFtDYvjEOmaru is an update to the subscription though, it's not retrieving the upcoming invoice

light tide
#

I didn't found this event

#

where I should find on dashboard?

hazy fog
#

by default, the Dashboard logs only display requests for POST and DELETE :

#

you would want to include GET requests also

light tide
#

req_pAgweH0pw52xa7

#

here you are

#

as you see

#

I have 5 prices this is correct but the subscription still have 6 prices it didn't eliminate the price I want to unsubscribe

hazy fog
#

the request to GET /v1/invoices/upcoming is a preview. It doesn't apply the change to the subscription.
If you want to apply a change to the subscription, you need to update the subscription : https://stripe.com/docs/api/subscriptions/update

light tide
#

Yes and it's what I do

#

but didn't change

#

req_ja6qolTqmOKAgO

hazy fog
#

req_ja6qolTqmOKAgO is a GET request, what's the request id where you updated the subscription so that it only has 5 prices?

light tide
#

req_aHfSjSsqTC31z1

#

sorry here

#

"id": "price_1LomjLG1fQyuUuzXq5mMI8qp",

#

this price it's in the response and it's not passed in the request

neon pine
#

Hey, taking a look

light tide
#

I new to do an schedule to apply this change

#

I think it's the only solution

neon pine
#

How does the response from the preview (https://dashboard.stripe.com/test/logs/req_pAgweH0pw52xa7) differ the the invoice generated from the update call (https://dashboard.stripe.com/test/logs/req_aHfSjSsqTC31z1) ? Can you share the response?

#

(we don't log GET responses so I can't see it)

light tide
#

sorry I think it's more complicated

neon pine
#

Can you share the full JSON response from your upcoming invoice API call?

light tide
#

I mean, we are designing a billing model with addons and the customer have always the capability to add and remove this addons that are prices that we add and remove from the customer subscription

neon pine
#

There was an update call made on sub_1LsLrBG1fQyuUuzXbU21X9oJ which added the 6th item after https://dashboard.stripe.com/test/logs/req_aHfSjSsqTC31z1 : https://dashboard.stripe.com/test/logs/req_RTCSa10ZsJwQZg

#

Overall I'm just generally confused by what your expectations are as opposed to what the API is returning to you. Can you please outline that clearly with JSON responses as requested

light tide
#

Yes sorry let me review all of that and when I'm clear i contact, thank you

neon pine
#

np!