# Base

### Get Browser Token

Get an authentication token to open a browser.

Refer to diagram [**Mapping Item & Mint NFT**](/api-guide/diagrams/shop-in-shop.md#mapping-item-and-mint-nft)

## Get an authentication token to open a browser.

<mark style="color:green;">`POST`</mark> `https://{shopInShopHost}/v1/browser/token`

Get an authentication token (One-time Token) to open the Item Manager browser in the partner service app or web.

The oneTimeToken received as a response value can be used only once when accessing Item Manager through a browser, and a 401 response is received when accessing with the same token afterwards.

#### Headers

| Name                                          | Type   | Description                                 |
| --------------------------------------------- | ------ | ------------------------------------------- |
| sis-api-key<mark style="color:red;">\*</mark> | String | This is the API KEY granted to the partner. |

#### Request Body

| Name                                            | Type   | Description                                                                                                     |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| partnerUserId<mark style="color:red;">\*</mark> | String | <p>User ID managed by the partner</p><p>If the user is logged in on partner service, userId must be passed.</p> |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "result": true,
  "data": {
    "oneTimeToken": "xxxxxxxxx"
  }
}
```

{% endtab %}
{% endtabs %}

### Mapping Item

Mapping item to be NFT-fy to user.

Refer to diagram [**Mapping Item & Mint NFT**](/api-guide/diagrams/shop-in-shop.md#mapping-item-and-mint-nft)

## Mapping item to be NFT-fy to users.

<mark style="color:green;">`POST`</mark> `https://{itemManagerHost}/v1/items`

This is the process of mapping item information that the user can issue with NFT to the user.

After this process, the status value of the item must not be changed, so some games call it sealing.

#### Headers

| Name                                          | Type   | Description                                                                                                                                                                                                             |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| svc-api-key<mark style="color:red;">\*</mark> | String | svc-api-key is issued for each registered service(ex> game) of partner.                                                                                                                                                 |
| signature<mark style="color:red;">\*</mark>   | String | <p>The result of an API request signed by a secret key issued per registered service(ex> game) of partner.<br>For more details, refer to <a href="/pages/ZpcuBd5DL9Dl3Encf1XR"><strong>Authentication</strong></a>.</p> |
| timestamp<mark style="color:red;">\*</mark>   | String | The time at which the request was sent, set to a Unix Epoch Timestamp value.                                                                                                                                            |
| nonce<mark style="color:red;">\*</mark>       | 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| itemId<mark style="color:red;">\*</mark>            | String | <p>Item ID managed by the service(ex> game) server.<br>ItemCode is a value that identifies the Item's Type. ItemId is a unique ID given to each item for ItemCode.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| userId<mark style="color:red;">\*</mark>            | String | User ID managed by the service(ex> game) server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| serviceContractId<mark style="color:red;">\*</mark> | Number | The contract ID registered for the item transaction for the registered service(ex> game) of partner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| itemCode<mark style="color:red;">\*</mark>          | String | <p>Code of item registered in PlayDapp Developers Console.<br>ItemCode is a value that identifies the Item's Type. ItemId is a unique ID given to each item for ItemCode.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| metadata<mark style="color:red;">\*</mark>          | Object | <p>{</p><p>  name?: String</p><p>  image?: String</p><p>  description?: String</p><p>  attributes!: Array\<Attribute></p><p>}</p><p></p><p>name (optional)</p><p>: The name for the item.<br>If omitted, the name entered when registering the item on the PlayDapp Developers Console is used.</p><p></p><p>image (optional)</p><p>: The image url for the item.<br>If omitted, the image url entered when registering the item on the PlayDapp Developers Console is used.</p><p></p><p>description (optional)</p><p>: The description for the item.<br>If omitted, the description entered when registering the item on the PlayDapp Developers Console is used.</p><p></p><p>attributes (required)</p><p>: Define attributes (skills, levels, etc.) to be given to items registered through PlayDapp Developers Console. These attributes are used as metadata for the NFT. </p><p>Metadata follows OpenSea standard type, please refer to <a href="https://docs.opensea.io/docs/metadata-standards#attributes"><strong>Attributes topic in the OpenSea Metadata document.</strong></a></p> |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "result": true,
  "data": {
    "userId": "1",  // User ID managed by the service(ex> game) server
    "serviceContractId": 1,  // The contract ID registered for the item transaction for the registered service(ex> game) of partner
    "itemCode": "1",  // Code of item registered in PlayDapp Developers Console
    "itemId": "9988",  // Item ID managed by the service(ex> game) server
    "metadata": {
      "name": "BRAM SR",  // Name of item registered in PlayDapp Developers Console
      "image": "https://presale-asset.playdapp.com/token_thumb/playz_bram_sr.png",  // Image of item registered in PlayDapp Developers Console
      "description": "this item is BRAM SR for pet!",  // Description of item registered in PlayDapp Developers Console
      "attributes": [  // Attributes to be used as NFT metadata 
        {
          "trait_type": "Base", 
          "value": "Starfish"
        }
      ]
    }
    "status": "mapping"
  }
}
```

{% endtab %}
{% endtabs %}

### List Mapped Items

List item information mapped to the user via service.

## List mapped item info

<mark style="color:blue;">`GET`</mark> `https://{itemManagerHost}/v1/items`

#### Query Parameters

| Name   | Type   | Description                                                                                                                      |
| ------ | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| userId | String | User ID managed by the service(ex> game) server                                                                                  |
| status | Enum   | <p>Default: "burned"<br>\[Available enum values]<br>- "burned"<br>(Currently, only items in burn state can be searched for.)</p> |
| offset | number | Default: 0                                                                                                                       |
| limit  | number | Default: 100                                                                                                                     |

#### Headers

| Name                                          | Type   | Description                                                                                                                                                                                                             |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| svc-api-key<mark style="color:red;">\*</mark> | String | svc-api-key is issued for each registered service(ex> game) of partner.                                                                                                                                                 |
| signature<mark style="color:red;">\*</mark>   | String | <p>The result of an API request signed by a secret key issued per registered service(ex> game) of partner.<br>For more details, refer to <a href="/pages/ZpcuBd5DL9Dl3Encf1XR"><strong>Authentication</strong></a>.</p> |
| timestamp<mark style="color:red;">\*</mark>   | String | The time at which the request was sent, set to a Unix Epoch Timestamp value.                                                                                                                                            |
| nonce<mark style="color:red;">\*</mark>       | 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.                                                        |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
  "result": true,
  "data": {
    "total": 2,
    "list": [
      {
        "userId": "1",  // User ID managed by the service(ex> game) server
        "serviceContractId": 1,  // The contract ID registered for the item transaction for the registered service(ex> game) of partner
        "itemCode": "1",  // Code of item registered in PlayDapp Developers Console
        "itemId": "9988",  // Item ID managed by the service(ex> game) server
        "metadata": {
          "name": "BRAM SR",  // Name of item registered in PlayDapp Developers Console
          "image": "https://presale-asset.playdapp.com/token_thumb/playz_bram_sr.png",  // Image of item registered in PlayDapp Developers Console
          "description": "this item is BRAM SR for pet!",  // Description of item registered in PlayDapp Developers Console
          "attributes": [  // Attributes to be used as NFT metadata 
            {
              "trait_type": "Base", 
              "value": "Starfish"
            }
          ]
        }
        "status": "burned",
        "type": "item"
      },
      {
        "userId": "2",  // User ID managed by the service(ex> game) server
        "serviceContractId": 7,  // The contract ID registered for the item transaction for the registered service(ex> game) of partner
        "itemCode": "200000123",  // Code of item registered in PlayDapp Developers Console
        "itemId": "1-1000000004-1670397050832",  // Item ID managed by the service(ex> game) server
        "metadata": {
          "name": "Drops item",  // Name of item registered in PlayDapp Developers Console
          "image": "https://presale-asset.playdapp.com/token_thumb/playz_bram_sr_2.png",  // Image of item registered in PlayDapp Developers Console
          "description": "this item is Drops item",  // Description of item registered in PlayDapp Developers Console
          "attributes": [  // Attributes to be used as NFT metadata 
            {
              "trait_type": "Base", 
              "value": "Starfish"
            }
          ]
        }
        "status": "burned",
        "type": "drops"
      }
    ],
  }
}
```

{% endtab %}
{% endtabs %}

### Un-mapping Mapped Item

This API is called when a burned NFT item mapped to the user is re-itemized in the service(ex> game) of partner.

Refer to diagram [**Burn NFT & Convert to In-Game Item**](/api-guide/diagrams/shop-in-shop.md#burn-nft-and-convert-to-in-game-item)

## This API is called when a burned NFT item is re-itemized in the service(ex> game)

<mark style="color:red;">`DELETE`</mark> `https://{itemManagerHost}/v1/items`

If the API responds normally, the status of the item is changed to "item".

Afterwards, to issue the item to a specific user again, the Mapping Item API must be called.

#### Query Parameters

| Name                                                | Type   | Description                                                                                                                                                                    |
| --------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| userId<mark style="color:red;">\*</mark>            | String | User ID managed by the service(ex> game) server                                                                                                                                |
| serviceContractId<mark style="color:red;">\*</mark> | Number | The contract ID registered for the item transaction for the registered service(ex> game) of partner                                                                            |
| itemCode<mark style="color:red;">\*</mark>          | String | <p>Code of item registered in PlayDapp Developers Console.<br>ItemCode is a value that identifies the Item's Type. ItemId is a unique ID given to each item for ItemCode.</p> |
| itemId<mark style="color:red;">\*</mark>            | String | <p>Item ID managed by the service(ex> game) server.<br>ItemCode is a value that identifies the Item's Type. ItemId is a unique ID given to each item for ItemCode.</p>         |

#### Headers

| Name                                          | Type   | Description                                                                                                                                                                                                             |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| svc-api-key<mark style="color:red;">\*</mark> | String | svc-api-key is issued for each registered service(ex> game) of partner.                                                                                                                                                 |
| signature<mark style="color:red;">\*</mark>   | String | <p>The result of an API request signed by a secret key issued per registered service(ex> game) of partner.<br>For more details, refer to <a href="/pages/ZpcuBd5DL9Dl3Encf1XR"><strong>Authentication</strong></a>.</p> |
| timestamp<mark style="color:red;">\*</mark>   | String | The time at which the request was sent, set to a Unix Epoch Timestamp value.                                                                                                                                            |
| nonce<mark style="color:red;">\*</mark>       | 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.                                                        |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "result": true,
  "data": {
    "userId": "1",  // User ID managed by the service(ex> game) server
    "serviceContractId": 1,  // The contract ID registered for the item transaction for the registered service(ex> game) of partner
    "itemCode": "1",  // Code of item registered in PlayDapp Developers Console
    "itemId": "9988",  // Item ID managed by the service(ex> game) server
    "metadata": {
      "name": "BRAM SR",  // Name of item registered in PlayDapp Developers Console
      "image": "https://presale-asset.playdapp.com/token_thumb/playz_bram_sr.png",  // Image of item registered in PlayDapp Developers Console
      "description": "this item is BRAM SR for pet!",  // Description of item registered in PlayDapp Developers Console
      "attributes": [  // Attributes to be used as NFT metadata 
        {
            "trait_type": "Base", 
            "value": "Starfish"
        }
      ]
    }
    "status": "item"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.developer.playdapp.com/api-reference/shop-in-shop/base.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
