Lost Order Responses: Prevent Duplicates and Refunds

Learn how to handle delivery timeouts safely with retries, status checks, and process recovery.

  • Where uncertainty arises
  • How this threatens the business
  • First principle: one business request must have a stable identifier
  • Second principle: “unknown” is a separate status

The order was created, but the system received an error: how to protect an online store from duplicates and unnecessary refunds

  1. 06.11.2026 The customer paid for the order. The online store sent it to the delivery service but received a timeout or internal error instead of confirmation. In this situation, the order must not automatically be treated as uncreated and the request retried. In a distributed system, a response error does not mean that the operation failed.

  2. The delivery service may have accepted the order and assigned it a number, but the response did not return in time. A retry will create a duplicate.

  3. Automatic cancellation may trigger a refund for an order that is already being picked or delivered.

  4. This is a distinct business scenario that must be designed alongside the main order flow.

Lost Order Responses: Prevent Duplicates and Refunds
The order was created, but the system received an error: how to protect an online store from duplicates and unnecessary refunds

Where uncertainty arises

  1. Order placement passes through several systems: the storefront, OMS or accounting system, payment service, warehouse, integration layer, and delivery service. Each has its own statuses and identifiers. In the normal scenario, the store sends the order and receives confirmation. In the event of a failure, three different outcomes are possible:

  2. The request did not arrive: the carrier has no order.

  3. The request arrived, but processing ended with an error: no order exists.

  4. The order was created, but the confirmation was lost, so the store has no external identifier. The same timeout cannot distinguish between these possibilities. Therefore, the solution cannot rely solely on the response code.

How this threatens the business

Duplicate orders An automatic or manual retry may create a second shipment.

It will have to be found, cancelled, and explained to the delivery service and the customer. Incorrect cancellation and refund

If the internal system considers creation unsuccessful, it may release the reservation or initiate a refund.

In reality, the order continues to move through the process. Lost statuses

Without an external identifier, the store cannot reliably link subsequent delivery events to the original order.

Support sees one state, while the carrier shows another. Manual investigation

An employee searches for the order by phone number, address, time, and amount, compares systems, and requests that events be resent.

The higher the volume, the more costly this process becomes.

First principle: one business request must have a stable identifier

  1. On the first transmission, the system generates a unique operation identifier and reuses it for an allowed retry.

  2. The recipient recognises that the request has already been processed and does not create a second entity. AWS describes this approach as idempotency: repeating the same request should not create additional side effects.

  3. For order creation, charge, or refund operations, this is more important than the convenience of automatic retries.

  4. An idempotency key works only when the recipient defines its meaning in the API contract and stores the operation result.

  5. A sender-generated identifier does not prevent duplicates without recipient-side support.

  6. Searching by order number and keeping a transmission log reduce the risk but do not guarantee uniqueness.

Second principle: “unknown” is a separate status

After a timeout, do not immediately mark the order as “creation error”.

The correct state is “result not confirmed.” It triggers reconciliation, not a retry or refund. The recovery scenario may look like this:

Record the request, time, and operation identifier.

Check whether the order appeared in the external system.

If one exists, obtain the external number and continue processing.

Retry the request only when an idempotency key is supported, an authoritative negative response is available, the business key's uniqueness is guaranteed, or reliable contractually defined reconciliation is available.

If the result remains ambiguous, assign the case to an employee and block irreversible actions. The customer should not see technical uncertainty presented as an order cancellation. Until reconciliation is complete, the interface displays a neutral processing status.

Third principle: accept statuses only with sufficient context

  1. An event such as “delivered,” “partially delivered,” or “problem” may be insufficient on its own.

  2. For a correct financial and inventory outcome, the system needs the order number, line items, quantities, and event version.

  3. If an event arrives without order contents, do not automatically conclude that the items are lost or that the order is empty.

  4. This signal should enter a technical queue for reprocessing or reconciliation.

  5. For incoming events, it is useful to store the event identifier, occurrence time, version, or sequence.

  6. Then distinguish between: - transport fact: the event was received; - business fact: the event passed validation and was applied; - exception: insufficient data, recovery required.

Map out your integration landscape

Fourth principle: refunds and cancellations require additional safeguards

  1. The more irreversible the action, the more confirmation it requires.

  2. Before cancelling a paid order, the system must check: - whether the order was created with the carrier; - whether picking or delivery has started; - whether a more recent event exists; - whether the error concerns the operation or only the response; - whether reconciliation is already in progress.

  3. An automatic refund based on a single timeout creates a risk of duplicate compensation.

  4. When the state is uncertain, the system blocks the refund and routes the order to an operator. Cancellation, reservation release, and refund are handled as separate actions with their own rules and owners.

What support must be able to see

Support does not need the complete technical logs. It needs a single record containing: - internal and external order numbers; - payment, reservation, and delivery; - the last confirmed state; - events that could not be applied; - reconciliation in progress; - the permitted next action. This prevents staff from piecing together the history across multiple systems or promising the customer a cancellation before the facts are established.

How to test the integration before launch

Acceptance testing must cover the main flow and partial-failure scenarios: - the response is lost after the order is actually created; - a request is sent twice; - a status arrives before the creation response; - events arrive out of order; - an event contains no order lines; - the external service is temporarily unavailable; - an operator manually repeats an action while automation does the same; - the order has already been cancelled or delivered when an old event arrives.

You must verify not only message exchange but also the outcome:

  • there is no duplicate
  • no unnecessary refund was issued
  • the order can be recovered
  • and support has a clear picture

Which metrics to monitor after launch

- the share of operations with an undetermined result; - the number of duplicates; - automated and manual reconciliation time; - the number of unapplied events; - cancellations and refunds after integration errors; - status discrepancies between systems; - customer inquiries about “lost” orders.

Conclusion

  1. A reliable delivery integration is defined not by how it works with an ideal response, but by what happens after a timeout.

  2. The system must distinguish “not created” from “created but not confirmed,” safely retry operations, recover identifiers, and block irreversible actions when the state is uncertain.

  3. For the audit, KT.Team uses one order-creation flow, a status table, and timeout examples.

  4. The result is a recovery plan, a list of irreversible actions, and a set of failure scenarios for acceptance testing.

Sources

- AWS Builders’ Library: Making retries safe with idempotent APIs - explains safe retries and the request identifier; the e-commerce scenario is an application of a general pattern. - AWS Well-Architected: Make all responses idempotent - confirms the role of an idempotent contract for repeated requests. - AWS Prescriptive Guidance: Retry with backoff pattern - describes retries for temporary failures; validation, authorization, and business rule errors are not automatically

are repeated.

Discuss the article: The Order Was Created, but the Response Was Lost: How to Avoid…

Enter your email or phone number so we can get back to you.

Send via: