#starky_api

1 messages ¡ Page 1 of 1 (latest)

keen zealotBOT
azure tangleBOT
#

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.

keen zealotBOT
#

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

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

stone rain
#

Hello

#

Sounds like you created the Tax Rate on your platform?

carmine hearth
#

hello. I am trying to configure the tax_rate for our API but seems there is something wrong. In one of our connected accounts (German branch) we created two tax_rates because sometimes some of our services have VAT others doesn't (medical services), but it does not recognise it in the API.

stone rain
#

Do you have a request ID for the error you see?

carmine hearth
#

Connection id "0HN3BH2TGSGBG", Request id "0HN3BH2TGSGBG:00000003": An unhandled exception was thrown by the application.
2024-05-03T16:05:30.2225121Z Stripe.StripeException: No such tax rate: 'txr_1PCMIBIzpFSlCKHNC7uLjgi4'
2024-05-03T16:05:30.2410072Z at Stripe.StripeClient.ProcessResponse[T](StripeResponse response) in /_/src/Stripe.net/Infrastructure/Public/StripeClient.cs:line 153

stone rain
#

Hmm there should be a request ID like req_xxx

carmine hearth
#

No, because the code makes error when making the request?

stone rain
#

There still should be a request ID

carmine hearth
#

when I go to logs are not even logged, just the message above on the console of the server.

stone rain
#

Hmm well first off, it should be txr_1PCMIBIzpFSlCKHNC7uLjgi4 with an underscore

#

Are you manipulating the ID?

carmine hearth
#

No! I am sending it like this:

var subscriptionOptions = new SubscriptionCreateOptions
{
Customer = customer2.Id,
Items = new List<SubscriptionItemOptions>
{
new SubscriptionItemOptions
{

                        PriceData = new SubscriptionItemPriceDataOptions{
                            UnitAmount = int.Parse(body.Amount),
                            Currency = body.Currency,
                            Product = "prod_PnBFGQK88bHIwm",
                            Recurring  = new SubscriptionItemPriceDataRecurringOptions{
                                Interval = body.Interval
                            },
                        },
                        TaxRates = new List<string>(){
                            body.VAT == "19" ? "txr_1PCMHtIzpFSlCKHNlyL0IgAU" : "txr_1PCMIBIzpFSlCKHNC7uLjgi4"
                        }                           
                    },
                },
                PaymentSettings = paymentSettings,
                PaymentBehavior = "default_incomplete",
                ApplicationFeePercent = 3,
                Metadata = new Dictionary<string, string>(){
#

where there is a condition if the tax is 19% or 0 to choose between the applicable tax.

stone rain
#

You want to be creating the Subscription on the Connected Account here, yes?

carmine hearth
#

yes, basically we (the main branch) act as platform and our branches act as service providers who hold the subscriptions.

stone rain
carmine hearth
#

yes exactly!

stone rain
#

So that tax rate was created on acct_1OttMdIzpFSlCKHN however you are trying to create that Subscription on acct_1P1lTAII0FUqpRgj

#

So sounds like you have your accounts mixed up

#

You need to have the Tax Rate created on the account where you are creating the Subscription

carmine hearth
#

Ahh!! but then there is something wrong.

I am passing it like this:

        var requestOptions = new RequestOptions
        {
            StripeAccount = Environment.GetEnvironmentVariable("stripe_germ"),
        };

and then creating the subscription like this:
};
subscriptionOptions.AddExpand("latest_invoice.payment_intent");
var subscriptionService = new SubscriptionService();
Subscription subscription = subscriptionService.Create(subscriptionOptions, requestOptions);

stone rain
#

Hmm nah it seems that you are creating the Tax Rate via the Dashboard, no?