---
title: "Create an NFT marketplace"
method: POST
path: "/v3/blockchain/marketplace/listing"
tags: ["Marketplace"]
---

# Create an NFT marketplace

`POST /v3/blockchain/marketplace/listing`

## Request

- Base URL: `https://api.tatum.io`
- URL: `https://api.tatum.io/v3/blockchain/marketplace/listing`
- Auth: API key in header `x-api-key`

/v3/blockchain/marketplace/listing

**2 credits per API call**

Deploy an NFT marketplace smart contract on the blockchain. With a deployed marketplace smart contract, you and your customers can create new listings for assets such as non-fungible tokens and combinations of token types as described by the ERC-721 and ERC-1155 standards on the Ethereum blockchain or by the equivalent standards on the other blockchains. As the marketplace operator, you can set a fee as a percentage of the asset price that will be paid on top of the asset price.

The purchase process looks like the following:

1.  The seller [creates a listing for an asset on the NFT marketplace](#operation/SellAssetOnMarketplace). The listing can be offered for the native blockchain assets (for example, ETH, BSC, and so on) or for the fungible tokens of the blockchain.
2.  The seller [allows the marketplace smart contract to transfer the asset that they are selling](https://apidoc.tatum.io/tag/Auction#operation/ApproveNftAuctionSpending).
3.  A buyer buys the asset.
    *   If the buyer wants to pay with the **native blockchain assets**, they [make the purchase](#operation/BuyAssetOnMarketplace) (the `buyAssetFromListing()` method is called against the marketplace smart contract) and send the required amount of the native assets to the marketplace smart contract.
    *   If the buyer wants to pay with the **fungible tokens**:
        1.  The buyer [allows the marketplace smart contract to access their tokens](https://apidoc.tatum.io/tag/Fungible-Tokens-\(ERC-20-or-compatible\)#operation/Erc20Approve) and makes the purchase (the `buyAssetFromListing()` method is called against the marketplace smart contract).
        2.  The marketplace smart contract deducts the required amount of tokens from the smart contract where the buyer holds the tokens.
4.  The marketplace smart contract transfers the asset to the buyer, transfers the asset price to the seller, and sends the fee to the marketplace fee recipient.

This API is supported for the following blockchains:

*   BNB Smart Chain
*   Celo
*   Ethereum
*   Harmony
*   Klaytn
*   Polygon
*   Solana (in **alpha**)

**Signing a transaction**  
When deploying an NFT marketplace smart contract, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.

Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the **testnet** of a blockchain.

For signing transactions on the **mainnet**, we strongly recommend that you use the Tatum [Key Management System (KMS)](https://github.com/tatumio/tatum-kms) and provide the signature ID instead of the private key in the API. Alternatively, you can use the [Tatum JavaScript client](https://github.com/tatumio/tatum-js/tree/v2).

## Request body

- union
  - GenerateMarketplace
    - `chain` 'ETH' | 'ONE' | 'KLAY' | 'BSC' | 'MATIC', required: Blockchain to work with.
    - `feeRecipient` string, required: Address of the recipient of the fee for the trade.
    - `marketplaceFee` number, required: The percentage of the amount that an NFT was sold for that will be sent to the marketplace as a fee. To set the fee to 1%, set this parameter to <code>100</code>; to set 10%, set this parameter to <code>1000</code>; to set 50%, set this parameter to <code>5000</code>, and so on.
    - `fromPrivateKey` string, required: Private key of sender address. Private key, or signature Id must be present.
    - `nonce` number: The nonce to be set to the transaction; if not present, the last known nonce will be used
    - `fee` object: Custom defined fee. If not present, it will be calculated automatically.
      - `gasLimit` string, required: Gas limit for transaction in gas price.
      - `gasPrice` string, required: Gas price in Gwei.
  - GenerateMarketplaceKMS
    - `chain` 'ETH' | 'ONE' | 'KLAY' | 'BSC' | 'MATIC', required: Blockchain to work with.
    - `feeRecipient` string, required: Address of the recipient of the fee for the trade.
    - `marketplaceFee` number, required: The percentage of the amount that an NFT was sold for that will be sent to the marketplace as a fee. To set the fee to 1%, set this parameter to <code>100</code>; to set 10%, set this parameter to <code>1000</code>; to set 50%, set this parameter to <code>5000</code>, and so on.
    - `signatureId` string, uuid, required: Identifier of the private key associated in signing application. Private key, or signature Id must be present.
    - `index` number: If signatureId is mnemonic-based, this is the index to the specific address from that mnemonic.
    - `nonce` number: The nonce to be set to the transaction; if not present, the last known nonce will be used
    - `fee` CustomFee: The custom defined fee; if not present, will be calculated automatically
      - `gasPrice` string, required: The price for one gas unit (in Gwei)
      - `gasLimit` string, required: The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price
  - GenerateMarketplaceCelo
    - `chain` 'CELO', required: Blockchain to work with.
    - `feeRecipient` string, required: Address of the recipient of the fee for the trade.
    - `feeCurrency` 'CELO' | 'CUSD' | 'CEUR', required: The currency in which the transaction fee will be paid
    - `marketplaceFee` number, required: The percentage of the amount that an NFT was sold for that will be sent to the marketplace as a fee. To set the fee to 1%, set this parameter to <code>100</code>; to set 10%, set this parameter to <code>1000</code>; to set 50%, set this parameter to <code>5000</code>, and so on.
    - `fromPrivateKey` string, required: Private key of sender address. Private key, or signature Id must be present.
    - `nonce` number: The nonce to be set to the transaction; if not present, the last known nonce will be used
    - `fee` CustomFee: The custom defined fee; if not present, will be calculated automatically
      - `gasPrice` string, required: The price for one gas unit (in Gwei)
      - `gasLimit` string, required: The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price
  - GenerateMarketplaceCeloKMS
    - `chain` 'CELO', required: Blockchain to work with.
    - `feeRecipient` string, required: Address of the recipient of the fee for the trade.
    - `feeCurrency` 'CELO' | 'CUSD' | 'CEUR', required: The currency in which the transaction fee will be paid
    - `marketplaceFee` number, required: The percentage of the amount that an NFT was sold for that will be sent to the marketplace as a fee. To set the fee to 1%, set this parameter to <code>100</code>; to set 10%, set this parameter to <code>1000</code>; to set 50%, set this parameter to <code>5000</code>, and so on.
    - `signatureId` string, uuid, required: Identifier of the private key associated in signing application. Private key, or signature Id must be present.
    - `index` number: If signatureId is mnemonic-based, this is the index to the specific address from that mnemonic.
    - `nonce` number: The nonce to be set to the transaction; if not present, the last known nonce will be used
    - `fee` object: Custom defined fee. If not present, it will be calculated automatically.
      - `gasLimit` string, required: Gas limit for transaction in gas price.
      - `gasPrice` string, required: Gas price in Gwei.
  - GenerateMarketplaceSolana
    - `chain` 'SOL', required: Blockchain to work with.
    - `marketplaceFee` number, required: The percentage of the amount that an NFT was sold for that will be sent to the marketplace as a fee. To set the fee to 1%, set this parameter to <code>100</code>; to set 10%, set this parameter to <code>1000</code>; to set 50%, set this parameter to <code>5000</code>, and so on.
    - `from` string, required: The address that will be the owner of the marketplace
    - `treasuryMint` string: Address of a SPL token contract
    - `treasuryWithdrawalDestination` string: The address that will be able to withdraw funds from the marketplace treasury account to own address
    - `feeWithdrawalDestination` string: The address that will be able to withdraw funds from the marketplace fee account to own address
    - `requiresSignOff` boolean: Set to "false" if you do not want the marketplace to sign all operations related to the listings and sales; if not set, defaults to "true" (the marketplace must sign all the operations)
    - `fromPrivateKey` string, required: The private key of the blockchain address from which the fee will be deducted
  - GenerateMarketplaceSolanaKMS
    - `chain` 'SOL', required: Blockchain to work with.
    - `marketplaceFee` number, required: The percentage of the amount that an NFT was sold for that will be sent to the marketplace as a fee. To set the fee to 1%, set this parameter to <code>100</code>; to set 10%, set this parameter to <code>1000</code>; to set 50%, set this parameter to <code>5000</code>, and so on.
    - `from` string, required: The address that will be the owner of the marketplace
    - `treasuryMint` string: Address of a SPL token contract
    - `treasuryWithdrawalDestination` string: The address that will be able to withdraw funds from the marketplace treasury account to own address
    - `feeWithdrawalDestination` string: The address that will be able to withdraw funds from the marketplace fee account to own address
    - `requiresSignOff` boolean: Set to "false" if you do not want the marketplace to sign all operations related to the listings and sales; if not set, defaults to "true" (the marketplace must sign all the operations)
    - `signatureId` string, uuid, required: The KMS identifier of the private key of the blockchain address from which the fee will be deducted

## Response `200`

OK

- union
  - TransactionHash
    - `txId` string, required: The hash (ID) of the transaction
  - SolanaMarketplaceTransactionHash
    - `txId` string, required: The hash (ID) of the transaction
    - `contractAddress` string, required: The address of deployed marketplace contract
    - `feeAccount` string, required: The blockchain address of the fee account
    - `treasuryAccount` string, required: The blockchain address of the treasury account
  - SignatureId
    - `signatureId` string, uuid, required: The internal Tatum ID of the prepared transaction for Key Management Sysytem (KMS) to sign<br/>This is different from the <code>signatureId</code> parameter that you provided in the request body. The <code>signatureId</code> parameter in the request body specifies the signature ID associated with the private key in KMS.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
- `403`: Forbidden. The request is authenticated, but it is not possible to perform the operation due to logical error or invalid permissions.
- `500`: Internal server error. There was an error on the server during the processing of the request.

---

[API](https://skmtc.dev/tatum/apis/smart-contracts.md) - [All operations](https://skmtc.dev/tatum/apis/smart-contracts/llms.txt) - [OpenAPI document](https://skmtc.dev/tatum/apis/smart-contracts/revisions/c0146043bb37?raw)
