#bloemy_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ 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/1278921986281705495
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, so you want to keep the most of the funds and only transfer a fraction to the seller?
hey Jack - I have a second question I'll post in the thread already but we can answer it after - appreciate your help here!
Yes that is exactly it, I only want to transfer a fraction, say 10, 15%
(Second question - can answer after)
Got a second question. I initially built my Stripe webhook to listen to invoice.paid, invoice.payment_failed, customer.subscription.updated and customer.subscription.deleted
Initially everything was paid by credit card only, and so my main logic is based on invoice.paid - i.e whne someone pays, I move their subscription expiration date forward.
The problem is I have now started accepting more and more manual invoices for larger payments, and this has created an issue: when I issue a manual invoice for a subscription, that account's subscription doesn't get moved forward since the invoice did not get paid yet.
WHat is the best practice around this? What event should I actually be using?
https://docs.stripe.com/connect/destination-charges?platform=web&ui=stripe-hosted&fee-type=transfer-amount you can specify a transfer_data[amount] which is the funds that your connected account will receive. For example, if the payment is $100, you can set transfer_data[amount]=1000 to keep $90 for yourself and $10 for the connected account
For invoices paid outside of Stripe, you can call the pay invoice API with paid_out_of_band to true https://docs.stripe.com/api/invoices/pay?lang=curl#pay_invoice-paid_out_of_band
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So does transfer_data[amount] work on subscriptions? Because these are not one time payments, these are all subscriptions I use
as for the invoice API, yes, I am already marking them as paid, but here is the thing: when I issue an invoice it might only get paid 20 days from now. In the meantime they should already have access to my platform though, and I don't want to have to manually mark it as padi before they paid, because then I lose all track of the payments
https://docs.stripe.com/api/subscriptions/create?lang=curl#create_subscription-transfer_data-amount_percent the equivalent for subscription is amount_precent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So you don't want your user to use your service until the invoice is paid?
yes I do want them to be able to use it, that's the point - I basically need to already automatically move them forward even before they paid, but I ened to find the right webhook event for this
and thanks for amount_precent!!
and with a subscription, is there a way to do a one-time payment only? i.e at first payment only?
Third question (last one I promise :D), we are starting to support multiple countries now, but we want pricing to be in local currency. What we saw is that you then get charged an extra fee for conversion back to USD. For instance if we will get Australian customers, is there a way to avoid that fee if we are happy to keep AUD in a bank account, or do we need to simply create a new Australian based Stripe account?
thanks a lot !
and with a subscription, is there a way to do a one-time payment only? i.e at first payment only?
If you want to add a one-time payment when creating the Subscription, you can do it here https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
when I meant one time payment I meant a percentage of the first payment of the subscription to go to a reseller. E.g my sub is 1000$ a year, and I want 100$ to go to my reseller, but only the first year
Could I set amount_percent to 10% and then move it to 0% after the first payment? would that do the job?
as for the invoice API, yes, I am already marking them as paid, but here is the thing: when I issue an invoice it might only get paid 20 days from now. In the meantime they should already have access to my platform though, and I don't want to have to manually mark it as padi before they paid, because then I lose all track of the payments
Earlier you mentioned that you issue a manual invoice for a subscription - can you share an example to illustrate what you're doing specifically?
Sorry, I just mean that I basically create a subscription, but instead of charging a card, I choose to generate an invoice for them to pay
The invoice gets sent to their email and they pay by bank transfer - sometimes through Stripe, sometiems out of band
But it is net 30 so they have 30 days to pay
ah, so you mean you use collection_method="send_invoice"?
yes !
gimme a while to test it out
thanks!
if you're using collection_method=send_invoice, i think the way to go about it is to listen for the subscription status changes instead. If the subscription status is active, you would provision services, if the subscription status moves to unpaid then you shouldl stop provisioning services. There are settings in the Dashboard that allow you to configure what the Subscription status should move into after it is past due.
I think this page gives a good sense for what to use each Subscription status for : https://docs.stripe.com/billing/subscriptions/webhook
hey, thanks. The link does not work, but that does make sense overall, if I can rely on that
oh bah, sorry it was missing an s
awesome perfect. That should do there! Now just wondering about #1278921986281705495 message and #1278921986281705495 message
when I meant one time payment I meant a percentage of the first payment of the subscription to go to a reseller. E.g my sub is 1000$ a year, and I want 100$ to go to my reseller, but only the first year
Could I set amount_percent to 10% and then move it to 0% after the first payment? would that do the job?
My recommendation here is to listen for the invoice.paid event : https://stripe.com/docs/billing/subscriptions/webhooks#events and check. the billing_reason : https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason. The first payment for a subscription is subscription_create - you would then create a Transfer : https://docs.stripe.com/api/transfers/create (remember to include source_transaction) for the amount you want to transfer to the connected account
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that makes sense - much easier. Thanks.
we are starting to support multiple countries now, but we want pricing to be in local currency. What we saw is that you then get charged an extra fee for conversion back to USD. For instance if we will get Australian customers, is there a way to avoid that fee if we are happy to keep AUD in a bank account, or do we need to simply create a new Australian based Stripe account?
going through this question now ๐
you're a US platform?
yes US
for Canada we ended up creating a separate Canadian account because we were accepting CAD payments on US but we were being charged so much. It seems like for a US account you can't have secondary bank accounts...
assuming that you are a US platform - yes, the only option is to create a new Autralian based Stripe account.
AU (and a few other countries) Stripe accounts have the option to accept alternative currency payouts (some other currencies). US Stripe accounts unfortunately can't do so at the moment.
See https://docs.stripe.com/payouts/alternative-currencies and select the country
Ok, thanks for clariyfing. Much appreciated. And is there a good way to manage if I just want to use one webhook for all of my multiple Stripe accounts, if we're going to have one per country? Currently for Canada nad US the way I do it is I try to do constructEvent on the signature with both my US and Canadian key, but that doesn't seem like a scalable solution
add a query parameter to your webhook URL and then use the appropriate key to check the signature?
e.g. ?country=US
ohhh you're able to do that?! jeeeez that's nice. Thanks !
I mean yeah, makes total sense lol
your server should be able to handle this