Playdapp Developers V2
  • Introduction
  • Prerequisites
  • QuickStart
  • API Guide
    • Overview
    • Authentication
    • HTTP Status Code
    • Diagrams
      • Basic
      • Shop in Shop
  • API Reference
    • APIs Overview
    • Basic
    • Shop in Shop
      • Base
      • P2E
Powered by GitBook
On this page
  • List User's staking information
  • List User's staking information
  • Reward Payment
  • Reward Payment
  1. API Reference
  2. Shop in Shop

P2E

Describes APIs provided to partners who want to use Item Manager of PlayDapp's Shop in Shop service that supports P2E-related functions (staking, reward).

PreviousBase

Last updated 2 years ago

This is a list of APIs that can request P2E-related integration.

Game company can specify the description for staking and the reward currency through PlayDapp Developers Console, but the policy for staking and reward payment must be managed by the game company.

Users' staking information for reward payment management can be inquired through the API.

List User's staking information

This API is used by game company to look up a list of users' staking information.

Refer to diagram .

List User's staking information

GET https://{itemManagerHost}/v1/staking

This API is used by game company to look up a list of users' staking information.

In order to serve P2E, game company must manage a reward payment policy based on users' staking status.

Query Parameters

Name
Type
Description

userIds*

Array

Array<String>

Max length of userIds array: 300

User ID list managed by the game server

The userIds query parameter can be passed in the form below.

url?userIds=1&userIds=2

Headers

Name
Type
Description

svc-api-key*

String

svc-api-key is issued for each registered game.

signature*

String

timestamp*

String

The time at which the request was sent, set to a Unix Epoch Timestamp value.

nonce*

String

Random string of 8 characters, composed of uppercase or lowercase alphabets and numbers. A nonce can't be reused within 20 seconds after the successful request.

{
  "result": true,
  "data": {
    "total": 2
    "list": [
      {
        "walletAddress": "0xfadd54f344d92e30828674545A3e18f5bdd86849",
        "userId": "111",
        "staking": [
          {
            "contractAddress": "0xeD35316660Bb0919800539c65eAD62Ba58e5D0eA",
            "name": "SCS",
            "tokens": [
              { "tokenId": "10000001", timestamp: "1664158671000", "metadata": "" },
              { "tokenId": "10000002", timestamp: "1664158671000", "metadata": "" }
            ],
          },
          {
            "contractAddress": "0xb0BE59330C66FF9c9E487A6b4c72E57B7070FcA5",
            "name": "PCS",
            "tokens": [
              { "tokenId": "10000003", timestamp: "1664158671000", "metadata": "" },
              { "tokenId": "10000004", timestamp: "1664158671000", "metadata": "" }
            ],
          },
        ],
      },
      {
        "walletAddress": "0x0add54f344d92e30828674545A3e18f5bdd86841",
        "userId": "123",
        "staking": [
          {
            "contractAddress": "0xeD35316660Bb0919800539c65eAD62Ba58e5D0eA",
            "name": "SCS",
            "tokens": [
              { "tokenId": "10000004", timestamp: "1664158671000", "metadata": "" },
              { "tokenId": "10000005", timestamp: "1664158671000", "metadata": "" }
            ],
          },
        ],
      },
    ]
  }
}

Reward Payment

This API used to provides P2E reward to users.

Reward Payment

POST https://{itemManagerHost}/v1/reward

This API used to provides P2E reward to users.

Playdapp does not manage any policy to pay reward from the game company, and it must be managed by the game company according to the user's staking status value.

After checking the user's reward list managed by the game company, the game company can pay the user a reward by calling the Reward Payment API when the game company needs to pay the user a reward.

Using the hash value sent as a response from the Reward Payment API, you can check whether the reward payment was successful by retrieving the transaction hash value through Explorer.

Headers

Name
Type
Description

svc-api-key*

String

svc-api-key is issued for each registered game.

signature*

String

timestamp

String

The time at which the request was sent, set to a Unix Epoch Timestamp value.

nonce

String

Random string of 8 characters, composed of uppercase or lowercase alphabets and numbers. A nonce can't be reused within 20 seconds after the successful request.

Request Body

Name
Type
Description

rewards*

Array

Array<Reward>

Max length of rewards array: 300

Reward: {

userId: String,

amount: Number

}

userId: User ID managed by the game server

amount: The amount of rewards to be paid. The unit of quantity is the unit of reward currency set in PlayDapp Developers Console.

key*

string

Required for duplicate processing when registering a reward and for checking the reward by the service company. You can freely create the values you need. Ex) ${date}-${season}-${amount}

{
  "result": true,
  "data": {
    "hash": "0xdea459a663ec5c70fcd07a3e04f7fde703e4626f3d3a55485436bc5603dfcce9"
  }
}

The result of an API request signed by a secret key issued per registered game. For more details, refer to .

Refer to diagram .

The result of an API request signed by a secret key issued per registered game. For more details, refer to .

Authentication
Authentication
List User's staking information
Staking & Lookup
Reward Payment