#nerder_subscriptions

1 messages ยท Page 1 of 1 (latest)

dense knollBOT
#

๐Ÿ‘‹ 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/1219683324600258591

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

gloomy yachtBOT
forest steppe
#

Hi ๐Ÿ‘‹

The error is correct. You cannot modify Subscriptions your Platform did not create

azure laurel
#

The error is quite clear, I just need to be pointed in the right direction here

#

Because my first instinct would be to ask the customer for their API key to do this

#

but might be not the best in terms of security

#

also one thing is not clear is that I'm indeed able to perform some update using the dashboard (while accessing the connected account from the platform)

forest steppe
#

Nope definitely not

#

Basically, those Subscriptions existed before your connection to this account so they cannot be modified to send money to you

#

If you want to add an application fee you need to create new Subscriptions

azure laurel
#

Ok, this is only because i'm attempting to add an application fee?

#

I'm trying to do this because in my webhook code I have this line:

    if (subscription.application === null) {
      this.logger.log('Skip! This event has not been triggered by our integration');
      return;
    }

This is exactly to prevent a mixup of subscriptions created independently by the connected account from the ones created by our integration

#

but in this case, what I'm trying to accomplish is to recreate in my DB all the existing subscriptions that a customer already has before being connected to us

#

another idea I have is to simply add a metadata to the subscription with a simple flag migrated: true

forest steppe
#

Okay and have you tried making that API request?

azure laurel
#

i'm doing it rn

#

amazing, that goes through

#

but this means that since now the account is connected, I'll be receiving all the subsequent updates as well?

#

as in each new customer.subscription.updated will now populate application?

forest steppe
#

That should not be the case as far as I know. Can you share the subscription ID and I can check.

gloomy yachtBOT
azure laurel
#

here: sub_1Ow4xULAVB3C1lDISD97vQ0M

#

I've done a couple of tests and it seems that if I trigger an update from the connected account dashboard (not using the "view as" dashboard, but directly) the application is not null

west haven
#

๐Ÿ‘‹ hopping in here since snufkin has to head out soon

azure laurel
#

it costs me nothing anyway to also check for that metadata i've just added to be extra safe

west haven
#

Just to confirm - you're asking whether application will continue to be set on that Subscription, right?

azure laurel
#

exactly

dense knollBOT
#

nerder_subscriptions

azure laurel
#

after i've done an update using my integration and added a metadata to it

west haven
#

Yeah, that should continue to be set

azure laurel
#

This is great, so it means that just by setting the metadata I can be sure that now the subscription will go though my integration and my webhook will not skip it

#

I think this is solved