List the shop
List the items this game may sell, with whether the connected player can buy each one now.
GET /v1/player/shop · for player session
Use it to draw the game's shop. It lists the items this game may sell, in the shop's own order, and prices are in the community's coins. Send the player session as the bearer token. 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. The community's economy must also be enabled: otherwise the response is 409 with the code economy_disabled.
Query parameters
Prop
Type
Returns
data is a list of items. The response also includes page, with nextCursor and limit.
Prop
Type
memberState contains:
Prop
Type
Which items a game sells
A game sells only the items the community's team has added to its allow list, and only of the item types the game is configured to sell. A game sells nothing until the team adds items, so an empty list is normal. An item that is not on the list cannot be bought through the game, and Buy a shop item responds as if the item does not exist. When the game's daily spending limit is 0, every item reads canBuy: false.
How an item reaches the player
deliveryMode | How |
|---|---|
instant | Immediately, when the player buys it |
claim | The player claims it after buying, because it asks for a selection or a name. See Claim an item |
team | The community's team fulfils it |
No delivery details are returned.
The price
A price can change while the player is looking at the shop. Read the shop again before a purchase and send the price you displayed as expectedPrice: if the price has changed by then, nothing is bought.
Example
curl "https://ceejay.communitystudios.xyz/api/v1/player/shop?limit=20" \
-H "Authorization: Bearer $CEEJAY_PLAYER_SESSION"The TypeScript example uses connect.hub.listShop 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 full response below, with the list in data.
{
"success": true,
"data": [
{
"id": 7,
"name": "Gold skin",
"description": "A golden kit for your club.",
"price": 500,
"imageUrl": "https://res.cloudinary.com/example/gold.png",
"itemType": "api",
"deliveryMode": "instant",
"stockLeft": 20,
"limitLabel": "1 per member",
"availabilityLabel": null,
"eligibilityLabels": [
"Level 5"
],
"question": null,
"titleMaxLength": null,
"requiredPlatforms": [],
"memberState": {
"canBuy": true,
"reason": null,
"availableAt": null
}
}
],
"page": {
"nextCursor": null,
"limit": 50
}
}Limits
120 reads a minute for one player session. 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 | limit must be a whole number from 1 to 100 | limit is above 100, negative, a fraction or text |
400 | bad_request | cursor is not one this list gave. Send page.nextCursor as it was answered | cursor was not issued by this list |
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 |
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 | economy_disabled | The community has switched its economy off | The community has disabled its economy |
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.

