Skip to content
Install desktop app

Seller webhooks

Guide version 1.10.0

Connect your server and receive a test event

A webhook sends your server an HTTPS POST when something happens to your game. Use a test delivery to check the connection before handling player activity.

Before you start

  • A game you own, a confirmed store account, and a public HTTPS endpoint with a DNS hostname that accepts POST requests.
  • Download the Python 3.11+ verifier below and save it as verify_webhook.py beside your receiver.

Steps

  1. Open the private store-page editor, enter the endpoint, select at least one event and enable delivery. Save the signing secret immediately. Your receiver looks it up using the decimal key version from Inspacy-Key-Id.
  2. Read the original request bytes and the three Inspacy headers. Pass them to accept as shown below. The helper returns True for a new event and False for a previously accepted event. Commit your local change or enqueue work in the same database transaction as the event ID.
  3. Return HTTP 204 after a successful commit, including an already accepted ID. Reject a failed signature. Choose Send test in the editor and look for type test in your receiver and delivered in recent history.

Example

from pathlib import Path
from verify_webhook import accept

# raw_body and headers come directly from your HTTPS request.
first = accept(raw_body, headers, game_id, keys_by_id, Path("game-events.sqlite3"))

Expected result

Your server records one event ID. The delivery history shows delivered and its HTTP result.

If something goes wrong

A missing key or mismatched signature requires checking the key version, clock and unmodified body. Replacing or disabling a destination suppresses pending deliveries to its old revision.

Download verify-webhook.py

Event types and payloads

Every POST has version, eventId, type, gameId, occurredAt (UTC) and data. The example below each name shows data. The full example shows how to identify one delivery.

wishlist.added
A player added the game to their wishlist. The data object is empty.
Example
{}
purchase.completed
An order line sold this game or an offer belonging to its base game. saleLine is an opaque sale reference. offerId identifies the item sold.
Example
{
  "saleLine": "a1ed38a4-9654-4fc6-8bd8-c2d828914d96",
  "offerId": 57
}
game_page.viewed
A visible visit to the public game page was recorded after the device allowed game-page analytics. The data object is empty.
Example
{}
rating.created
A player submitted a new rating. data.rating is an integer from 1 to 5.
Example
{
  "rating": 4
}
test
Send test queues this event for the configured destination. Use it to check the receiver without creating a sale, rating or visit.
Example
{}

Example

{
  "version": 1,
  "eventId": "2ce98c5f-5701-4b71-af45-3d39034ff01a",
  "type": "rating.created",
  "gameId": 42,
  "occurredAt": "2026-11-30T12:00:00Z",
  "data": {
    "rating": 4
  }
}

Verify a signature and replay a delivery locally

Run the same signed event through the downloaded verifier twice. This exercises the receiver with a temporary database and a local test key.

Before you start

  • Save verify-webhook.py as verify_webhook.py. Save this example next to it as replay.py.

Steps

  1. The sender signs the ASCII Unix timestamp, one literal dot and the raw request bytes with HMAC-SHA256. Decode the signing secret from hexadecimal. Compare the complete v1= signature in constant time before parsing JSON.
  2. Run python replay.py. The example uses the current timestamp. The verifier checks a five-minute window, the envelope version, the expected game and a valid event UUID.

Example

import hashlib
import hmac
import json
import tempfile
import time
from pathlib import Path
from uuid import uuid4
from verify_webhook import accept

game = 42
key = bytes(range(32))  # Local fixture
body = json.dumps({"version": 1, "eventId": str(uuid4()), "type": "test",
                   "gameId": game, "occurredAt": "2026-11-30T12:00:00Z",
                   "data": {}}).encode("utf-8")
stamp = str(int(time.time()))
digest = hmac.new(key, stamp.encode("ascii") + b"." + body, hashlib.sha256)
headers = {"Inspacy-Key-Id": "1", "Inspacy-Timestamp": stamp,
           "Inspacy-Signature": "v1=" + digest.hexdigest()}
with tempfile.TemporaryDirectory() as tmp:
    db = Path(tmp) / "events.sqlite3"
    print(accept(body, headers, game, {"1": key.hex()}, db))
    print(accept(body, headers, game, {"1": key.hex()}, db))

Expected result

The first call prints True and the second prints False. Both deliveries can receive a 2xx acknowledgment.

If something goes wrong

If a valid delivery fails, compare the clock, the key version and the exact bytes received. Reformatting JSON before verification changes the signature.

Download verify-webhook.py

Settings, test and retry operations

These are the operations used by the editor, under /api/store/seller-webhooks/v1. Call them with the confirmed game owner’s store session. Replace the sample revision with the latest value from GET.

GET /{gameId}
Read the current configuration and the 12 most recent deliveries. Save revision for the next change. A new configuration starts at 0.
PUT /{gameId}
Save the public HTTPS destination, enabled flag and distinct event names. When the response includes issuedSecret, copy its hex value and keyVersion into the receiver’s secret store.
Example
{
  "endpoint": "https://events.example.com/inspacy",
  "events": [
    "purchase.completed",
    "rating.created"
  ],
  "enabled": true,
  "expectedRevision": 0
}
POST /{gameId}/test
Queue a signed test for an enabled destination. Inspect recent to follow its delivery.
Example
{
  "expectedRevision": 1
}
POST /{gameId}/rotate
Issue a new signing key and revision. Install the one-time secret under the returned key version, then send a test.
Example
{
  "expectedRevision": 1
}
POST /{gameId}/deliveries/{eventId}/retry
Requeue a parked event from the enabled, current revision within 30 days of occurrence. Its event ID stays the same.
Example
{
  "expectedRevision": 1
}

If something goes wrong

On 409, read the settings again before saving. Changing the endpoint, selection or enabled state, or rotating its key, cancels pending and parked events from the retired revision.

Read the delivery history

Use the event ID to match your receiver log with the store history. Open lastResult and nextAttemptUtc to decide what to do.

pending
The store is waiting to send or retry. Network failures, HTTP 408, 425, 429 and 5xx can retry after 5 seconds, 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours.
delivered
Your endpoint returned 2xx. Inspect your own event record to see what your application did.
parked
A permanent refusal or seven unsuccessful attempts stopped automatic delivery. Fix the destination or receiver, then retry the eligible event.
cancelled
The settings revision changed. Use Send test to check the current destination and signing key.

Independent game store

Extraordinary worlds.
A place to make them yours.

© 2026 Inspacy.GameStore

Looking for your next adventure?

Explore new worlds and keep your favorites close.