stripe API - possible to combine multiple invoices into one payment? - stripe-payments

i have a use case where its possible for a user to accumulate multiple unpaid invoices with a stripe subscription (which would be marked as overdue). The only way i see to pay the invoices via the API would be to pay each one as a separate manual invoice payment (thus producing X lines items on a users credit card).
Is there any way to combine all unpaid invoices into one payment ?

It's not something that the Stripe API supports. The best solution would be to create a one-time charge for the total amount of all the invoices and then mark each invoice as forgiven.
You could also create multiple invoice items, one for each invoice with a clear description and amount and then invoice the list so that your customer knows what he's paying for.

From the Stripe docs, it suggests that you can batch multiple transactions together but only if the customer has a payment method saved (and it still may require some custom programming to get it working the way you want):
https://support.stripe.com/questions/batch-multiple-transactions-from-one-customer-into-a-single-charge
Stripe docs also offers this option as well, on combining multiple products into one subscription:
https://stripe.com/docs/billing/subscriptions/multiple

Yes, You can combine multiple invoices using pass stripe customer id in to
/Stripe/Invoices::retrieve({customer_id});
You can get all the invoice of the customer, you can also search date wise invoices using a function.

Related

Stripe Payment Links - promo codes for non-recurring Products

I have two types of products in my Stripe accounts - one which has a recurring payment model (subscription) and another which has a one time payment option. For both products, I am creating a Payment Link and providing 'allow_promotion_codes = true' on the creation call (docs: https://stripe.com/docs/api/payment_links/payment_links/create).
I have created a promo code / coupon which takes 100% off of the entire order - which is for admin/testing purposes only. This promotion code works just fine on the subscription/recurring products. However, when attempting to use the code for the one-time products, I get "The code is invalid" response.
Are promotional codes only applicable to subscriptions? Is there any way to use promo codes for one-time payment products via payment links? I would like to stick with the current model of providing payment links, hoping it's possible to add discounts to both types of products via payment links. Please do let me know if any code is needed to provide more context.
I created the coupon and payment links and the coupon in Stripe. The payment link only accepts the coupon for subscriptions and not the one-time payment products. I would expect the discount to be applied to all products.
It's expected behaviour mentioned in https://stripe.com/docs/payments/checkout/discounts
Checkout does not currently support discounting a purchase below the minimum charge amount for one-time payments.
Note : Payment Links is essentially Checkout under the hood

With Stripe, how to attach a single payment method created from Setup Intent API for multiple customers

With Stripe, how to use the payment method created from setup intent for multiple customers?
According tp the Create Setup Intent API, it only let us define one customer ID.
param name: customer (optional)
description of this param:
attached to the Customer on successful setup. Payment methods attached
to other Customers cannot be used with this SetupIntent.ID of the Customer this SetupIntent belongs to, ifone exists. If present, the SetupIntent’s payment method will be
TLDR
I want to let the same user to reuse same payment method to subscribe items with different presentment currencies,
I assume I should solve this requirement by directly creating multiple customer objects for a single user, and using create Setup Intent API to attach his/her same payment method for multiple "customer objects".
But, I am not sure if this is possible, therefore I welcome any recommendation for alternative approaches, such as using attach payment method to customers API, or any workarounds.
PS: Detail info (for why I am interested to ask this question)
Business requirement:
My business requirement is that customers have to subscribe to international services that must be presented with different presentment currencies. To makes thing even harder, each customer has to use the same list of saved payment methods to subscribe to services with different presentment currencies in the future. In other words, users should not have to re-enter card info again if they subscribe to items in different presentment currencies.
Limitation of the Stripe API:
Why not just use single customer object for subscribing to services (aka "price" objects) with multiple presentment currency?
I tried and it results in an error. According to this Stripe documentation, it indeed says that each customer can only be used for transactions in single currency.
If the user in my app want to subscribe to another service with another
currency, I need to create new "Customer" object in Stripe.
Why not just use /v1/payment_methods/:pm_id/attach api to attch payment method to multiple customer object?
Because according to this Attact payment method to customer API doc, Stripe does not recommend, yet I do not fully understand the risk of not performing any necessary steps as it warns. Therefore, it is just my risk averse instinct to avoid this.
To attach a new PaymentMethod to a customer for future payments, we
recommend you use a SetupIntent or a PaymentIntent with
setup_future_usage. These approaches will perform any necessary steps
to ensure that the PaymentMethod can be used in a future payment.
This is not supported. A payment method can only be consumed once if not attached, and attaching to a customer counts as a consumption. A PM can only be attached to a single customer, so you'll need to collect the payment details for each.
Stripe recommends using that customer's currency for all presentment to optimize for their experience, though that may not be suitable for all use cases.

Programatic shipping and taxes with Stripe Subscription

I would like to use Stripe for a physical subscription site.
Small number of SKUs
Some customers pick up instead of ship
Customers whose addresses are in one state are charged state and local sales tax
I'd like to use Stripe Subscriptions to do this but shipping costs and state/local taxes will be slightly different for every single customer and but unlike in the Stripe Orders API, it does not look like Subscriptions allows for me to dynamically calculate shipping and taxes. Is my reading of this correct, or is there a way for me to programatically edit recurring shipping and taxes on a per-subscription basis?
Thank you!
Answer via #mattwc in #stripe freenode: An invoice is created by the subscription each period 1 hour before it is charged. You can subscribe to this event via webhook and edit the invoice to add shipping and tax information.

Stripe payment splitting api

i need bit clarification and guidance from exports about splitting stripe payment between multiple sellers.
I am building e-commerce systen and integrated stripe as a payment method for customers and it is working fine. Now I don't want to pay to manually to my sellers registered on my platform. I want to split the payment between several accounts if possible.
Lets say my platform is charging 10% as commission to the sellers and the customer is buying to different items from 2 different seller that worth $1000 than I want to split the payment as follow internally
me $100
seller 1:$450
seller 2:$450
Any help or guidance will be appreciated thanks
Stripe as such does not provide the splitting mechanism. But using Stripe Connect you can do it.
In Stripe connect there is one main account called platform account and can have multiple secondary accounts connected to it. So in your case, your seller will connect with your platform account.
Now for every charge you can split the amount among the seller and platform using application_fee parameter in charge object.
But this method has one problem also
If the customer is purchasing from multiple sellers than you have to charge the customer many times(as no. of the seller). So in case of multiple items from different sellers I have used transfer API to transfer the amount to seller instead of multiple charging to customer
In my system, I also face the same problem and after a lot of research, I found this way working for me.

Can Stripe support Offline Payments?

I am using Stripe for online payments but also users can pay offline (cash or check). I want to centralize all my invoices/charges in one place (Stripe).
I am not sure if I can add offline payments (cash or check) to stripe or not. I guess I can if I created customers, invoices, charges with livemode=false for my live keys.
Is this feasible and will Stripe accept having some (customers, invoices and charges) with livemode=false and others with livemode=true?
If yes, should I fill fake credit card info or should I set it as nil?
Stripe does not allow you to create a Subscription on a Customer if you don't have a credit card setup. More accurately, it does not allow you to create a subscription if a customer does not have a way to pay for the next invoice. So for offline payments, you could update the 'account_balance' on the customer to have a negative value equal to the amount the customer wired (credits). Stripe will then allow you to create a subscription for the customer because it knows that the customer has enough account balance to pay for the next invoice. This post has more details.
We don't currently support offline payments, so you'll want to look at a separate accounting system for those payments.
That said, it's totally understandable that you'd want to keep this data in one place. You might be interested in using our webhooks system to offer live updates to your accounting system without directly touching the code that creates the charge in Stripe.

Resources