Claim an item
Claim a purchase awaiting the player: the item is delivered, a role is assigned or a giveaway is entered.
POST /v1/player/claim · for player session
Use it when the player claims a purchase from Read the locker whose status is claimable. The item is delivered or passed to the community's team for fulfilment, the role is assigned, or the giveaway is entered. A purchase that was already claimed returns alreadyClaimed: true with its current status, which is also what a retry after a lost response returns, so the request is safe to repeat and takes no key. The request needs the game loop. For the three conditions (game loop enabled for the game, member consent, server membership) and the error each returns, see What has to be true first.
Body parameters
Prop
Type
Returns
Prop
Type
delivery contains:
Prop
Type
status and waitingFor have the values of Buy a shop item.
Example
curl -X POST https://ceejay.communitystudios.xyz/api/v1/player/claim \
-H "Authorization: Bearer $CEEJAY_PLAYER_SESSION" \
-H "Content-Type: application/json" \
-d '{
"purchaseId": 4242,
"input": {
"title": "Harbour RFC"
}
}'The TypeScript example uses connect.hub.claim from the Connect client in the TypeScript SDK. The player must be connected first: the client manages and refreshes the player session. It returns the data of the response below.
{
"success": true,
"data": {
"purchaseId": 4242,
"claimed": true,
"alreadyClaimed": false,
"itemName": "Gold skin",
"status": "pending",
"waitingFor": "delivery",
"delivery": {
"state": "pending",
"message": null
}
}
}{
"success": true,
"data": {
"purchaseId": 4242,
"claimed": true,
"alreadyClaimed": true,
"itemName": "Gold skin",
"status": "pending",
"waitingFor": "delivery",
"delivery": {
"state": "pending",
"message": null
}
}
}What a claim needs
A claim redeems what a purchase bought, so it has the same requirements as buying: a device that connected with proof when the game requires proof (403 with the code verified_proof_required), and a connection and a device whose spending hold has ended (409 with the code spend_on_hold). It spends no coins and does not count toward the daily limit. The game loop explains the rules.
Only the member's own purchases, made through this game or of an item on the game's allow list, can be claimed here. Any other purchase, a purchase of another member or of another community, and an earned reward all return 404 with the code purchase_not_found. A purchase that is not claimable and not already claimed returns 409 with the code not_claimable and its status. When the item requires input and input is missing or invalid, the response is 400 with field: "input", and fields lists the inputs required.
Limits
20 writes a minute for one player session, and 60 buys and claims together an hour for one member in one game. The 20 writes are shared by Start, Verify and Answer a quest task, Buy a shop item, Claim an item and Check in. The three X-RateLimit headers report that count. Every request made with a player session also counts toward 140 a minute. See Rate limits. Over a limit the response is 429 with the code rate_limited, retryAfter and a Retry-After header.
Errors
| Status | code | error | When |
|---|---|---|---|
400 | bad_request | The request body must be a JSON object | The body is JSON but not an object: null, text, a number or a list. A body that is not JSON at all returns bad_request with the message The request body must be JSON |
400 | bad_request | purchaseId must be a whole number from 1 to 2147483647 | purchaseId is missing, is not a whole number, or is outside 1 to 2,147,483,647 |
400 | bad_request | This item needs further details before it can be claimed | input is missing or invalid for an item that requires input. The body includes fields, the inputs required |
401 | connection_ended | This connection has ended | The connection or this device was ended since the player session was made. Discard the stored tokens and show the player as disconnected. See Renew a player session for the reasons |
403 | verified_proof_required | This requires a verified player. This device connected without verification | This device connected without verification, and the game only lets verified players spend |
404 | purchase_not_found | Purchase not found | The purchase is not this member's or this game's, is an earned reward, or does not exist |
409 | hub_not_enabled | This game does not show the community's quests, shop and rank | The game loop is disabled for the game. Do not show the community's quests, shop or rank in the game |
409 | sharing_needed | The member has not consented to sharing their data with this game | The member has not consented to share their quests, rewards, shop and rank with the game, or must consent again. The body includes manageUrl: send the player there |
409 | membership_required | The member has to be in the server to use this | The Discord account is not in the server. The body includes membership (pending, left or not_member) and, for left and not_member, joinUrl, the URL to send the player to |
409 | spend_on_hold | This device cannot spend yet. New connections and devices cannot buy until the hold ends | A new connection or device is still on hold. The body includes holdUntil and retryAfter |
409 | not_claimable | This item cannot be claimed right now | The purchase is in a state that cannot be claimed. The body includes status |
413 | body_too_large | The request body is larger than 16 KB | The body is larger than 16 KB. Nothing was changed |
503 | bot_unavailable | This could not be done right now and nothing was changed. Try again in a few seconds | CEEJAY's bot could not be reached or was too busy, and nothing was changed. The body includes retryAfter, in seconds: retry after that many seconds |
504 | bot_timeout | The answer did not arrive in time, and the request may or may not have been done. Send the same request again: it is safe to repeat | The request timed out, so it is not known whether it was processed. Retry the same request: it is safe to repeat |
Every error body also includes requestId, and a 400 with the code bad_request identifies the invalid field in field. Match on code; message text can change.
The errors every request of a game shares (the key, the state of the game, the origin, 405, 429, 500) are on the Errors page, and the errors specific to the game loop are under Codes of the game loop.

