Setup guide · Integration reference · Rules
Partner API: integration reference
Your game's server tells QUARK which level a player reached. QUARK pays the rewards you configured, from the QRK you funded. Never call this API from the game client (the app): the signing secret must stay on your server.
1. How it works
- Register in this portal, accept the Terms and add your app. After admin approval and the registration fee you get an App ID and a secret.
- Buy QRK (USDT deposit) and create a campaign: tiers such as level 5 = 1 QRK, level 10 = 2 QRK, level 15 = 3 QRK and a number of players. Tiers add up: a player who reaches level 15 earns 1 + 2 + 3 = 6 QRK. The whole budget is reserved from your wallet when the campaign starts.
- A player opens the QUARK app, goes to Games and taps Link account to get an 8-character code. The player types it in your game; your server confirms it. One QUARK account links to one game account per app.
- Your server reports levels. Each new tier is credited as earned and unlocks after the hold (default 24 h). The player then claims it in the QUARK app and the QRK lands in their Available QRK.
- When you close the campaign, everything not owed to players returns to your wallet. Rewards already earned stay claimable for the claim window (default 30 days), then the rest returns too.
2. Authentication (HMAC-SHA256)
Every request carries three headers:
| Header | Value |
|---|---|
X-Quark-App | your App ID (24 hex characters) |
X-Quark-Timestamp | Unix time in seconds (within 5 minutes of QUARK's clock) |
X-Quark-Signature | lowercase hex of HMAC_SHA256(secret, ts + "." + METHOD + "." + PATH + "." + sha256hex(rawBody)) |
METHODis upper case.PATHis the URL path without the query string, for example/partner/v1/progress.rawBodyis the exact bytes you send (empty string for GET). Send the same bytes you signed.- Base URL:
https://quarknetwork-org.onrender.com. A signature is valid for 5 minutes.
Test vector (secret qs_TESTSECRET, ts 1760000000), body {"eventId":"evt-0001","playerId":"p1","level":7}, POST /partner/v1/progress: body sha256 a7b64ebfca4787edd2512ee22e8d0a706afdb6417ce95903d5e1360d7012b69a, signature 43a232428f23729c70f4de2ccf91cab4bb7822ccea9b6ea64c8e5a7ecb56e1da.
Node.js
Python
3. Endpoints
All POST bodies are JSON and must contain eventId (8 to 80 characters: letters, digits, _ . : -). Repeating an eventId returns the first answer with "replay": true and changes nothing, so it is safe to retry after a timeout. Generate a new eventId for every new event.
POST /partner/v1/links/confirm
The player typed the code in your game. playerId is your stable id for the player (1 to 128 visible characters; use an internal id, not an e-mail). level is optional. Success returns linked, enrolled, campaignId and the tiers. Errors: INVALID_CODE (wrong, used or older than 15 minutes), PLAYER_ALREADY_LINKED, USER_ALREADY_LINKED, NO_ACTIVE_CAMPAIGN, INVALID_PLAYER. enrolled: false means the campaign has no free slots.
POST /partner/v1/progress
Report the player's current level (a whole number, 0 to 100000). Levels are cumulative, so you may skip reports; the next one catches up. result is one of CREDITED (new tiers earned), NO_NEW_TIER, IGNORED_LOWER, CAMPAIGN_PAUSED, FLAGGED (a very large jump, held for an admin to check) or FLAG_PENDING. Errors: NOT_LINKED, LINK_REVOKED, BLOCKED, NO_ACTIVE_CAMPAIGN, CAMPAIGN_FULL, INVALID_LEVEL, RETRY (HTTP 503: retry with the same eventId).
GET /partner/v1/campaign
The running campaign (tiers, holdHours, slotsLeft) or campaign: null.
4. Rules and limits
- Report levels from your server after validating the progress. Rewards are real QRK: obvious cheating or bots lead to blocked players and, at the admin's discretion, suspension of the app.
- A jump of more than the campaign's level-jump limit (default 20 levels) that would earn a reward is held for admin review.
- Rate limit: 600 requests per minute per app. 401 means a bad signature or an expired timestamp; 503 is temporary, retry.
- Rotating the secret in the portal stops the old one immediately.
- Player ids are stored only as a one-way hash; QUARK never shows you QUARK usernames or e-mails.