{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml","api-docs-content/apis/game_events_webhooks.yaml":"api-docs-content/apis/game_events_webhooks.yaml"},"props":{"metadata":{"markdoc":{"tagList":["openapi-code-sample","json-schema","img"]},"type":"markdown"},"seo":{"title":"Implementing Your Webhook Endpoint"},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"implementing-your-webhook-endpoint","__idx":0},"children":["Implementing Your Webhook Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To receive game events, your system must expose an HTTPS endpoint that accepts the webhook notifications we deliver. This page covers the endpoint requirements, the payload you will receive, how to respond, and how delivery and retries work."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"authentication","__idx":1},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We authenticate each delivery to your endpoint using the method you configured in your subscription. Validate it on every incoming request."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required Fields"},"children":["Required Fields"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["BEARER"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["apiKey"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API key sent in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header as a Bearer token"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["BASIC"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["username, password"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP Basic authentication with username and password"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NONE"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["none"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No authentication (not recommended for production)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"webhook-payload","__idx":2},"children":["Webhook Payload"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each delivery is a POST request whose body is described by the schema below."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delivery Sample:"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-content/apis/game_events_webhooks.yaml","operationId":"receiveGameEvent","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://your-domain.com/webhook/game-events \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"roundId\": \"12345678-abcd-1234-efgh-123456789012\",\n    \"gameId\": \"rp_12\",\n    \"playerId\": \"player123\",\n    \"timestamp\": \"2026-09-15T10:30:00.123\",\n    \"bet\": 1.5,\n    \"currencyCode\": \"EUR\",\n    \"events\": [\n      \"COIN\",\n      \"FEATURE\"\n    ],\n    \"actionId\": \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const resp = await fetch(\n  `https://your-domain.com/webhook/game-events`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({\n      roundId: '12345678-abcd-1234-efgh-123456789012',\n      gameId: 'rp_12',\n      playerId: 'player123',\n      timestamp: '2026-09-15T10:30:00.123',\n      bet: 1.5,\n      currencyCode: 'EUR',\n      events: ['COIN', 'FEATURE'],\n      actionId: '1054417e-487e-46d8-ba99-27e4ee8e86a7'\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://your-domain.com/webhook/game-events`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify({\n        roundId: '12345678-abcd-1234-efgh-123456789012',\n        gameId: 'rp_12',\n        playerId: 'player123',\n        timestamp: '2026-09-15T10:30:00.123',\n        bet: 1.5,\n        currencyCode: 'EUR',\n        events: ['COIN', 'FEATURE'],\n        actionId: '1054417e-487e-46d8-ba99-27e4ee8e86a7'\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://your-domain.com/webhook/game-events\"\n\npayload = {\n  \"roundId\": \"12345678-abcd-1234-efgh-123456789012\",\n  \"gameId\": \"rp_12\",\n  \"playerId\": \"player123\",\n  \"timestamp\": \"2026-09-15T10:30:00.123\",\n  \"bet\": 1.5,\n  \"currencyCode\": \"EUR\",\n  \"events\": [\n    \"COIN\",\n    \"FEATURE\"\n  ],\n  \"actionId\": \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n}\n\nheaders = {\"Content-Type\": \"application/json\"}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"roundId\\\": \\\"12345678-abcd-1234-efgh-123456789012\\\",\"\n      , \" \\\"gameId\\\": \\\"rp_12\\\",\"\n      , \" \\\"playerId\\\": \\\"player123\\\",\"\n      , \" \\\"timestamp\\\": \\\"2026-09-15T10:30:00.123\\\",\"\n      , \" \\\"bet\\\": 1.5,\"\n      , \" \\\"currencyCode\\\": \\\"EUR\\\",\"\n      , \" \\\"events\\\": [\"\n      , \"  \\\"COIN\\\",\"\n      , \"  \\\"FEATURE\\\"\"\n      , \" ],\"\n      , \" \\\"actionId\\\": \\\"1054417e-487e-46d8-ba99-27e4ee8e86a7\\\"\"\n      , \"}\"\n    );\n\n    var host = \"https://your-domain.com\";\n    var pathname = \"/webhook/game-events\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    string json = JsonSerializer.Serialize(new\n    {\n      roundId = \"12345678-abcd-1234-efgh-123456789012\",\n      gameId = \"rp_12\",\n      playerId = \"player123\",\n      timestamp = \"2026-09-15T10:30:00.123\",\n      bet = \"1.5\",\n      currencyCode = \"EUR\",\n      events = new[] {\n        \"COIN\",\n        \"FEATURE\"\n      },\n      actionId = \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n    using HttpResponseMessage request = await client.PostAsync(\"https://your-domain.com/webhook/game-events\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\n$payload = array(\n  \"roundId\" => \"12345678-abcd-1234-efgh-123456789012\",\n  \"gameId\" => \"rp_12\",\n  \"playerId\" => \"player123\",\n  \"timestamp\" => \"2026-09-15T10:30:00.123\",\n  \"bet\" => 1.5,\n  \"currencyCode\" => \"EUR\",\n  \"events\" => array(\n    \"COIN\",\n    \"FEATURE\"\n  ),\n  \"actionId\" => \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/json\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://your-domain.com/webhook/game-events\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://your-domain.com/webhook/game-events\"\n  var data = []byte(`{\n    \"roundId\": \"12345678-abcd-1234-efgh-123456789012\",\n    \"gameId\": \"rp_12\",\n    \"playerId\": \"player123\",\n    \"timestamp\": \"2026-09-15T10:30:00.123\",\n    \"bet\": 1.5,\n    \"currencyCode\": \"EUR\",\n    \"events\": [\n      \"COIN\",\n      \"FEATURE\"\n    ],\n    \"actionId\": \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://your-domain.com/webhook/game-events')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest.body = {\n  roundId: '12345678-abcd-1234-efgh-123456789012',\n  gameId: 'rp_12',\n  playerId: 'player123',\n  timestamp: '2026-09-15T10:30:00.123',\n  bet: 1.5,\n  currencyCode: 'EUR',\n  events: ['COIN', 'FEATURE'],\n  actionId: '1054417e-487e-46d8-ba99-27e4ee8e86a7'\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"roundId\": \"12345678-abcd-1234-efgh-123456789012\",\n   \"gameId\": \"rp_12\",\n   \"playerId\": \"player123\",\n   \"timestamp\": \"2026-09-15T10:30:00.123\",\n   \"bet\": 1.5,\n   \"currencyCode\": \"EUR\",\n   \"events\": [\n    \"COIN\",\n    \"FEATURE\"\n   ],\n   \"actionId\": \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n}'\n\nurl = \"https://your-domain.com/webhook/game-events\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"roundId\": \"12345678-abcd-1234-efgh-123456789012\",\n  \"gameId\": \"rp_12\",\n  \"playerId\": \"player123\",\n  \"timestamp\": \"2026-09-15T10:30:00.123\",\n  \"bet\": 1.5,\n  \"currencyCode\": \"EUR\",\n  \"events\": [\n    \"COIN\",\n    \"FEATURE\"\n  ],\n  \"actionId\": \"1054417e-487e-46d8-ba99-27e4ee8e86a7\"\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payload Schema:"]}]},{"$$mdtype":"Tag","name":"JsonSchema","attributes":{"schema":{"$ref":"../../apis/game_events_webhooks.yaml#/components/schemas/GameEventNotification"},"options":{},"schemaResolved":{"openapi":"3.1.0","components":{"schemas":{"__root":{"$ref":"#/components/schemas/GameEventNotification"},"GameEventNotification":{"type":"object","description":"Payload delivered to your webhook endpoint when a subscribed game event occurs.","required":["roundId","gameId","playerId","timestamp","events","actionId","bet","currencyCode"],"properties":{"roundId":{"type":"string","description":"Unique identifier for the game round.","example":"12345678-abcd-1234-efgh-123456789012"},"gameId":{"type":"string","description":"The game identifier.","example":"rp_12"},"playerId":{"type":"string","description":"External player identifier.","example":"player123"},"timestamp":{"type":"string","description":"When the event occurred, in UTC, without a zone offset.","example":"2026-09-15T10:30:00.123"},"bet":{"type":"number","description":"Bet amount of the action in major currency units (e.g. `1.50` for EUR).","example":1.5},"currencyCode":{"type":"string","description":"Currency code.","example":"EUR"},"events":{"type":"array","description":"The event types that occurred during this action.","items":{"type":"string","example":"COIN"},"example":["COIN","FEATURE"]},"actionId":{"type":"string","format":"uuid","description":"Unique identifier for this specific action; use it to detect duplicate deliveries.","example":"1054417e-487e-46d8-ba99-27e4ee8e86a7"}}}}}},"schemaResolvedErrors":[]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"expected-response","__idx":3},"children":["Expected Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your endpoint acknowledges each delivery with its HTTP status code:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":["Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Retried?"},"children":["Retried?"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Notification processed successfully"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No — acknowledged"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4xx"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Permanent failure (e.g. validation error)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5xx"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Temporary failure"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes — with exponential backoff"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"endpoint-requirements","__idx":4},"children":["Endpoint Requirements"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You need to provide an HTTPS endpoint capable of receiving POST requests with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/json"]}," content type. Configure the endpoint URL and its authentication when you create or update your subscription."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["URL Format"]},": Any HTTPS URL (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://your-domain.com/webhook/game-events"]},")"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTP Method"]},": POST"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Content-Type"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/json"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication"]},": Configured by you during subscription creation (see the supported types above)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"default-endpoint","__idx":5},"children":["Default Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Providing a callback URL is optional. If you do not provide one when creating your subscription, events are delivered to your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["default endpoint"]},": your existing wallet base URL, reusing the authentication credentials already configured for your account. The full path is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$wallet_url/v1/game-action-events"]},", and no additional setup is required."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"delivery--retries","__idx":6},"children":["Delivery & Retries"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We continuously deliver webhooks to your configured endpoint with automatic retry handling."]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/webhook_delivery.ed132a96c10c4ce8c33394d0fd23baa504e1761426a50cb39354aeb8486c260d.dde7e6fc.png","alt":"Webhook_Delivery.png","framed":false,"withLightbox":true,"width":"","height":""},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Reliable Delivery"]},": Automatic retries for up to 7 days"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exponential Backoff"]},": Increasing delays between retries (prevents overwhelming your system)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error Handling"]},": Permanent failures (4xx errors) are not retried"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication"]},": Uses the authentication method configured in your subscription (BEARER, BASIC, or NONE)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"best-practices","__idx":7},"children":["Best Practices"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Respond quickly"]},": Return 200 OK as soon as possible (under 1 second)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Handle duplicates"]},": Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["actionId"]}," to detect duplicate deliveries"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Process asynchronously"]},": Queue webhook processing if you need time to process"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Monitor failures"]},": Track 4xx responses to identify integration issues"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Validate payloads"]},": Always validate incoming webhook structure"]}]}]},"headings":[{"value":"Implementing Your Webhook Endpoint","id":"implementing-your-webhook-endpoint","depth":2},{"value":"Authentication","id":"authentication","depth":4},{"value":"Webhook Payload","id":"webhook-payload","depth":3},{"value":"Expected Response","id":"expected-response","depth":3},{"value":"Endpoint Requirements","id":"endpoint-requirements","depth":3},{"value":"Default Endpoint","id":"default-endpoint","depth":4},{"value":"Delivery & Retries","id":"delivery--retries","depth":3},{"value":"Best Practices","id":"best-practices","depth":3}],"frontmatter":{"seo":{"title":"Implementing Your Webhook Endpoint"}},"lastModified":"2026-08-11T09:32:41.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/content/integration/game-events/webhook-endpoint","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}