Skip to content
Developers

Splitting a bill

You create one payment for the whole bill. The people paying split it, on the pay page or in the Spleetz app: you don’t divide it up yourself. You hear about each step by webhook, and the bill’s own payment.succeeded comes once it is paid in full.

When the first payer opens the bill and chooses to split it:

  • By shares. The bill is split into a number of shares. Each person takes one and pays it. The number of shares can change while it is being paid (split.resized).
  • By items. Only if you sent the order’s lines: each person claims what they had, down to one of several of the same item (“2 of 3”), and pays for that.
  • As a group. Someone in the Spleetz app can pay with a group they already have there, one share per person.

Each person pays their own share their own way. If one person’s card is declined, the share is owed again: they can try again, or someone else can cover it, until the bill’s deadline.

The business chooses, in its settings, when shares are taken:

  • Once every share is in (the default). Cards are authorised as each share is paid, and the money is taken from all of them when the last share is in. If the bill isn’t covered by its deadline, the holds are released and any card already charged is refunded. While shares are coming in, the bill can show Authorized.
  • As each share is paid. Each share is taken the moment it is paid and kept, even if the bill is never paid in full. This suits trips and events paid ahead. The business must publish a cancellation and refund policy to use it.

Either way, the bill’s payment.succeeded is sent once, when the bill is paid in full. You don’t get payment.* events for each share; you get split.share_paid.

Send items with the payment to let people split by what they had. The lines, plus taxMinor and serviceChargeMinor, less discountMinor, must add up to amountMinor, or the payment is refused with 4012.

{
"amountMinor": 6380,
"currency": "GBP",
"reference": "order-1042",
"items": [
{ "name": "Margherita", "quantity": 2, "unitPriceMinor": 1150, "totalMinor": 2300 },
{ "name": "Lasagne", "quantity": 1, "totalMinor": 1450 },
{ "name": "House red, 500ml", "quantity": 1, "totalMinor": 1900 },
{ "name": "Olive oil", "quantity": 0.25, "soldByMeasure": true, "totalMinor": 150, "modifiers": "to take away" }
],
"serviceChargeMinor": 580
}
Item field
name Required, up to 200 characters.
quantity How many. A whole number can be claimed one at a time; anything else is claimed as a whole.
soldByMeasure The quantity is a measure, such as litres or kilograms: the line is claimed as a whole.
totalMinor The line’s total as charged, modifiers included, before order-level tax, service and discount.
unitPriceMinor Optional. Shown to the payer; never used to work out the total.
sku, externalId Optional. Your own ids for the line.
modifiers Optional. Shown under the item, such as “no ice, extra shot”.

Up to 200 lines.

Listen for these on your webhook endpoint. Each carries the bill’s transactionId, reference and metadata, so you can match it to your order.

Event When
split.started The bill was split, by a payer or for a group.
split.member_joined Someone joined the group the bill is split between.
split.share_claimed A payer took a share and is about to pay it.
split.share_paid One share was paid.
split.resized The number of shares changed.
split.deadline_extended The bill was given longer to be paid.

The body describes the bill and how far it has got: amountMinor, paidAmountMinor, sharesTotal, sharesPaid, the split’s status (Pending, PartiallyPaid, FullyPaid, Expired or Cancelled) and paymentDeadline. Events about one share carry it under share, with its shareId, amountMinor, paidAmountMinor, status and paidAt. split.resized and split.deadline_extended carry the values before and after in change. Shares never name who paid them. See Webhooks for the full shape.

On the payment itself, isGroupSplit is true once the bill has been split.

A refund of a split bill is spread across everyone who paid, in proportion to what each paid. To refund one person’s share instead, pass its shareId from the split events as legId. See Refunds.