scratch card game api: Separate Ticket Purchase From Reveal
A scratch card game api integration should distinguish buying a ticket from watching its result appear. A player might pay, uncover two symbols, lose connectivity, and return on another device. That interruption must not create another purchase, erase an existing entitlement, or make a payout depend on an animation finishing. The practical challenge is preserving the same ticket and its authoritative result across interrupted reveals.
For casino operators, this means defining the purchase boundary, result availability, and settlement rules before designing the scratch effect. The interface can restart; the financial transaction must remain traceable.
scratch card game api: Define What a Reveal Actually Does
Scratch-style games do not all use the same backend model. A title may generate an outcome when a purchase is accepted, allocate a ticket from a predefined inventory, or require a later server action to complete the game. Similar-looking interfaces can therefore require different transaction handling.
Ask the provider to document:
- When the stake becomes committed.
- When a ticket or equivalent round entitlement exists.
- When the outcome becomes final and retrievable.
- Whether scratching is purely visual or sends authoritative game actions.
- What closes an abandoned ticket and initiates any payout.
Do not infer these answers from a demo. If revealing symbols is only presentation, a browser event must not authorize a payout. If a server-side completion action is required, skipping it may leave a valid ticket unresolved.
The integration should follow the documented game protocol, not impose one settlement model on every scratch title.
Keep Purchase, Outcome, and Presentation States Separate
A single `completed` flag is too vague. It could mean that the player finished scratching, that the provider finalized the outcome, or that the wallet received a credit. Those events can happen at different times.
Track three independent dimensions
Maintain a durable record linking the operator purchase reference, provider ticket or round reference, player, game version, stake, currency, and wallet transaction references. Then distinguish:
- Purchase state: pending, accepted, rejected, or uncertain.
- Game state: awaiting outcome, outcome final, or otherwise unresolved under the provider protocol.
- Financial state: debit pending, debit confirmed, credit pending, settled, or reversed through an authorized process.
Presentation progress belongs separately: unopened, partially revealed, or fully displayed. These are illustrative internal labels, not assumed API fields.
A settled winning ticket may still be visually unopened. Conversely, a fully displayed win may have a delayed wallet credit. Support and reporting must be able to distinguish both cases.
Preserve the original commercial terms
Store the accepted stake, currency, game identifier, and relevant prize-table or configuration reference. Opening an old ticket after a configuration change must not reinterpret its symbols using today's prize table.
If the provider does not expose version identifiers, agree on another durable way to retrieve the ticket's original terms and result.
Treat Purchase Timeouts as Uncertainty, Not Failure
The most expensive interrupted-reveal defect often begins before any scratching occurs. A player presses Buy, the request times out, and the client enables Buy again. The first purchase may already have succeeded.
Use a stable purchase intent reference and whatever idempotency mechanism the provider explicitly supports. After an ambiguous response, query the original purchase or reconcile its status rather than silently submitting a new intent.
A useful recovery sequence is:
- Record the purchase intent before sending the request.
- Submit it using the agreed duplicate-protection mechanism.
- On timeout, mark the intent uncertain and display a recovery message.
- Look up the corresponding ticket and wallet activity.
- Resume the accepted ticket or allow a new purchase only after establishing that the original was not accepted.
If the upstream API has no reliable lookup or idempotency support, clarify its recovery procedure before launch. Local duplicate suppression cannot prove what happened remotely.
Do not automatically refund every timeout. Refunding a purchase that later produces a valid winning ticket can create a contradictory financial position. Reversals must follow the provider's cancellation and settlement rules.
Make Reveal Recovery Read the Existing Ticket
A returning player should enter a recovery path that loads the existing entitlement. Opening the screen must not call the purchase endpoint as an initialization shortcut.
Authenticate the player and verify ownership server-side before returning ticket data. A ticket identifier is a reference, not permission to access another player's result.
Decide what progress must survive
For a purely visual scratch mechanic, persisting every pointer movement is usually unnecessary. Depending on the game's requirements, the client can restore a coarse reveal state or replay the scratch effect over the same immutable result.
Where each reveal is an authoritative server action, recovery must instead restore acknowledged actions and safely retry uncertain ones according to the protocol. Do not fabricate missing symbols locally.
Multiple tabs or devices should converge on the same ticket. Use version checks or equivalent concurrency controls for mutable reveal state, while keeping financial duplicate protection at the transaction boundary.
Keep outcome data out of incidental channels
Some games deliver the complete outcome to the client before the animation ends. Others disclose it incrementally. Respect that design and avoid leaking unrevealed results through analytics events, URLs, shared caches, or diagnostic logs.
Do not describe a client-side hidden result as secret from the player: data delivered to their device may be inspectable. Security should depend on authoritative server validation, not concealing symbols in JavaScript.
Reconcile Money Without Depending on Animation Telemetry
An `animation_finished` event is useful for understanding the interface, but it is not reliable financial evidence. Browsers close, telemetry is blocked, and mobile sessions disappear.
Reconcile accepted purchases against authoritative tickets, debits, final results, and payout transactions. Identify exceptions such as:
- A confirmed debit with no mapped ticket.
- An accepted ticket with an unresolved debit.
- A final winning outcome with no confirmed credit.
- Multiple credits associated with the same payout obligation.
- A ticket awaiting completion beyond the provider's expected lifecycle.
Apply aging thresholds appropriate to the protocol rather than treating every brief delay as a failure. Keep operational alerts separate from player-facing status.
A bundle purchase needs extra care: one checkout may create several tickets. Preserve each ticket's identity and explicitly map the aggregate debit or individual debits. Recovering one interrupted ticket must not repurchase the entire bundle.
Test the Interruptions Players Will Actually Create
A successful scratch animation proves little about recovery. Include these cases in acceptance testing:
- Close after debit: Exit before the purchase response arrives. Recovery finds the original ticket without another charge.
- Refresh mid-reveal: Reload after several symbols appear. The ticket retains its original outcome and terms.
- Open two devices: Reveal the same ticket concurrently. No extra purchase or payout occurs.
- Delay the credit: Finalize a winning result while delaying wallet delivery. Show an accurate pending state, then reconcile the credit.
- Change the configuration: Resume an old ticket after a stake or prize-table update. Its accepted terms remain intact.
- Interrupt a bundle: Recover one ticket without recreating its siblings.
Also test session expiry and access restrictions. Resolving an existing financial obligation is distinct from allowing new wagering; the recovery experience must follow applicable rules and the operator's compliance policy.
Agree on Evidence and Responsibilities Before Launch
For GamingAPI evaluations, request the lifecycle specification for the particular scratch title and studio under consideration. An aggregator-level wallet flow does not, by itself, establish when every game's outcome becomes final.
Confirm who investigates uncertain purchases, how long ticket records remain retrievable, and which references support a dispute. A useful evidence package links the original intent, provider acceptance, accepted terms, authoritative result, and wallet entries without retaining unnecessary personal data.
Use contact to discuss title availability and recovery requirements. Review pricing separately from technical acceptance: commercial agreement is not evidence that interrupted-ticket handling has passed testing.
FAQ
Should a ticket pay only after the player scratches every symbol?
Not necessarily. Follow the provider's authoritative completion and settlement rules. A visual progress percentage should not determine payment unless it corresponds to a required, validated game action.
Can an unfinished ticket be refunded automatically?
Do not assume so. An accepted ticket may already have a final outcome and may not be cancellable. Use the documented reversal process and applicable rules, not inactivity alone.
What should support see when a player reports a missing win?
Show the ticket reference, purchase status, original stake and currency, authoritative result, and payout status. Display reveal progress separately so an unfinished animation is not mistaken for an unsettled financial transaction.