#patr0la_api

1 messages ¡ Page 1 of 1 (latest)

supple pivotBOT
#

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

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

wise hillBOT
#

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.

wraith light
#

Yes, it sounds like you're making a lot of changes to a subscription during a billing period so multiple proration items are to be expected

signal jetty
#

Yes, but I am not updating current period of subscription schedule - it is staying the same.

Unless that shuold be done differently?

this is my code:

var currentPhaseItems = subscription.Items.Select(item =>
                new SubscriptionSchedulePhaseItemOptions()
                {
                    PriceData = new SubscriptionSchedulePhaseItemPriceDataOptions()
                    {
                        Currency = "eur",
                        UnitAmount = item.Price.UnitAmount,
                        Product = item.Price.ProductId,
                        Recurring = new SubscriptionSchedulePhaseItemPriceDataRecurringOptions()
                        {
                            Interval = "month",
                        }
                    },
                    Quantity = item.Quantity,
                    Metadata = item.Metadata,
                })
            .ToList();
#

Prices and products are the same

#

is there additional Id that has to be included?

wraith light
#

Can you share an example invoice/subscription ID with more items than you expected?

signal jetty
#

I have lots of jul 23-aug23 which should not be here

wraith light
#

What is the ID of that invoice or subscription?

#

in_123 or sub_456

signal jetty
#

sub_1PfiW0RudJuKLsDet4Uyd2nw

#

this is my subscription update: req_3cSOyt55Mb87X9
its good - creates a good invoice only for "upgrades"

#

req_nBvhlfN6GcjnsB - creating susbcription schedule from subscription

req_JSKqQ1LFFtHtT2 - updating schedule with same current phase and next phase "downgrades"

#

aug23-sep23 part of invoice is good, its only this current phase that seems wrong

wraith light
#

Ah, the issue is req_JSKqQ1LFFtHtT2

#

You're using price_data so this is behaving like you are changing the prices on all the current phase items and prorating with net zero

#

When doing this update, you need to provide the price_123 on the existing phase items, which was automatically generated froyour initial price_data

signal jetty
#

oks, will try it

#

perfect

#

works

#

tnx!