Web Development · Payments

How does Uber use the Braintree API to handle fare splitting?

Brennan Hoeting Intern Junior Developer at Infuse.us

February 6th, 2016

When doing research on payment splitting (e.x. a $100 bill split between 4 customers charges $25 to each customer's credit card), I find that there's little discussion on the implementation details, and that this is something that simply isn't done that often.  However, Uber clearly does this without a problem.  I know they use Braintree to handle payments, but there's nothing I found in their API docs that provides an "official" way to do this.

This is how I envision the process:
  1. Divide the total cost by # of users paying
  2. Separately charge each user that amount
  3. "Confirm" the transaction once each payment has successfully gone through
  4. Either eat Braintree's transaction cost, or tack it on to the total bill as a "split fee" (like Uber does)
It's a pretty obvious solution, yet I haven't seen anyone describe it like that.  Is it really that easy, or is there a lot that I'm missing?

Steve Everhard All Things Startup

February 6th, 2016

A comment on Sam's answer: It depends what service or product you are splitting the bill for, but shared services are normally consumed at one location. As sales tax and VAT are consumption taxes you only need to worry about the sales tax applicable to the location where the service or product was delivered. It isn't dependent on the origin of the payers or where the payment card was issued.

Sam Hermans Information Security | Risk Management | Founder at Lumturio.com

February 6th, 2016

Seems about right, the only thing is that instead of worrying about one charge back now you can have multiple.

Reading a bit about this with Uber you cannot split a bill afterwards, and there is always the 'primary' person who will get charged if the other payments fail.

No experience with Braintree but stripe charges 2.9% + $0.30 so I would do
((the amount + processing fee) / by number of people) + ($0.30 * number of people)

Depending on your payment provider there can be a difference in cost between processing visa and amex cards ?

Things can get *really* tricky if in EU bill is split over multiple people from other countries (other VAT rates) or US multiple states and tax is different per person ?

If possible would avoid that by using the primary person's details for amount calculation.

Another thing to keep in mind is that you will have to provide everyone with receipts and you cannot store all cards in a single account. This is probably the main reason Uber did this as it is a nice way to growth hack since all users need to create an account first in order to participate in the bill.

Good luck!