#kmbro-app-fee
1 messages · Page 1 of 1 (latest)
I have tried setting it to "null" which returns "Invalid decimal:"
I have tried undefined, which does nothing to the application_fee_percent, it stays the same as it was before
I tried 0 but it doesn’t actually remove the %fee
@dense trench taking over here. Give me a few minutes to test this on my end
Thanks!
@dense trench are you using transfer_data.amount_percent or application_fee_percent?
I am actually trying to migrate away from transfer_data.amount_percent to use applicatoin_fee_percent
Because you can only have one of either application_fee_percent or transfer_data.amount_percent I am trying to unset the transfer_data before I then set the transfer_data.destination again and then set the application_fee_percent.
But I cannot do this.. because if an application_fee_percent already exists, you cannot unset the transfer_data. Which basically puts me in a chicken and egg problem..
so.. I think I am going to have to do a "get" on the subscription FIRST before any of this and see which it has set, remove transfer destination if application fee isn't set, and then set it.
Ahhhh okay. What language are you using?
And what API version are you on?
I was able to unset it using an empty string. Can you try that and see if it works?
I was able to unset it using an empty string. Can you try that and see if it works?
This should unset the value for you
ah i didn't try a string bc it is a number. I'll check
You have to pass the empty string into transfer_data, not transfer_data.amount_percent
oh yeah I got that part.
Apologies, I just saw this
But I cannot do this.. because if an application_fee_percent already exists, you cannot unset the transfer_data. Which basically puts me in a chicken and egg problem..
the next weird part is when I try and do the same logic (e.g. unset transfer_data completly then set it with just the destination, and add an application fee) on a subscriptoin that already has an application_fee_percent set, it fails bc you cannot unset transfer_data if there is an applicatoin_fee_percent
Let me dig a bit more
So this is definitely a limitation of the API. IMO you should be able to unset application_fee_percent and update the destination account, but right now (even if you set it to 0%), the API disallows it. I can reach out to the product team to request they update it, but in the meantime are you able to recreate the Subscriptions instead?
i suppose I could recreate it -- all of this is currently in dev enviorment. trying to figure out the right way to migrate over to application_fee.
I think for now, I'll just do a get on the subscription and check if application_fee_percent is set, if it is, I'll just update it, if it isn't I'll unset the transfer_data, and then set it all like I want.
Thanks for the help on this!
(I do agree however, not being able to unset something kind of breaks the API model)
Alright awesome! Let me know if you run into any other snags