#napolean-solo_api

1 messages ¡ Page 1 of 1 (latest)

storm coyoteBOT
#

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

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

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.

modern swift
#
  1. Yes, we don't enforce uniqueness
  2. Their invoices will remain open and payable AFAIK
twin osprey
#

wait can you elaborate on the 2, I don't mean subscription, I mean the customer itself.

modern swift
#

What specifically do you want to know?

#

Did you try it out yourself?

twin osprey
#

Nope, just wanted to know cause I have organization feature in my app and I want users to be able to delete the organization and the stripe customer associated with that organization.

I think it is just better to delete the org in my db but not delete the stripe customer

storm coyoteBOT
twin osprey
#

what do you suggest? It's a better approach right?

rare lark
#

hi! I'm taking over this thread.

#

can you share more details on what you mean by " if a customer has pending usage bill"? are you using Subscription with usage based billing?

twin osprey
#

yes

#

I mean there are some events in usage meters

#

and I want to delete the organization from the database

#

I think it's a better logic to not delete the customer froms stripe right?

rare lark
#

what do you mean by "organization"? are you talking about the Customer object?

twin osprey
#

yes in my app user's can create organization that will have its own seperate customer object

#

and they can delete it too

#

so for deletion i think it's better not to delete the customer object from stripe right?

rare lark
#

so for deletion i think it's better not to delete the customer object from stripe right?
that's completely up to you. I don't know your use case well enough to know if you should delete the customer or not

#

but I recommend doing some tests in test mode to see how exactly that works

twin osprey
#

alright

twin osprey
#

I had one more query,

When a user has credit_grant, and an invoice is created, when do the grants apply? Is it during invoice creation or after it is finalized?

rare lark
#

Credits apply to invoices only at the time of finalization. If you apply credits to a preview or draft invoice, those credits might change if a finalized invoice uses them first.

twin osprey
#

ok but what if the amount_due is still > 0?

rare lark
#

I recommend doing some tests in test mode, that's the best way to see how exactly this works.

twin osprey
#

okay

#

Customers can have up to 20 unused credit grants at a time. If you issue a credit grant after this limit, the request fails with an error message stating the max limit. A credit grant is unused if it has a future effective date or a positive balance.

What do they mean by 20 unused credit grants?

#

like users can only topup 20 times?

rare lark
#

if you call stripe.billing.creditGrants.create() 20 times in a row for the same customer it will works. if you call it one more time you'll get an error message.

twin osprey
#

that makes no sense, what if someone has prepaid billing like me, customers should ideally be able to topup as much as they want

storm coyoteBOT
green heath
#

@twin osprey you can always void credit grants and create new ones with the sum of the 2 amounts

twin osprey
#

alright

green heath
#

this is currently a limitation and we don't really know when/if it's going to change