Configuration
- Log in to the smatvirtual Merchant Dashboard.
- Navigate to the Webhook Settings section.
- Enter your listener URL and save the changes.
- You can enable receiving webhooks for specific event types to a specific URL only, by checking the checkbox for the seperate webhook URL field.
Event Types
All events share a similar payload structure but represent different financial movements.| Event | Description |
|---|---|
charge.bulk.debit | Standard game entry or stake deduction. |
charge.bulk.credit | Winnings distribution at the end of a game round. |
tournament.bulk.credit | Flagship Engine: Bulk reward distribution for tournament winners. |
charge.debit.refund | Reversals for failed transactions or Retention Refunds. |
Payload Structure
Every request sent to your webhook URL will follow this bulk format. Even if there is only one transaction, it will be sent inside an array (bulkData) to maintain consistency.
JSON
Field Definitions
- transactionId: A unique ID for the specific transaction. Required for idempotency checks.
- status:
PENDINGif the game round is ongoing;ENDEDif the round is finalized. - stakeAmount: The amount to be deducted (in debits) or the original bet (in credits).
- amountWon: The amount to be added to the player’s wallet.
Specialized Refund Logic
Thecharge.debit.refund event is unique to smatvirtual and is triggered in two specific scenarios:
- Technical Anomalies: If a debit cannot be validated or a system error occurs, a refund is issued to ensure player fairness.
- Retention Strategy: To enhance player satisfaction, our system automatically triggers a refund if a player suffers five (5) consecutive losses within a single session.
Response Requirements
Your servermust acknowledge the webhook by returning an HTTP 200 or 201 status code.
| Status Code | Meaning |
|---|---|
| 200 OK | Event received and processed successfully. |
| 201 Created | Event acknowledged. |
| Any other code | smatvirtual will consider this a failure and attempt retries. |
If your system is not ready to process the transaction immediately, it is
better to return a 200 OK with a “pending” message than to return an error.
This prevents unnecessary retry attempts.
Best Practices & Security
Implement Idempotency
Implement Idempotency
Always store the transactionId. If you receive a webhook with an ID you have
already processed, return 200 OK immediately without adjusting the player’s
balance a second time.
Handling Timeouts
Handling Timeouts
Your webhook should respond within 2 seconds. If your wallet processing
takes longer, acknowledge the webhook first and process the transaction in
the background.
Verify IP Origin
Verify IP Origin
For enhanced security, ensure that your webhook endpoint only accepts
traffic from smatvirtual’s authorized IP addresses.
Need to test? Use a tool like Webhook.site or Ngrok during development to
inspect the raw payloads sent from the smatvirtual dashboard.
