Skip to content

Rewarded Video Completion Webhook ​

This is a webhook interface, implemented by the Game SVR with the callback URL configured in the SUD OP console. The SUD OP SVR calls this interface after the APP ad platform passes completion verification, notifying the Game SVR to grant the reward.

Interface Description ​

Interface Name ad.rewardNotify

Description Rewarded video completion webhook. After the APP ad platform passes completion verification, the SUD OP SVR proactively calls the callback URL configured by the Game SVR, notifying the Game SVR to grant the reward.

Note: This interface requires service communication secondary encryption and signatures: the callback request must be signature-verified and decrypted before any business logic runs. This effectively prevents data tampering and leakage.

Interface Information ​

ItemValue
CallerSUD OP SVR
ProviderGame SVR
Trigger timingAfter the APP ad platform passes completion verification

Call Method ​

HTTPS Call ​

http
POST <Game custom callback URL>

The callback URL is configured by the Game in the SUD OP console. Please use an HTTPS address.

Request Parameters - Body ​

FieldTypeDefaultRequiredDescription
idstringYesWebhook notification ID
create_timenumberYesWebhook notification creation time (second-level timestamp)
eventstringYesEvent type, fixed as ad_reward_notify
payloadobjectYesEvent data, see the description below

payload Field Description ​

Rewarded video completion notification: ad_reward_notify

FieldTypeDefaultRequiredDescription
transaction_idstringYesTransaction ID generated by SUD OP, used as an idempotency key to prevent duplicate reward granting
user_idstringYesUser identifier, passed in by the client via setServerSideVerificationData
reward_itemstringYesReward item name, e.g. Coins, passed in by the client via setServerSideVerificationData
reward_amountnumberYesReward amount, passed in by the client via setServerSideVerificationData
custom_datastringNoDeveloper custom data, passed in by the client via setServerSideVerificationData
ad_unit_idstringYesSUD OP ad unit ID

Security note: reward_item, reward_amount, and custom_data are all passed in by the client via setServerSideVerificationData and carry the risk of being tampered with. The Game SVR must determine the real reward item and amount based on server-side configuration (such as the reward spec table corresponding to ad_unit_id), and must never directly trust the reward_amount in the payload when granting rewards. The legitimacy of user_id/custom_data must likewise be verified on the server side.

Response ​

The returned JSON data package

FieldTypeDescription
errcodeint32Error code. 0 indicates the protocol layer processed successfully (signature verification, decryption, and field parsing all passed)
errmsgstringError message
is_validbooleanBusiness-layer reward granting result. true: the reward was granted; false: business validation did not pass or no reward was granted this time (e.g. missing reward configuration, illegitimate user, idempotency hit already processed, etc.)

Response Semantics Convention ​

ScenarioRecommended response
Signature verification / decryption failedReject the request directly and return a non-200 HTTP status code (such as 401 / 403). Do not enter the business layer and return is_valid: false. SUD OP will retry or alert accordingly
Protocol normal, reward granted successfullyerrcode: 0 + is_valid: true
Protocol normal, idempotency hit (same transaction_id already processed)errcode: 0 + is_valid: true (treated as already granted, but not granted again)
Protocol normal, business validation not passed (e.g. user does not exist, reward configuration missing)errcode: 0 + is_valid: false
Game SVR internal error, expecting SUD OP to retryReturn a non-200 HTTP status code or a non-zero errcode

Example ​

Request Example ​

json
{
  "id": "notify_20260429_abc123",
  "create_time": 1745929600,
  "event": "ad_reward_notify",
  "payload": {
    "transaction_id": "sudtx_20260423_abc123xyz",
    "user_id": "user-001",
    "reward_item": "Coins",
    "reward_amount": 10,
    "custom_data": "level=5",
    "ad_unit_id": "sud_ad_unit_abc123"
  }
}

Response Example ​

Reward granted successfully:

json
{
  "errcode": 0,
  "errmsg": "ok",
  "is_valid": true
}

Validation failed:

json
{
  "errcode": 0,
  "errmsg": "ok",
  "is_valid": false
}

The example above represents that protocol-layer validation passed but the business layer did not grant a reward (e.g. user_id does not exist, ad_unit_id has no reward spec configured, etc.). For signature verification failures, reject the request directly as described in the "Response Semantics Convention" above; do not use this response.

Idempotency ​

  • The Game SVR uses payload.transaction_id as the idempotency key to ensure that a reward is granted only once for the same completion transaction.
  • When the SUD OP SVR retries sending the same transaction_id due to a timeout, the Game SVR should return is_valid: true but not grant the reward again.

Timeout and Retry ​

ItemRequirement
Game response timeout threshold≤ 5 s
Conditions that trigger a retryThe Game SVR does not respond within the timeout threshold, returns a non-200 HTTP status code, or returns a non-zero errcode
Total retry countUp to 15 times
Retry interval (seconds)15, 15, 30, 180, 600, 1200, 1800, 1800, 1800, 3600, 10800, 10800, 10800, 21600, 21600 (approximately 24 hours in total)

Returning errcode: 0 + is_valid: false is treated as the business layer proactively refusing to grant the reward, and will not trigger a retry. If you need SUD OP to retry, return a non-zero errcode or a non-200 status code.

Authentication ​

When SUD OP calls this interface, it always carries encryption and signature information in the request; there is no plaintext webhook mode. The Game SVR must verify the signature and decrypt the request to confirm the request source is legitimate before granting any reward.

Notes ​

  1. transaction_id must be checked for idempotency to prevent duplicate reward granting when the SUD OP SVR retries.
  2. The Game SVR must verify the signature. If verification fails, reject the request directly (return a non-200 HTTP status code); do not enter the business response flow, to avoid forged requests triggering reward granting.
  3. Client pass-through fields such as reward_item / reward_amount are untrusted. Before granting a reward, the real reward spec must be verified on the server side based on server-side configuration such as ad_unit_id.
  4. Requests whose create_time differs from the server's current time by more than 5 minutes should be rejected directly to prevent replay attacks.
  5. The SUD OP SVR only calls this interface after APP completion verification passes; the Game SVR does not need to re-verify with the APP platform.