{"section":"known-issues","requestedLocale":"en","requestedSlug":"refund-limited-incorrectly-due-to-duplicated-receipt-from-race-condition-oms-invoicerestutions","locale":"en","slug":"refund-limited-incorrectly-due-to-duplicated-receipt-from-race-condition-oms-invoicerestutions","path":"docs/en/known-issues/Order Management/refund-limited-incorrectly-due-to-duplicated-receipt-from-race-condition-oms-invoicerestutions.md","branch":"main","content":"## Summary\n\nWhen issuing a refund via OMS invoice Input with restitutions, some orders are blocked with the error: `\"Unable to using the restitution Refund more than xxx\"` even though the payment transaction still shows a higher refundable balance. The visible symptom is a lower-than-expected refund limit calculated on the order. In the investigated case, engineering identified a duplicated receipt saved in the order JSON caused by a race condition in a worker that recovers receipts, which reduces the system's perceived refundable amount. Affects merchants performing refunds via OMS restitutions on orders where the receipt recovery worker races with normal receipt persistence.\n\nThis same root cause also blocks Order Modification (ChangeOrderV2) when removing or decreasing an item on a Marketplace order — instead of the restitution error above, it surfaces as `SOSValidationException` **CHK0034** (`\"The value of the change exceed the order's price\"`) on PATCH `…/orders/{orderId}/changes`. Confirmed via real stack trace in `ParticipantsEnricher.MergeWithParticipantPreviewsAsync`, which runs the same refund-balance calculation while propagating the change to the Marketplace participant.\n\n## Simulation\n\nThere is no known way to replicate this scenario on demand — it depends on a race between the receipt-recovery worker and the persistence of the real refund receipt, which only manifests under specific timing.\n\n## Workaround\n\n- Open a ticket to PS to remove the duplicated receipt from the order JSON so the refundable balance is recalculated correctly. This is not fixable via Admin or public APIs. Confirmed effective for the ChangeOrderV2 trigger as well — after removal, restitution-types returned to the correct value and the blocked item removal was unblocked.\n- If an urgent refund is required before PS correction:\n  - Perform the remaining refund directly in the payment gateway dashboard to reimburse the shopper, and add an internal note on the order for reconciliation. Note that this will not adjust OMS refundable balances and should be regularized after Engineering correction.\n\n- If you suspect this scenario:\n  - Compare gateway totals refunded vs. the sum of receipts recorded on the order; look for duplicated amounts for the same event. Provide PS with timestamps, the order JSON, and the failing invoice Input payload (or the failing ChangeOrderV2 payload, if the trigger is an item removal)."}