Elements Manual
Elements 2 Manual
Elements 2 Manual
  • Welcome 👋
  • QUICK START
    • Elements in Five Minutes or Less
  • General
    • General Concepts
    • N-Tier Architecture
    • Security Model
  • SCRIPTING ENGINE
    • Scripting Engine Overview
      • Intro to Resources and Cloud Functions
      • Horizontal Scaling Model
      • Database Access
      • Server-to-Server API Calls
      • Deploy Cloud Functions via Git
      • Creating and Destroying Resources
      • Cross-Resource Invocation
      • Indexing Resources
      • Coroutines
      • Manifest
  • Core Features
    • Core API Overview
    • Sessions
    • Applications
      • Facebook Application Configuration
      • Firebase Application Configuration
      • Amazon GameOn Application Configuration
      • iOS Application Configuration
      • Android Application Configuration
      • Matchmaking Application Configuration [deprecated]
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Leaderboards
    • Matchmaking
    • Followers
    • Friends
    • Reward Issuance
    • Push Notifications
    • Auth Schemes
    • Save Data
    • Schemas and Metadata Specifications
    • Queries
      • Base Query Syntax
      • Boolean Queries
      • Object Graph Navigation
      • Advanced Operators
        • .ref
        • .name
  • Web 3
    • Omni Chain Support
    • Vaults
    • Wallets
    • Smart Contracts
      • Smart Contracts: Ethereum
      • Smart Contracts: Flow
      • Smart Contracts: Solana
      • Smart Contracts: Neo
    • Know Your Customer
      • Formidium
  • CONFIGURATION
    • Using the Web Console
    • iOS and Android Product Bundles
    • Direct Database Access and Batch Configuration
  • UNITY PLUG-INS
    • Unity Plugin
    • Content Delivery Management and Unity CDN Plugin
  • DEPLOYMENT
    • Deployment Overview
      • Docker Containers
      • AWS Deployment
      • Standalone docker-compose
  • LUA SAMPLES
    • lua Samples
      • main.lua
      • event.lua
      • hello_world.lua
      • model.lua
      • startup.lua
      • HTTP Manifest
        • Example endpoint handler
        • Example operations table
  • RESTful APIs
    • Swagger and Swagger UI
    • Elements 3.0.X (Preview)
      • Applications
      • Friends and Followers
      • Digital Goods and Inventory
      • Leaderboards
      • Missions and Rewards
      • User and Profiles
      • Save Data
      • Custom Metadata
Powered by GitBook
On this page
  1. RESTful APIs
  2. Elements 3.0.X (Preview)

Digital Goods and Inventory

PreviousFriends and FollowersNextLeaderboards

Last updated 8 months ago

Retrieves a single Item by id or by name

get

Looks up an item by the passed in identifier

Authorizations
Path parameters
identifieranyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/item/{identifier} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Gets inventory item for the specified item

get

Gets the first (primary) inventory item for the specified item

Authorizations
Path parameters
inventoryItemIdanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/inventory/advanced/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Delete the inventory item as identified by the given item name/id

delete

Delete the inventory item as identified by the given item name/id

Authorizations
Path parameters
inventoryItemIdanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
delete
DELETE /api/rest/inventory/advanced/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Search inventory items

get

Searches all inventory items in the system and returns the metadata for all matches against the given search filter.

Authorizations
Query parameters
offsetanyOptionalDefault: 0
countanyOptionalDefault: 20
userIdanyOptional
searchanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/inventory/advanced HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Search inventory items

get

Searches all inventory items in the system and returns the metadata for all matches against the given search filter.

Authorizations
Query parameters
offsetanyOptionalDefault: 0
countanyOptionalDefault: 20
userIdanyOptional
profileIdanyOptional
searchanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/inventory/distinct HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Delete the inventory item as identified by the given item name/id

delete

Delete the inventory item as identified by the given item name/id

Authorizations
Path parameters
distinctInventoryItemIdanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
delete
DELETE /api/rest/inventory/distinct/{distinctInventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Gets inventory item for the specified item

get

Gets the first (primary) inventory item for the specified item

Authorizations
Path parameters
inventoryItemIdanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/inventory/distinct/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Gets inventory item for the specified item

get

Gets the first (primary) inventory item for the specified item

Authorizations
Path parameters
inventoryItemIdanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/inventory/simple/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Delete the inventory item as identified by the given item name/id

delete

Delete the inventory item as identified by the given item name/id

Authorizations
Path parameters
inventoryItemIdanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
delete
DELETE /api/rest/inventory/simple/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Search inventory items

get

Searches all inventory items in the system and returns the metadata for all matches against the given search filter.

Authorizations
Query parameters
offsetanyOptionalDefault: 0
countanyOptionalDefault: 20
userIdanyOptional
searchanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/inventory/simple HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}
  • GETRetrieves all Items
  • POSTCreates a new digital Item
  • GETRetrieves a single Item by id or by name
  • PUTUpdates a single Item
  • GETGets inventory item for the specified item
  • PUTUpdates an inventory item for the specified item
  • DELETEDelete the inventory item as identified by the given item name/id
  • PATCHAdjust the quantity of the inventory item for the specified item.
  • GETSearch inventory items
  • POSTCreate an inventory item for the specified item
  • GETSearch inventory items
  • POSTCreate an inventory item for the specified item
  • PUTUpdates an inventory item for the specified item
  • DELETEDelete the inventory item as identified by the given item name/id
  • GETGets inventory item for the specified item
  • GETGets inventory item for the specified item
  • PUTUpdates an inventory item for the specified item
  • DELETEDelete the inventory item as identified by the given item name/id
  • PATCHAdjust the quantity of the inventory item for the specified item.
  • GETSearch inventory items
  • POSTCreate an inventory item for the specified item

Retrieves all Items

get

Searches all items and returns all matching items, filtered by the passed in search parameters. If multiple tags are specified, then all items that contain at least one of the passed in tags is returned.

Authorizations
Query parameters
offsetanyOptionalDefault: 0
countanyOptionalDefault: 20
tagsanyOptional
categoryanyOptional
searchanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/item HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Creates a new digital Item

post

Supplying an item object, this will create a new item with a newly assigned unique id. The Item representation returned in the response body is a representation of the Item as persisted with a unique identifier signed and with its fields properly normalized. The supplied item object submitted with the request must have a name property that is unique across all items.

Authorizations
Body
nameanyRequiredPattern: [^_]\w+
displayNameanyRequired
descriptionanyRequired
categoryundefined · enumRequiredPossible values:
tagsanyOptional
metadataSpecIdanyOptional
metadataanyOptional
publicVisibleanyOptional
metadataSpecanyWrite-onlyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/item HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 162

{
  "name": null,
  "displayName": null,
  "description": null,
  "category": "FUNGIBLE",
  "tags": [],
  "metadataSpecId": null,
  "metadata": null,
  "publicVisible": null,
  "metadataSpec": null
}
{
  "code": "text",
  "message": "text"
}

Updates a single Item

put

Supplying an item, this will update the Item identified by the identifier in the path with contents from the passed in request body.

Authorizations
Path parameters
identifieranyRequired
Body
nameanyRequiredPattern: [^_]\w+
displayNameanyRequired
descriptionanyRequired
tagsanyOptional
metadataanyOptional
publicVisibleanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
put
PUT /api/rest/item/{identifier} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 427

{
  "name": null,
  "displayName": null,
  "description": null,
  "tags": [],
  "metadataSpec": {
    "id": null,
    "name": null,
    "type": "STRING",
    "properties": [
      {
        "name": null,
        "displayName": null,
        "type": "STRING",
        "required": null,
        "placeholder": null,
        "defaultValue": null,
        "properties": [
          {
            "name": null,
            "displayName": null,
            "type": "STRING",
            "required": null,
            "placeholder": null,
            "defaultValue": null,
            "properties": "[Circular Reference]"
          }
        ]
      }
    ]
  },
  "metadata": null,
  "publicVisible": null
}
{
  "code": "text",
  "message": "text"
}

Updates an inventory item for the specified item

put

Updates an inventory item for the specified item

Authorizations
Path parameters
inventoryItemIdanyRequired
Body
quantityany · min: 1Optional

The quantity of the Item in inventory

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
put
PUT /api/rest/inventory/advanced/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 17

{
  "quantity": null
}
{
  "code": "text",
  "message": "text"
}

Adjust the quantity of the inventory item for the specified item.

patch

Adjust the quantity of the first (primary) inventory item for the specified item. This implicitly will create the InventoryItem if it does not exist. The inventory item value

Authorizations
Path parameters
inventoryItemIdanyRequired
Body
userIdanyRequired

The User whose inventory to modify.ß

quantityDeltaanyRequired

The delta to be applied to the inventory item quantity (positive or negative)

priorityanyOptional

The priority slot for the item.

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
patch
PATCH /api/rest/inventory/advanced/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 52

{
  "userId": null,
  "quantityDelta": null,
  "priority": null
}
{
  "code": "text",
  "message": "text"
}

Create an inventory item for the specified item

post

Create an inventory item for the specified item

Authorizations
Body
userIdanyRequired

The User ID

itemIdanyRequired

The item to reference.

quantityanyOptional

The quantity of the Item in inventory

priorityanyOptional

The priority slot for the item.

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/inventory/advanced HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 61

{
  "userId": null,
  "itemId": null,
  "quantity": null,
  "priority": null
}
{
  "code": "text",
  "message": "text"
}

Create an inventory item for the specified item

post

Create an inventory item for the specified item

Authorizations
Body
itemIdanyRequired

The digital goods item id.

userIdanyOptional

The id of the User owning this inventory item id.

profileIdanyOptional

The the profileid of hte Profile owning this inventory item.

metadataanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/inventory/distinct HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 62

{
  "itemId": null,
  "userId": null,
  "profileId": null,
  "metadata": null
}
{
  "code": "text",
  "message": "text"
}

Updates an inventory item for the specified item

put

Updates an inventory item for the specified item

Authorizations
Path parameters
distinctInventoryItemIdanyRequired
Body
userIdanyOptional

The id of the User owning this inventory item id.

profileIdanyOptional

The the profile id of hte Profile owning this inventory item.

metadataanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
put
PUT /api/rest/inventory/distinct/{distinctInventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 48

{
  "userId": null,
  "profileId": null,
  "metadata": null
}
{
  "code": "text",
  "message": "text"
}

Updates an inventory item for the specified item

put

Updates an inventory item for the specified item

Authorizations
Path parameters
inventoryItemIdanyRequired
Body
quantityany · min: 1Optional

The quantity of the Item in inventory

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
put
PUT /api/rest/inventory/simple/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 17

{
  "quantity": null
}
{
  "code": "text",
  "message": "text"
}

Adjust the quantity of the inventory item for the specified item.

patch

Adjust the quantity of the first (primary) inventory item for the specified item. This implicitly will create the InventoryItem if it does not exist. The inventory item value

Authorizations
Path parameters
inventoryItemIdanyRequired
Body
userIdanyRequired

The User whose inventory to modify.ß

quantityDeltaanyRequired

The delta to be applied to the inventory item quantity (positive or negative)

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
patch
PATCH /api/rest/inventory/simple/{inventoryItemId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 36

{
  "userId": null,
  "quantityDelta": null
}
{
  "code": "text",
  "message": "text"
}

Create an inventory item for the specified item

post

Create an inventory item for the specified item

Authorizations
Body
userIdanyRequired

The User ID

itemIdanyRequired

The item to reference.

quantityany · min: 1Optional

The quantity of the Item in inventory

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/inventory/simple HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 45

{
  "userId": null,
  "itemId": null,
  "quantity": null
}
{
  "code": "text",
  "message": "text"
}