Gram Shop
EN
Sign in Request access

Two buyers, one last key: who gets the reservation?

Avoid selling the last key twice. Trace two synthetic purchase attempts through stock display, reservation and sale, with an operator evidence checklist.

Gram Shop team 4 min read
Purchase attempts A and B target UNIT-DEMO-01; A reserves it while B has no reservation for that unit.
Illustrated reservation outcome: one holder of the last key. This is not a recorded concurrency test.
On this page

One key remains, but two buyers see it in stock. To avoid selling that last key twice, the reservation step must associate the inventory unit with one purchase attempt. The other attempt needs a clear result before the shop promises delivery.

This guide follows two synthetic purchase attempts so you can inspect your own stock workflow. UNIT-DEMO-01 is an inventory label, not a key payload. The example concerns license keys the shop is authorized to distribute.

Seeing stock is different from reserving it

Buyers A and B open the catalog at almost the same time. Both see one unit remaining from before a reservation succeeds. When a buyer confirms, the system needs to recheck availability and reserve the unit as one operation.

If a tool reads a count and reduces it in a separate step, both attempts can choose the last key. Ask to inspect the reservation and its order association. A final stock count alone cannot establish whether two orders received the same unit.

Trace two attempts against one inventory unit

Assume A successfully reserves the unit. A labels the winner in this example; opening the catalog first does not establish who will reserve it first.

StepAttempt AAttempt BUNIT-DEMO-01
Both view the productSees one unitSees one unitavailable
A reserves successfullyHas a reservation for AMust recheck when claiming stockreserved for A
B has no reservationContinues according to A's order stateCannot receive the same unit; gets appropriate guidanceStill reserved for A
A meets settlement conditionsOrder is associated with the sold unitHas no entitlement to A's keysold
UNIT-DEMO-01 moves from available to reserved for A, while B has no hold. Eligible cancellation releases it; settlement marks it sold.
Synthetic example: after a reservation is released, a new purchase still needs an availability check.

This is an illustration of the required outcome. An attempt unable to acquire a processing lock may need a retry. A later check after reservation may find no stock. A generic response must not be mistaken for a successful order.

The message below is suggested wording to adapt to the actual state, rather than a Gram Shop interface capture:

This purchase attempt has not reserved stock. Refresh the product status before continuing. If you already have an order reference, send it to the shop for review.

After A cancels, B needs a fresh check

An eligible cancellation while awaiting payment can release the held unit. Check the release result and current stock state before accepting another order. A countdown reaching zero does not establish that expiry processing has finished.

Gram Shop's eligible cancellation path releases held units; eligible expiry processing also uses that cancellation path. This does not automatically transfer the unit to B. B needs another availability check through the current purchase flow.

If A's order has settled and the unit is sold, review allocation and delivery history. Gram Shop's current state machine has no transition from sold stock back to available. A refund or dispute should not prompt someone to put a disclosed key back into stock.

Repeating confirmation should return the same order

A buyer may press confirm again while waiting for a response. Repeat the same purchase action during evaluation and inspect the returned order reference. The order and allocated stock association should remain the same.

Gram Shop's confirmation implementation returns the existing order when the same quote already has one. This describes code behavior. It does not replace a two-buyer contention check on the database engine intended for operation.

Ask for a trial with inspectable evidence

Use a test environment and synthetic data. Ask the operator to create two independent attempts for one remaining unit. Record the following references while keeping the actual key in protected storage.

Evidence to recordWhat to reconcile
Unit and purchase referencesOne unit; two independent attempts for the same Store and product
Active reservationsOnly one attempt may hold UNIT-DEMO-01 at a time
The unsuccessful attemptA clear result without association to the same unit
Repeated confirmation by the winnerThe same order, without another stock allocation
Eligible cancellation before settlementThe hold is released; a new attempt rechecks availability
Settlement and sendingThe sold-unit association and delivery result can be checked separately

Sequential clicks help check the normal workflow. Demonstrating concurrency requires overlapping operations on an appropriate database engine. A two-window video or a SQLite run alone does not establish MySQL or MariaDB row-lock behavior.

Review the Gram Shop feature scope before evaluating fit. To discuss your stock workflow, send how your shop reserves its last key. Describe when the hold starts, what releases it and what the other buyer sees. Use synthetic references for the example.

Sell on Telegram without reconciling by hand.

Gram Shop is in Controlled Beta. Tell us about your Stores and payment rails and we will set up your Team.