home Home / When a Coffee Robot Takes Payment but Fails to Deliver the Drink

When a Coffee Robot Takes Payment but Fails to Deliver the Drink

The customer has been charged. The cup is not there. In front of you stands a person holding a phone, a payment notification on the screen, an empty dispense bay, and no way to get their money back without your involvement. Whatever you say next determines whether this is a two-minute inconvenience or a complaint with the card issuer attached.

Concept diagram comparing payment and dispensing events before transaction reconciliation.
Concept diagram comparing payment and dispensing events before transaction reconciliation.

The interesting part of this failure is that it is not one failure. It is two, running on two separate clocks. The payment world completed its transaction at 12:41:06 and considers the job done. The dispensing world reached 40 percent of the sequence at 12:41:22 and then stopped. Neither system is wrong. Neither system knows about the other's state. And the question that decides what happens to the customer is whether your operation has a way to bring those two records back together.

That is what this article is about. Not payment integration in general, and not a review of point-of-sale features. It is about the specific reconciliation you need to be able to perform when money moved and the drink did not, and what to require of the machine before you accept it.

Draw Two Timelines for One Purchase

Start by writing down what actually happens during a successful purchase, in two columns, with timestamps.

The payment column has states: cart or selection, authorisation requested, authorisation returned, capture or settlement later, receipt issued. Some of these happen in milliseconds and some happen hours later, and they are not all your concern. What matters is which state means “this customer's money is committed.”

The dispensing column has its own states: order queued, recipe loaded, grind and extract, milk or plant-based product dispensed, cup presented, order complete. These take tens of seconds and they can fail at any step.

Now align them, and notice that the alignment is not fixed. There is a window in which money is committed and the drink does not yet exist, and that window is where every problem lives. It is not a design flaw to be eliminated. It is the necessary cost of taking payment before making a perishable product. You cannot make the window zero, but you can decide how wide it is and what you can see inside it.

The width of that window is a purchase decision. A machine that authorises at selection and captures only on completed dispense has a different exposure from one that charges on tap and dispenses afterwards. Neither is automatically right. A shop with high throughput wants the fastest possible confirmation; a shop that cannot afford to refund often wants the charge tied to delivery. The point is that nobody specifies this in the tender, and then everybody is surprised at the failure rate.

Draw the timelines for the failures too, on the same axis. Payment succeeded, dispense failed at the milk stage. Payment succeeded, dispense completed, cup not detected. Payment succeeded twice, dispense once. Payment failed, dispense ran anyway. Each of these has a different state at the moment the customer looks at you, and a different correct response.

This document is worth making before you buy, because it becomes the specification for what the machine has to log and what your counter staff need to see. If you cannot name the states, you will accept a machine that shows you a green tick and nothing else.

Identify the Moment That Creates a Charge

The word “charged” covers several different events, and the difference decides what you can reverse and how fast.

A card authorisation is a hold. Funds are reserved, not taken, and an authorisation that is never captured will typically release on its own after a period set by the issuer, which you do not control and cannot state to a customer. A capture is the movement of funds. A settlement is when it reaches your account. A refund is a new transaction in the opposite direction, and its speed depends on the issuer and the payment method, not on you.

For the customer standing in front of you, all four look identical, because their banking app shows a pending line the moment authorisation happens. This is why “we haven't actually charged you yet” is a technically accurate sentence that will not help you. From their side, money left.

The practical consequence is that you need to know, for your specific configuration, which state the machine reaches before dispensing starts. Ask the supplier to state it, then verify it in the test environment, because the answer determines your recovery options. If the machine captures before dispensing, a failed dispense means a refund you have to initiate. If it captures after, a failed dispense means a void or an authorisation that expires, which is easier operationally but produces a scarier-looking screen for the customer.

Payment service providers document how retries behave, and it is worth reading one of those documents closely, as an example of the problem rather than as a description of your machine. Stripe's documentation on idempotent requests, for instance, describes what happens when the same request is sent twice: with an idempotency key, the retry returns the saved response instead of creating a second charge. That is a specific vendor's design. It tells you such a mechanism exists and what it protects against. It does not tell you what your coffee robot does, and a supplier who says “we handle idempotency” without naming where in the sequence the key is applied has told you very little.

Adyen's documentation exposes a different set of details worth knowing exist. Their idempotency keys are stored at the company account level, valid for a bounded window, and they warn that requests to different regional endpoints are not checked against each other for duplicates. Their documentation also describes returning a specific error when a duplicate request arrives while the first is still processing. Read as a class, these documents make one thing clear: retry safety is not a property of a payment system in general, it is a property of a particular integration, and the details are where double charges come from.

What to bring to the supplier conversation. Ask where the idempotency boundary sits: at the order, at the payment intent, at the dispense command. Ask what the machine does if the payment call times out and the operator presses the button again. Ask what it does if the network drops between authorisation and dispense. Each of those has an answer in the code, and the answer is what you are buying.

Test Failures on Both Sides of Dispensing

The test plan most buyers run is a happy path. Order, pay, get coffee. It proves the machine works when nothing goes wrong, which is the one case you did not need to test.

Related reading: order-state reconciliation in robot integrations.

Build the failure matrix instead, and put the failures on both sides of the dispense boundary.

Payment side failures: declined card, expired card, insufficient funds, network timeout at authorisation, duplicate tap, payment succeeded but callback never arrived at the machine. That last one is the underrated case, because from the payment provider's side the transaction is complete and from the machine's side nothing happened. It produces exactly the state this article is about, and it happens without anyone pressing anything twice.

Dispense side failures: grinder jam, milk or plant-based product run out mid-drink, cup not detected, cup dropped, dispense head blocked, power interruption mid-sequence, door opened mid-sequence.

Then the combination cases, which is where the real behaviour shows up. Payment succeeded and dispense failed at step three. Payment succeeded, dispense succeeded, and the machine reported failure. The reverse also happens: the machine reports success and the cup is empty because the product line was air-locked.

For each case, record what the customer sees, what the machine's log says, what the payment record says, and what the staff member has to do to resolve it. Write them as four lines against each row of the matrix, not as a paragraph, because the comparison between them is the point. If any of the four is missing for any row, that row is a hole in your operational readiness, and you have found it for the price of an afternoon rather than a bad review. The two that hurt most when absent are the customer-visible state and the payment record: without those, nobody at the counter can tell whether money moved, and the only recovery path left is the card issuer.

Run these in a test mode with real test transactions, not with a simulator that returns success. Some payment providers offer test environments that behave differently from production at exactly the points you care about, particularly around timeouts. Where a test environment cannot reproduce a failure, ask the supplier how they would reproduce it, and treat “we cannot” as an answer about their test coverage.

Then do the one test that most teams skip: power loss during dispense, then restore. What does the machine believe happened? Does it retry the dispense, does it report failure, does it show the customer a completed order? A machine that resumes dispensing into a cup that is already half full has created a spill; a machine that silently marks the order complete has created a customer who paid for nothing and a staff member with no record.

Reconcile Before Retrying an Uncertain Sale

The instinct when a sale looks failed is to try again. Retrying before reconciling is how duplicate charges happen, and it is the single most common operational error in this space.

Related reading: robot event logs and export access.

The rule is: establish the state of both records before any new action. Not “the machine says error,” but what the payment record says and what the dispense record says, read independently, before anyone presses anything.

That requires two things from the machine. First, that both records exist and are visible at the counter. Second, that they carry the same identifier, so they can be tied together. If the payment record has one reference and the dispense log has another and there is no link, reconciliation is manual archaeology.

Where the state is uncertain, the correct action is to hold, not to retry. Hold means telling the customer the order is being checked, giving them something to hold onto (the next section is about this), and resolving it from the record. Retry means creating a second transaction in a world where the first may have succeeded. When you are unsure which happened, the option that cannot create a duplicate is always the better one.

There is a version of this that requires a decision before the machine is installed: what the staff are authorised to do, and what they must escalate. If the counter staff can issue a refund on the spot, then the failure is contained. If every refund needs a manager, then the failure is a queue. Decide this in advance, write the authority level into the procedure, and make sure the machine's interface supports it, because a refund the staff cannot process is a refund the customer will pursue through their issuer.

A word on the dispute side. Card disputes, sometimes called chargebacks, are raised when a cardholder disputes a transaction with their issuer, and “goods or services not received” and “the same transaction charged more than once” are both standard grounds. That is not specific to any provider; it is the structure of the card dispute system. The important detail for you is timing: the window in which you can respond to a dispute is set by regional rules and by the payment method, and it is not the same everywhere. Do not build a policy around a number you saw on one provider's page. Know the window that applies to your acquiring arrangement, and know it before the first dispute arrives, because a dispute you do not answer in time is a dispute you have conceded.

Give the Customer a Recoverable Reference

The customer's problem in the moment is not that the machine failed. It is that they cannot prove what happened.

Fix that with a reference they can carry away. A receipt-level identifier that can be used, later, by someone who was not standing there, to find both records. Not an order number shown on the screen for four seconds. Something the customer has in their hand or on their phone.

What makes a reference recoverable: it maps to a single transaction, it can be looked up by your staff without the customer present, it carries a timestamp, and it is short enough that a person will read it out over the phone accurately. A long character string on a small receipt is technically unique and practically useless for a customer reading it aloud. Where verification matters, a short code plus the transaction time is usually enough to locate the record.

Design the failure receipt deliberately. When the dispense fails, the machine should issue something that says what happened and what to do, rather than nothing or a generic error. This is a communication artefact and it is worth specifying: the failure receipt should state the amount, the time, the order, and a next step. A customer with that piece of paper is a customer who waits. A customer with nothing is a customer who calls their bank.

Decide the messaging, and keep it inside what you actually know. “You have not been charged” is only true if the machine captures after dispense, and only after you have reconciled. “We will refund you” commits you to a timeline you may not control, because refund speed depends on the issuer. The safer phrasing describes the action, not the duration: this order has been flagged, here is the reference, here is what we are doing, come back if you do not see it resolved. That is honest, and honest is what keeps a frustrated customer from escalating.

Staff need the same reference in their own view, tied to the same identifier. A customer with a code and a staff member who cannot look it up is a worse position than no code at all, because it looks like competence and delivers nothing.

Make Reconciliation a Purchase Acceptance Item

The last move is to convert everything above into acceptance criteria, so that the capability is present in the machine you receive rather than in the machine you hope you bought.

Write the criteria as tests with pass conditions, and make failing any of them a reason to withhold acceptance.

Can you export the transaction record and the dispense record for a given day, independently, without contacting the supplier. Can you match them yourself using a shared identifier. Does the dispatch record carry a timestamp precise enough to order events within one purchase. Does the machine refuse to dispense a new order while a previous order's state is unresolved. Does a failed dispense trigger a defined, visible state rather than a silent reset. Can a counter-level user issue a refund or a void, or is the authority level documented and matched by the interface.

Add two criteria that address the recovery case specifically. First, a documented procedure for an uncertain sale that does not involve retrying the payment. Second, a test in which you deliberately interrupt a completed payment before dispense and confirm the machine ends in a reconcile-able state. That second test is the acceptance test for this entire article, and it takes minutes to run.

There is a governance item that belongs alongside the technical ones. Name who owns the reconciliation record. In most operations this is nobody, and the result is that the data exists in three systems and is joined by no one until a customer complains. A named owner, a defined daily check on unresolved orders, and a retention period that outlasts your dispute window will catch the failures that never got reported by a customer.

One boundary worth being clear about, since it comes up in tender documents. Everything here concerns the state of a transaction and the state of a drink. It has nothing to do with whether the right recipe ran, whether the correct cup was used, or whether the ingredient in the hopper matched the menu. Those are production-side questions with their own controls, and their evidence does not help you when a customer has been charged and the drink did not arrive. The reconciliation you need here is narrow: two records, one identifier, and a person authorised to act on the difference.

The machine will fail eventually. What decides whether that is a five-minute fix or a lost customer is whether the two timelines can be put back together, and whether anyone was required to build that capability in before the first cup was sold.

Show AIsirRobot your intended payment flow and failed-order scenarios. We can help define the records and recovery demonstrations to request from the robot supplier and payment integrator.

Contact Us