#.buddhaha

1 messages · Page 1 of 1 (latest)

ripe zealotBOT
#

Hello .buddhaha, we'll be with you shortly! 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.
.buddhaha, 1 day ago, 10 messages
.buddhaha, 1 day ago, 11 messages
.buddhaha, 2 days ago, 47 messages
.buddhaha, 3 days ago, 17 messages

thin hinge
#

Cool. Thanks!

frozen coral
#

Could you please share the Subscipriton id ?

thin hinge
#

Yes sir! si_OtbfpP5y8VxP8B

#

I come prepared today 😎

frozen coral
#

The price currency used is USD

#

Could you share the link to the dashboard page showing SEK ?

thin hinge
#

In the customers' portal it also says SEK (which it should, its good, but I want it when fetching the subscription programatically too)

frozen coral
#

Ok, so the default currency of the price is USD.

thin hinge
#

yeah

frozen coral
#

The Subscription currency is SEK.

thin hinge
#

yes

frozen coral
#

So when fetching the price via the API, you need to refer to the SEX currency option

#

And refer to the SEK option

thin hinge
#

I'm not fetching the price object per se, I'm fetching the subscription

#

I just want to summarize and present the total price for the subscription

#

something in the lines of:

        customer: customerId,
    });
    let totalPrice = 0;

    subscriptions.data.forEach((subscription) => {
        subscription.items.data.forEach((item) => {
            totalPrice += item.plan.amount * item.quantity;
        });
    });```
#

Is there a better way to do this then? Otherwise I guess I'll have to fetch each price individually, expand currency_options, and refer to currency_options per price. But it seems like a long route to just fetch the total amount.

frozen coral
#

Is there a better way to do this then? Otherwise I guess I'll have to fetch each price individually, expand currency_options, and refer to currency_options per price.
Yes that how you should do this

#

Because you are using currency options

thin hinge
#

☠️

#

Okay mister, I'll do that then

#

Thanks for your help. I appreciate you ❤️