Validate Gift Code
horizon_validate_gift_codeChecks whether a gift code is currently valid for a player without consuming it or preparing a redemption.
Instructions
Checks whether a gift code is currently valid for a player without consuming or preparing it. Use when: showing an early validity message; horizon_prepare_gift_code prepares a consumable V2 identity. Not for: claiming rewards (use horizon_redeem_gift_code with an already persisted intent). Requires: userId from horizon_signup_* or horizon_signin_*; no session token. Side effects: None (read only). Returns: {valid}; a validity check reserves nothing and cannot recover an uncertain redemption. Errors: Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Original visible gift code, retained with the prepared campaign identity | |
| userId | Yes | Player user ID (UUID) from horizon_signup_* or horizon_signin_* |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | No |