#kostas-sioupoulis_code

1 messages ยท Page 1 of 1 (latest)

gloomy gulchBOT
#

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

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

elfin summitBOT
bright spear
#

The upcoming invoice calls are mutually exclusive. So back to back calls shouldn't really make any difference in the price you're seeing in the latter API calls.

wary mortar
#

So it wouldn't affect the next one?? Is there maybe something I need to (clear) from the subscription after I callled the invoice.upcoming function?

bright spear
#

Not really. Negative amount is usually credits for unused time.
Can you share an example response where you're seeing this along with the request body?

wary mortar
#

it's a bit long but yes I can

#

for some reason the interval of the plan is month in the invoice

#

Although it should be annual for my subscription

bright spear
#

Yeah the negative amount is credit for the previous year month I think

"amount_excluding_tax": -323696,
"currency": "eur",
"description": "Unused time on Encrypted Vault after 03 Apr 2024",```
wary mortar
#

Or maybe that is where the mistake is.

bright spear
#

Can you elaborate what you mean by that?

If you loook at the subscription data > price > interval

#

it's monthly

#

are you saying it should be a yearly sub?

#

Subscription object shows current period start date as April 3, 2024 12:19:28 PM GMT and end date as May 3, 2024 12:19:28 PM GMT

So it is a monthly subscription.
Are you trying to update it to a yearly sub?

#

Seems like it as the second line item is

          "active": true,
          "billing_scheme": "per_unit",
          "created": 1712149201,
          "currency": "eur",
          "custom_unit_amount": null,
          "id": "price_1P1TQ5IqJXTh2k1UgsOfEo5N",
          "livemode": false,
          "lookup_key": null,
          "metadata": {},
          "nickname": null,
          "object": "price",
          "product": "prod_PrB824jlD5Drfb",
          "recurring": {
            "aggregate_usage": null,
            "interval": "year",
            "interval_count": 1,
            "trial_period_days": null,
            "usage_type": "licensed"
          },
          "tax_behavior": "unspecified",
          "tiers_mode": null,
          "transform_quantity": null,
          "type": "recurring",
          "unit_amount": 378000,
          "unit_amount_decimal": "378000"
        },```

So you have a monthly subscription that you're charging `324000` (in cents) each month and you're updating it to `378000` (in cents) yearly
wary mortar
#

When I update it I mistakenly change it to a monthly form a yearly subscription

#

So that's why the problem occurs probably

bright spear
#

When I update it I mistakenly change it to a monthly form a yearly subscription
I don't know what you mean by that. I looked up the subscription object and it is currently a monthly subscription

You're trying to update it to a yearly sub no?

wary mortar
#

It was initially a yearly subscription

bright spear
wary mortar
#

And I mistakenly had hardcoded to change it to

#

Yes indeed so it should be all good now