Discard Item
horizon_discard_itemPermanently discards an owned item instance using an exact reviewed inventory revision to prevent replays, then returns the updated inventory. Use when a player explicitly requests this action.
Instructions
Discards Item using the reviewed inventory revision. Use when: the player explicitly requests this inventory action. Not for: automatic retries, client grants, changing instance IDs or revisions to force an uncertain action through. Requires: userId and the player's session: sign in with horizon_signin_email or horizon_signin_anonymous and pass its accessToken as sessionToken. An exact reviewed inventory revision and instance UUID. Side effects: Permanently removes this instance. The original source guards consumption; replay cannot recreate a discarded item and no recipient receipt is added. One HTTP attempt only. Returns: Complete {userId,revision,instances,limits,serverTime} inventory. Replace only the matching host/project/player cache. Instances carry server-generated UUIDs, properties, equipped and createdAt. Errors: 409 REVISION_CONFLICT or an uncertain response: use horizon_get_items and reconcile intent, never silently substitute a new revision and repeat. 404 ITEM_NOT_FOUND means this instance no longer exists. 422 ITEM_PROPERTY_NOT_ALLOWED/ITEM_PROPERTY_LIMIT_REACHED rejects the entire adjustment. 401 means the session is missing or expired: sign in again and retry with the new accessToken. 403 for a session means the token belongs to another user: pass the userId that signed in. 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 |
|---|---|---|---|
| userId | Yes | Signed-in player UUID matching the session | |
| instanceId | Yes | Exact owned item instance UUID from the reviewed inventory | |
| sessionToken | Yes | Player accessToken sent only as Authorization Bearer | |
| expectedRevision | Yes | Exact reviewed revision; never refresh and substitute automatically |