Using the store in your game
Getting Available Store Items¶
Scope¶
Get all the store items from a specific game.
Method¶
Attributes¶
Name | Type | Required | Description |
---|---|---|---|
gameId |
Value found on your GameFuse.co dashboard | ||
gameToken |
string | Yes | API token found on your GameFuse.co dashboard |
Data (payload)¶
None
Headers¶
None
Responses¶
HTTP status code | content-type | Description |
---|---|---|
200 |
application/json | Object containing the game store items |
404 |
text/plain | Failed to fetch game variables. gameId or gameToken might be wrong |
500 |
text/plain | Unknown server error |
Response object¶
Attribute name | Type | Description |
---|---|---|
store_items |
list | A list of objects where each one represents the fields of a store item |
Example¶
Purchasing a Store Item¶
Scope¶
Purchase a store item.
Important
A user must be signed in and have enough credits to call this endpoint!
Method¶
Attributes¶
Name | Type | Required | Description |
---|---|---|---|
signedInUserId |
integer | Yes | The user id value from the GameFuse game dashboard |
Data (payload)¶
Name | Type | Required | Description |
---|---|---|---|
store_item_id |
integer | Yes | Id of the store item |
Headers¶
Name | Type | Description |
---|---|---|
authentication-token |
string | Found in sign-in or sign-up responses. This token is used for user sessions |
Responses¶
HTTP status code | content-type | Description |
---|---|---|
200 |
application/json | Object containing the game store items belonging to the user and the credits |
403 |
text/plain | Not enough credits or item already purchased |
404 |
text/plain | Item not found |
500 |
text/plain | Unknown server error |
Response object¶
Attribute name | Type | Description |
---|---|---|
credits |
integer | The user's remaining credits |
store_items |
list | A list of objects where each one represents the fields of a store item purchased by the user |
Example¶
Example
cURL¶
curl --request POST \
--header "Content-Type: application/json" \
--header "authentication-token: abc123" \
--data '{"store_item_id": 337}' \
'https://gamefuse.co/api/v3/users/1/purchase_game_user_store_item'
Response¶
Removing a Store Item¶
Scope¶
Revoke a store item purchase.
Important
A user must be signed in and have enough credits to call this endpoint!
Method¶
Attributes¶
Name | Type | Required | Description |
---|---|---|---|
signedInUserId |
integer | Yes | The user id value from the GameFuse game dashboard |
storeItemId |
integer | Yes | Id of the store item to remove |
Data (payload)¶
None
Headers¶
Name | Type | Description |
---|---|---|
authentication-token |
string | Found in sign-in or sign-up responses. This token is used for user sessions |
Responses¶
HTTP status code | content-type | Description |
---|---|---|
200 |
application/json | Object containing the game store items belonging to the user and the credits |
404 |
text/plain | Item not found or not previously purchased |
500 |
text/plain | Unknown server error |
Response object¶
Attribute name | Type | Description |
---|---|---|
credits |
integer | The user's remaining credits |
store_items |
list | A list of objects where each one represents the fields of a store item purchased by the user |
Example¶
Example
cURL¶
curl --request GET \
--header "authentication-token: abc123" \
"https://gamefuse.co/api/v3/users/1/purchase_game_user_store_item?store_item_id=337"
Response¶
Getting Purchased Store Items¶
Scope¶
Get all of the user's purchased store items.
Important
A user must be signed in and have enough credits to call this endpoint!
Method¶
Attributes¶
Name | Type | Required | Description |
---|---|---|---|
signedInUserId |
integer | Yes | The user id value from the GameFuse game dashboard |
Data (payload)¶
None
Headers¶
Name | Type | Description |
---|---|---|
authentication-token |
string | Found in sign-in or sign-up responses. This token is used for user sessions |
Responses¶
HTTP status code | content-type | Description |
---|---|---|
200 |
application/json | Object containing the game store items belonging to the user and the credits |
500 |
text/plain | Unknown server error |
Response object¶
Attribute name | Type | Description |
---|---|---|
credits |
integer | The user's remaining credits |
store_items |
list | A list of objects where each one represents the fields of a store item purchased by the user |