NMKR Docs
ProductsContact
English
English
  • Welcome to NMKR Docs
  • Introduction
    • About NMKR
    • Powered by NMKR
    • What is an NFT?
      • What is IPFS?
    • Why Cardano?
  • NMKR Studio
    • Introduction - NMKR Studio
    • Features Overview
    • 🖥️Learn NMKR Studio in 3 minutes
      • Basic Workflow
    • How to - Quick Start Tutorials
      • Quickstart Full Video Tutorial
      • Guidelines Planning a Project
      • How To Add Tokens
      • How to set up Metadata
      • How To Sell Tokens
      • How To Set Up Sales Conditions
      • How To Do a Reveal
      • How To Burn Tokens
      • How To Enable Royalties
      • How To Enable DIDs
      • How To Set up Whitelisting
      • How to Airdrop Tokens
    • Pricing
    • Account
      • Registration & KYC
      • Security
      • Wallets
      • Mint Coupons
      • Dashboard
      • Transactions
      • Invoices
      • API Keys
    • Project
      • Policy
        • Managing policies
      • Create
      • Edit
      • Metadata Template
      • Statistics
      • DID - Decentralized Identifier
      • Notifications
      • Royalties
      • Additional Payout Wallets
      • Affiliate links
      • Export Metadata as Zip
      • Export NFT as csv
      • Mint and Send Jobs
      • Export placeholder.csv
    • Token
      • Manage Tokens Tab
      • Upload
        • Upload single tokens
        • Bulk Upload Files and Metadata
          • Bulk Upload via Drag and Drop
          • Bulk upload via SFTP
      • Edit
      • Metadata
        • Add Token-specific Metadata
        • Fingerprint (Metadata preview)
        • Metadata Check
        • Metadata Standard for fungible Tokens
        • Fully on-Chain NFTs
          • Partial URL-Encoding
        • CIP-68
      • Duplicate
      • Delete
      • Burn
      • Update (Edit after Mint / Reveal)
    • Set up Sales
      • Manage prices / Pricelist
        • Create new Prices
        • Free Drops
        • Custom Token payment
        • Discounts
      • Sales Conditions & Whitelisting
        • Sales conditions depending on policy ID or stake pool
        • Whitelist with Count
        • Blacklist
        • Test Sales Condition
      • Block Tokens
      • NMKR Pay
        • Set up NMKR Pay
        • MultiSig Payment
        • Website Integration
        • Specific Payment Links
        • Manual sending in NMKR Pay
        • FIAT ETH and SOL Payment
      • Pay-In Address
      • Auction
    • Minting
      • Minting on Demand
      • Manual Minting
      • Airdropper
        • Airdrop with random distribution
        • Airdrop with specific distribution
    • Tools
      • Managed Wallets
      • Split Addresses
      • Direct Sales
      • Policy Snapshot
      • Integrations & Plugins
        • NFT Pal
        • Zapier
    • Testnet
      • Create Testnet Account
      • Testnet Wallet & tADA
      • Testnet API Swagger
  • NMKR Studio API
    • Introduction - NMKR Studio API
    • API Features
    • Swagger API Endpoints
    • Get started with the API
    • API Swagger
      • Get Started with the Swagger
      • Swagger Responses and Error Codes
    • API Examples
      • Users
        • Payout Wallets
        • Subcustomers
      • Project
        • Create Project
        • Upload File and Metadata
      • Payment
        • Create unique NMKR Pay Link for random Token sales
        • Create NMKR Pay Link for specific Token sales
        • Get Payment Address for single NFT sales with native Tokens
        • Create NMKR Pay Link for a multi-specific Tokens sale
      • Minting
        • Manual Minting
      • Smart Contract
        • Secondary Sales via NMKR Pay
    • API Open Source Contributions
  • NMKR Mint
    • Introduction - NMKR Mint
    • Mint single NFTs
    • Mint Collection
  • NMKR Playground
    • Introduction - NMKR Playground
    • ADA Payment Link
    • Paperwallet
  • NMKR Pool
    • What is Staking?
    • Stake with NMKR Pool
  • Helpful Links
    • Cardano NFT Ressources
    • Cardano Resources
    • Cardano Wallets
    • Open Source Repositories
    • Security Practices
    • Deal with Bots
Powered by GitBook
On this page
  1. NMKR Studio API
  2. API Examples
  3. Smart Contract

Secondary Sales via NMKR Pay

Sell already minted tokens via NMKR Pay

The NMKR Studio API can be used to set up a Secondary Sale of an already minted token. This allows you to list and sell any Token for a specified price via NMKR Pay.

Please keep in mind that you can only sell tokens that are in your possession. You will be later asked to lock this token in the smart contract during the listing process.

API Endpoint

In order to sell an already minted NFT we need to create a payment transaction with NMKR Studio via the following API endpoint:

/v2/CreatePaymentTransaction

Payload

The payload to create the payment transaction should be look like the following. The Authentication token / API Key must be given in the header! Please replace the <placeholders> (PolicyID, TokenName, Price in Lovelace as integer) with the according information.

{
    "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
}

The projectUid in the payload above can be any random UID of any project in NMKR Studio. This is only neccessary to utilize NMKR Pay and is not related to the token that will be listed. To ease the process here, we already added a random Uid.

Curl example

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
}'

Response

You will now receive the following response, where the <Placeholders> will be automatically replaced by NMKR Studio. Please copy the <paymentTransactionUid> for the next step.

{
  "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
}

Generate NMKR Pay Links

The NMKR Pay links for the listing, as well as the sales can now be generated with the <paymentTransactionUid> that was given in the previous response.

NMKR Pay link for Listing

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

You can now use this link to list your token on the smart contract by signing the transaction via NMKR Pay.

The unlisting feature is currently being developed.

NMKR Pay link for Sales

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

This link can be used to buy the token once the token was listed in the smart contract.

NMKR Pay link for Canceling

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

This link can be used to cancel the token listing once the token was listed in the smart contract. The token will be sent back to the wallet.

A listing can only be cancelled from the wallet that was used for the listing.

PreviousSmart ContractNextAPI Open Source Contributions

Replace the <paymentTransactionUid> with the value that was given in the .

Replace the <paymentTransactionUid> with the value that was given in the.

Replace the <paymentTransactionUid> with the value that was given in the.

response
response
response