Gift inventory
The gift inventory has the premium gift codes the current account bought.
A new code sets has_unread_gift_inventory on the user object and adds one to unread_gift_inventory_count. To clear both, send has_unread_gift_inventory: false to Modify current user. Listing gifts doesn't clear them.
Gift inventory object
Section titled “Gift inventory object”One gift code the current account bought. Any account with an unredeemed code can redeem it.
Structure
Section titled “Structure”| Field | Type | Description |
|---|---|---|
| code | string | The gift code |
| duration_type | string | The duration unit of duration_quantity |
| duration_quantity | integer | The number of duration_type units the code grants |
| created_at | ISO8601 timestamp | When the code was created |
| created_by | partial user object | The account that bought the code |
| redeemed_at? | ?ISO8601 timestamp | When the code was redeemed, or null if it is unredeemed |
| redeemed_by? | ?partial user object | The account that redeemed the code, or null if it is unredeemed |
List current user gifts
Section titled “List current user gifts”GET/v1/users/@me/giftsReturns the gift codes the current account bought, newest first, with no pagination. The list leaves out revoked codes and codes redeemed more than seven days ago.
Response
Section titled “Response”| Status | Body | Condition |
|---|---|---|
| 200 | array[gift inventory object] | The gift codes were returned |
| 404 | error response | NOT_FOUND when the instance premium mode isn't mirror |
The rate limit is 40 requests per 10 seconds, on the gifts:list bucket.