# NMKR Payによる二次販売

NMKR Studio API を使用して、すでに鋳造されたトークンの二次販売を設定できます。 これにより、NMKR Pay を介して指定された価格でトークンを出品し、販売することができます。

{% hint style="info" %}
売却できるのは自分が所有しているトークンのみであることに注意してください。 後で、上場プロセス中にスマート コントラクトでこのトークンをロックするように求められます。
{% endhint %}

### APIエンドポイント

\
&#x20;すでに鋳造された NFT を販売するには、次の API エンドポイントを介して NMKR Studio で支払いトランザクションを作成する必要があります。

```
/v2/CreatePaymentTransaction
```

#### ペイロード

支払いトランザクションを作成するペイロードは次のようになります。 認証トークン/API キーはヘッダーに指定する必要があります。 (整数としての Lovelace のポリシー ID、トークン名、価格) を適切な情報に置き換えてください。

```json
{
    "projectUid": "176fb45d-bbc9-4d9a-9374-a6efe442874d",
    "paymentTransactionType": "Smartcontract_directsale",
    "customProperties": null,
    "transactionParameters": [
        {
            "tokencount": 1,
            "policyId": "<PolicyId>",
            "tokenname": "<TokenName>"
        }
    ],
    "paymentgatewayParameters": null,
    "decentralParameters": null,
    "auctionParameters": null,
    "directSaleParameters": {
        "priceInLovelace": <Price in Lovelace as integer>
    },
    "customerIpAddress": "0.0.0.0",
    "paymentTransactionNotifications": null,
    "referer": null
}
```

{% hint style="info" %}
上記のペイロードの projectUid には、NMKR Studio の任意のプロジェクトのランダムな UID を指定できます。これは NMKR Pay を利用するためにのみ必要であり、リストされるトークンとは関係ありません。ここでのプロセスを容易にするために、ランダムな Uid をすでに追加しています。
{% endhint %}

#### Curl 例

```json
curl -X 'POST' \
  'https://studio-api.nmkr.io/v2/CreatePaymentTransaction' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer 1ac2cb0abea146xyzxyz8a90701dad311c' \
  -H 'Content-Type: application/json' \
  -d '{
    "projectUid": "176fb45d-bbc9-4d9a-9374-a6efe442874d",
    "paymentTransactionType": "Smartcontract_directsale",
    "customProperties": null,
    "transactionParameters": [
        {
            "tokencount": 1,
            "policyId": "63cb7af8c980f0867940e765f36fa53ac948d9af51179742291a553e",
            "tokenname": "0001"
        }
    ],
    "paymentgatewayParameters": null,
    "decentralParameters": null,
    "auctionParameters": null,
    "directSaleParameters": {
        "priceInLovelace": 123000000
    },
    "customerIpAddress": "0.0.0.0",
    "paymentTransactionNotifications": null,
    "referer": null
}'
```

#### 応答

次の応答が表示されます。 は NMKR Studio によって自動的に置き換えられます。次のステップのために をコピーしてください。

```json
{
  "paymentTransactionUid": "<paymentTransactionUid>",
  "projectUid": "<NMKR Studio Project Id>",
  "paymentTransactionType": "smartcontract_directsale",
  "customProperties": {},
  "state": "prepared",
  "transactionParameters": [
    {
      "tokencount": 1,
      "policyId": "<PolicyId>",
      "tokenname": "<TokenName in hex format>"
    }
  ],
  "paymentTransactionCreated": "<Creation Date and Time>",
  "paymentgatewayResults": null,
  "paymentTransactionSubStateResult": {
    "paymentTransactionSubstate": "waitingforlocknft",
    "lastTxHash": null
  },
  "auctionResults": null,
  "directSaleResults": {
    "sellingPrice": <Selling price in Lovelace as integer>,
    "marketplaceAmount": <<Market place fee in Lovelace as integer>,
    "sellerAmount": <Seller amount Price in Lovelace as integer>,
    "royaltyAmount": <Royalty amount in Lovelace as integer>,
    "additionalPayoutAmount": null,
    "lockedInAmount": <Locked in amount in Lovelace as integer>,
    "sellerAddress": null,
    "buyerAddress": null,
    "sellerTxHash": null,
    "sellerTxCreate": null
  },
  "decentralParameters": null,
  "mintAndSendResults": null,
  "cbor": null,
  "signedCbor": null,
  "expires": null,
  "signGuid": null,
  "fee": null,json
  "txHash": null
}
```

### NMKR 有料リンクの生成

リストの NMKR Pay リンクと売上は、前の応答で指定された を使用して生成できるようになりました。

#### NMKR リスティング用の有料リンク

を応答で指定された値に置き換えます。

```
https://pay.nmkr.io/?adsid=<paymentTransactionUid>&a=list
```

このリンクを使用して、NMKR Pay 経由でトランザクションに署名することで、スマート コントラクトにトークンをリストできるようになりました。

{% hint style="warning" %}
非公開機能は現在開発中です。
{% endhint %}

#### NMKR 販売用の有料リンク

```
https://pay.nmkr.io/?adsid=<paymentTransactionUid>&a=buy
```

トークンがスマート コントラクトにリストされたら、このリンクを使用してトークンを購入できます。

#### NMKR キャンセル用の有料リンク

```
https://pay.nmkr.io/?adsid=<paymentTransactionUid>&a=manage
```

このリンクは、トークンがスマート コントラクトにリストされた後、トークンのリストをキャンセルするために使用できます。 トークンはウォレットに返送されます。

{% hint style="info" %}
出品は、出品に使用されたウォレットからのみキャンセルできます。
{% endhint %}


---

# 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.nmkr.io/jp/nmkr-studio-api/apino/sumtokontorakuto/nmkr-payniyoru.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.
