How to create bundle

Bundles are an advanced marketing tool for arranging NFTs and delivering them to subscribers. A bundle can digitally deliver promotional material, NFTs that have values in themselves, tokens for online games, and tokens redeemable for physical goods and services. The bundle API tracks claims, distribution, and redemption of NFTs in real-time.

You can create the Bundle using API by following the below ways.

Create Bundle

Bundles are created using the /bundle/create method, which takes the name and expected maximum number of subscribers. You can pass the parameter in such a way as to create a bundle.

curl --request POST \
     --url 'https://api.nft.kred/bundle/create?token=YourTokenValue&name=My Cat Collection&max_subscribers=10&description=This bundle has a collection of Cat NFTs' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI'

You can update the bundle using /bundle/update method and modify the bundle details.

curl --request POST \
     --url 'https://api.nft.kred/bundle/update?token=YourTokenValue&bundle=99999&name=My New Cat Collection&max_subscribers=15' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI=='

Once updated, your can check your bundle details on the /bundle/bundles API, All the bundles are listed on this API.

curl --request POST \
     --url 'https://api.nft.kred/bundle/bundles?token=YourTokenValue&bundle=99999' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI=='

Select NFT and combine into Bundle

The key details of each bundle are the lines. Each line in a bundle allocates NFTs from one or more batches for distribution to subscribers. Lines are maintained using /bundle/line for both adding and updating lines.

curl --request POST \
     --url 'https://api.nft.kred/bundle/line?token=YourTokenValue&bundle=99999&batches=99999' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI'

Share Bundle

Each bundle has a set of codes, that can either be shared or unique. Shared codes can be claimed as many times as desired and can be; unique codes can be claimed only once. You can share a claim link with your users on social media and first some users can claim it with the help of that link. Users can create claim code using /bundle/code API.

curl --request POST \
     --url 'https://api.nft.kred/bundle/code?token=YourTokenValue&bundle=99999&count=10' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI'

Bundle Report

When an NFT (or Batch of NFTs) is offered as part of a giveaway or Bundle, NFT.Kred reports on how many of those NFTs have been accepted by receiving users. We refer to this as an NFT being "Claimed". Users can use /bundle/report API to generate the report.

curl --request GET \
     --url 'https://api.nft.kred/bundle/report?token=YourTokenValue&bundle=99999' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI=='

Subscribe Bundle

Subscribe a user to your bundle.

curl --request GET \
     --url 'https://api.nft.kred/bundle/subscribe?token=YourTokenValue&bundle=99999&code=1sys2trbd9172' \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTI=='

Create your bundle using Python SDK

Creating your bundle using Python-SDK is simple. This Python SDK bridges the gap between your applications and NFT.Kred APIs. Full-scale NFT solutions can be built in hours - instead of months. You can use NFT.Kred functionality via this python package and interact with the NFT.Kred APIs directly in your app.

Installation & Usage
We have created a tutorial on how you can install the Python SDK on your machine. Read our step-by-step guide on “How to install Python SDK” for more details. After importing the python SDK, please follow the below steps to create your bundle using Python SDK.

Step 1: Import SDK Files
Import below necessary library files by adding the following code.

from kred import services
from kred import models

Step 2: Define create bundle API method on your python file
Now we need to create a method that will call the "Create bundle" functionality on your code. Right now, we want to create a bundle so we will use a "create_bundle" method. we can check which method we should use by following the available examples related to the Bundles, please have a look at the Example References documentation section, where all the available examples are given. You can copy those methods in your file and build your app.

def create_bundle(token, name=None, max_subscribers=1, channel=None, description=None, color=None, cover=None):
    """Create a marketing bundle.
    """

    # service class
    service = services.BundleClient(token)
    model = models.BundleModel()

    # parameters
    model.name = name # The name of the bundle.
    model.max_subscribers = max_subscribers # Maximum number of subscribers
    model.channel = channel # The channel to which this bundle is attached.
    model.description = description # The description of the bundle
    model.color = color # The color of the bundle
    model.cover = cover # The image of the bundle.

    # Service API calling
    response = service.create(model)

Step 3: Call your Defined method to create a bundle
From the above step, we have created a python file and defined a "create_bundle" method to create a bundle. Now we will call that method and pass the required parameter. We may have a look at the required parameter list by following this create bundle API endpoint.

# Define your token here
token = "token value"

# Call define method with values
create_bundle(token, name, max_subscribers, channel, description, color, cover)

That's it, now, your bundle has been created and you can add NFTs to your bundle. Please have a look at the Example References documentation section, where all the available bundle examples are given to use using python SDK.

Create a bundle using an application

Did you try to create a bundle using the application? You can check out this guide to create a bundle using our no-code application.