Inventories

Inventories are where items a player obtains within the app are stored, some can be obtained through coin codes and others through purchasing items from a store. On this page, we'll dive into the different inventory endpoints you can use to manage inventories programmatically. We'll look at how to retrieve, and update inventories.

The inventory model

The inventory model contains all the information about your player's inventory, such as their items.

Properties

  • Name
    id
    Type
    integer
    Description

    Unique identifier for the inventory.

  • Name
    head_item
    Type
    nullable object
    Description

    Head item for the inventory.

  • Name
    face_item
    Type
    nullable object
    Description

    Face item for the inventory.

  • Name
    neck_item
    Type
    nullable object
    Description

    Neck item for the inventory.

  • Name
    body_item
    Type
    nullable object
    Description

    Body item for the inventory.

  • Name
    hand_item
    Type
    nullable object
    Description

    Hand item for the inventory.

  • Name
    skin_item
    Type
    object
    Description

    Skin item for the inventory.

  • Name
    pin_item
    Type
    nullable object
    Description

    Pin item for the inventory.

  • Name
    background_item
    Type
    object
    Description

    Background item for the inventory.


GET/me/inventory/items

Retrieve the inventory's items

This endpoint allows you to retrieve the items in your in-game inventory.

Required attributes

  • Name
    item_type_id
    Type
    integer
    Description

    The item type id of items to retrieve.

Optional attributes

  • Name
    page
    Type
    integer
    Description

    The page of items to retrieve.

Request

GET
/me/inventory/items
curl https://prod-app.themeparkshark.com/api/me/inventory/items?item_type_id=1?page=1 \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Response

{
  "data": [
    {
      "id": 1,
      "item_type": {
        "id": 1
      },
      "name": "Captain Magenta's Hat",
      "icon_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png",
      "is_coin_code_item": false
    },
    // ...
  ],
  "links": {
    "first": "https://prod-app.themeparkshark.com/api/me/inventory/items?page=1",
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "path": "http://prod-app.themeparkshark.com/api/me/inventory/items",
    "per_page": 15,
    "to": 3
  }
}

PUT/me/inventory

Update a player's inventory item

This endpoint allows you to update your in-game inventory with an item or remove that item. Only items that the user has redeemed or purchased can the inventory be updated with.

Request

PUT
/me/inventory
curl -X PUT https://prod-app.themeparkshark.com/api/me/inventory \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
-d item_id=1

Response

{
  "data": {
    "id": 1,
    "head_item": {
      "id": 1,
      "name": "Captain Magenta's Hat",
      "paper_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png"
    },
    "face_item": null,
    "neck_item": null,
    "body_item": {
      "id": 2,
      "name": "Black TPS T-Shirt",
      "paper_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png"
    },
    "hand_item": {
      "id": 3,
      "name": "Lollipop",
      "paper_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png"
    },
    "skin_item": {
      "id": 3,
      "name": "Lollipop",
      "paper_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png"
    },
    "pin_item": {
      "id": 4,
      "name": "100 Castle Celebration Pin",
      "icon_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png"
    },
    "background_item": {
      "id": 5,
      "name": "Blue Snow BG",
      "paper_url": "https://assets.themeparkshark.com/mobile/production/assets/image.png"
    }
  }
}

Was this page helpful?