Create Project

Create a project via NMKR Studio API

To create a project, you want to use the following endpoint.

Endpoint

/v2/CreateProject

First, please define the request body of the project. You can already specify project details in the request body, such as policy locking date, price list, and whitelisting. Please remove what is not needed by you and give the details accordingly for the fields that are important.

Request Body

{
  "projectname": "string",
  "description": "string",
  "projecturl": "string",
  "tokennamePrefix": "string",
  "twitterHandle": "string",
  "policyExpires": true,
  "policyLocksDateTime": "2022-12-06T12:40:50.306Z",
  "payoutWalletaddress": "string",
  "payoutWalletaddressUsdc": "string",
  "maxNftSupply": 0,
  "policy": {
    "policyId": "string",
    "privateVerifykey": "string",
    "privateSigningkey": "string",
    "policyScript": "string"
  },
  "metadataTemplate": "string",
  "addressExpiretime": 0,
  "pricelist": [
    {
      "countNft": 0,
      "priceInLovelace": 0,
      "isActive": true,
      "validFrom": "2022-12-06T12:40:50.306Z",
      "validTo": "2022-12-06T12:40:50.306Z"
    }
  ],
  "additionalPayoutWallets": [
    {
      "payoutWallet": "string",
      "valuePercent": 0,
      "valueFixInLovelace": 0
    }
  ],
  "saleConditions": [
    {
      "condition": "walletcontainspolicyid",
      "policyId1": "string",
      "policyId2": "string",
      "policyId3": "string",
      "policyId4": "string",
      "policyId5": "string",
      "minOrMaxValue": 0,
      "description": "string",
      "isActive": true,
      "policyProjectname": "string",
      "whitelistedAddresses": [
        "string"
      ],
      "blacklistedAddresses": [
        "string"
      ],
      "onlyOneSalePerWhitelistAddress": true
    }
  ],
  "enableFiat": true,
  "enableDecentralPayments": true,
  "enableCrossSaleOnPaymentgateway": true,
  "activatePayinAddress": true,
  "paymentgatewaysalestart": "2022-12-06T12:40:50.306Z"
}

As there are many optional fields, the following are mandatory to create your project:

  "projectname": "string",
  "policyExpires": true,
  "policyLocksDateTime": "2023-12-06T12:46:19.695Z",

or you import a policy ID with:

  "policy": {
    "policyId": "string",
    "privateVerifykey": "string",
    "privateSigningkey": "string",
    "policyScript": "string"
  },
  "maxNftSupply": 0,
  "addressExpiretime": 0,

Please keep in mind that if you upload the metadata in a payload, the metadata must be escaped. Online JSON Escape /Unescape Toolhttps://www.freeformatter.com/json-escape.html#before-output

Curl

Once you specified your body with the components that are important for you. You can send the Curl. The following is an example with a specified policy locking time a max Supply of 1, which means all tokens in there are only available to mint once (NFTs). Further, the payout wallet address and one price as well as a sales start is specified.

curl -X 'POST' \
  'https://studio-api.nmkr.io/v2/CreateProject' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer 0858c944c6ddxyzxyz1726da25' \
  -H 'Content-Type: application/json' \
  -d '{
  "projectname": "New Project",
  "description": "test",
  "projecturl": "string",
  "tokennamePrefix": "string",
  "twitterHandle": "string",
  "policyExpires": true,
  "policyLocksDateTime": "2023-12-06T12:46:19.695Z",
  "payoutWalletaddress": "addr1qxmrwr0sra35xjjdtugkasqqp2gsj969n6fdwt0fa6vxa5d98nu7s4l35sdwl6088e9f23ju7apk9hss7s9sgn3k9upqt2gwa8",
  "maxNftSupply": 1,
  "addressExpiretime": 20,
  "pricelist": [
    {
      "countNft": 1,
      "priceInLovelace": 10000000,
      "isActive": true,
      "validFrom": "2022-12-06T12:46:19.695Z",
      "validTo": "2023-12-06T12:46:19.695Z"
    }
  ],
  "enableDecentralPayments": true,
  "enableCrossSaleOnPaymentgateway": true,
  "activatePayinAddress": true,
  "paymentgatewaysalestart": "2022-12-08T12:46:19.695Z"
}'

Response

A successful Curl will now return with the following response, which also contains the project ID of the newly created project. As there wasn't any metadata template in the request body, the response contains the standard metadata template. And as there were no Policy Keys given to import an existing policy, a new one was created.

{
  "projectId": 41845,
  "metadata": "{\n  \"721\": {\n    \"<policy_id>\": {\n      \"<asset_name>\": {\n        \"name\": \"<display_name>\",\n        \"image\": \"<ipfs_link>\",\n        \"mediaType\": \"<mime_type>\",\n        \"description\": \"<description>\",\n        \"files\": [\n          {\n            \"name\": \"<display_name>\",\n            \"mediaType\": \"<mime_type>\",\n            \"src\": \"<ipfs_link>\"\n          }\n        ]\n      }\n    },\n    \"version\": \"1.0\"\n  }\n}",
  "policyId": "93c09ec87047f3309621fd4d48f9c5dfbxyz6d4b6a3fd015066eebe7",
  "policyScript": "{\n  \"type\": \"all\",\n  \"scripts\": [\n    {\n      \"type\": \"sig\",\n      \"keyHash\": \"ac636184a369b69d80xyzc5bxyz1a85c317bcc80f26bd4dfbfe60607\"\n    },\n    {\n      \"slot\": 110340895,\n      \"type\": \"before\"\n    }\n  ]\n}",
  "policyExpiration": "2023-12-06T12:46:19.695Z",
  "uid": "ef28ec63-3af1-4751-8b4f-b6a3373a6519"
}