Underdog Protocol
  • API Documentation
  • Quickstart
  • Guides
    • Postman
    • Endpoints
    • Authentication
    • Pagination
    • Errors
    • Webhooks
    • Architecture
  • Resources
    • Projects
      • Transferable Projects
      • Non-Transferable Projects
      • NFTs
        • List all NFTs
        • Search NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
        • Generate Claim Link
        • Revoke an NFT
        • Burn an NFT
      • Methods
        • List all Projects
        • Create a Project
        • Retrieve a Project
        • Update a Project
        • Retrieve Project Stats
    • NFTs
      • Retrieve an NFT
      • Generate Claim Transaction
    • Orgs
      • List all Orgs
    • Transactions
      • List all Transactions
      • Retrieve a Transaction
    • Webhooks
      • List all Webhooks
      • Create a Webhook
      • Delete a Webhook
    • V1
      • Collections
        • List all Collections
        • Create a Collection
        • Retrieve a Collection
      • NFTs
        • List all NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
      • Managed NFTs
        • Claim
        • Revoke
  • Examples
    • Zapier Integrations
      • Zapier + Viral Loops
      • Zapier + Github + OpenAI
      • Zapier + Github
      • Zapier + Mailchimp
      • Zapier + Shopify
      • Zapier + Calendly
      • Zapier + Hubspot
      • Zapier + Typeform
    • Underdog with Airtable
      • Create a Project
      • Create NFT on Form Submission
      • Send a Claim Link
      • Updating NFTs
    • Web3 Blog
    • Mint NFTs on iPhone
  • Use Cases
    • Solana Mobile
    • Parcl
Powered by GitBook
On this page
  1. Resources
  2. Projects
  3. NFTs

Create an NFT

PreviousSearch NFTsNextRetrieve an NFT

Last updated 2 years ago

Example

curl --location --request POST 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "LeGoat",
    "image": "https://sportshub.cbsistatic.com/i/r/2023/02/08/aa0a798f-6268-41ba-9be4-ea4ee03fd817/thumbnail/1200x675/421458d6419a36da2aaad75e10b2e347/king.jpg",
    "attributes": {
        "points": "38390"
    }
}'
const axios = require('axios');
let data = JSON.stringify({
  "name": "LeGoat",
  "image": "https://sportshub.cbsistatic.com/i/r/2023/02/08/aa0a798f-6268-41ba-9be4-ea4ee03fd817/thumbnail/1200x675/421458d6419a36da2aaad75e10b2e347/king.jpg",
  "attributes": {
    "points": "38390"
  }
});

let config = {
  method: 'post',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
Response
{
    "transactionId": "c3f66040-89f2-4692-9987-e7d0465179ab",
    "mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi"
}
  • POSTCreate an NFT
  • Example

Create an NFT

post

This endpoint allows you to create a new NFT.

Authorizations
Path parameters
transferablestringRequired

Value must be either 't' for transferable or 'n' for non-transferable

projectIdintegerRequired
Body
namestringRequired

Name stored as on-chain metadata

Example: NFT #1
symbolstringOptional

Symbol stored as on-chain metadata

Example: NFT
descriptionstringOptional

Description stored in the metadata

Example: This is my first NFT
imagestringRequired

Image URL for your NFT

Example: https://example.com/image.png
animationUrlstringOptional

Animation URL for your NFT

Example: https://example.com/animation.mp4
receiverAddressstringOptional

Wallet address that will receive the NFT

Example: EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDpPattern: ^[A-HJ-NP-Za-km-z1-9]*$
upsertbooleanOptional

If true, will update the NFT if one with the same owner / claimer exists

Responses
200
Returns an array of NFTs with upserted metadata
application/json
202Success
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
post
POST /v2/projects/:transferable/:projectId/nfts HTTP/1.1
Host: api.underdogprotocol.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 291

{
  "name": "NFT #1",
  "symbol": "NFT",
  "description": "This is my first NFT",
  "image": "https://example.com/image.png",
  "animationUrl": "https://example.com/animation.mp4",
  "attributes": {
    "Points": "40000",
    "Nickname": "LeGoat"
  },
  "receiverAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "upsert": true
}
[
  {
    "name": "NFT #1",
    "symbol": "NFT",
    "description": "This is my first NFT",
    "image": "https://example.com/image.png",
    "animationUrl": "https://example.com/animation.mp4",
    "attributes": {
      "Points": "40000",
      "Nickname": "LeGoat"
    },
    "id": 1,
    "projectId": 1,
    "transferable": true,
    "mintAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
    "ownerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
    "claimerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
    "status": "text"
  }
]