Skip to main content

Create QR Drops

Enjin Beam

is a QR code-based distribution system that allows users to claim tokens directly into their Enjin Wallet.

By scanning a Beam QR code, users can receive promotional items, collectibles, or other tokens as part of marketing campaigns or events.

This is a great way for you to onboard new users.

What you'll need:
  • Some Enjin Coin on Enjin Matrixchain to pay for Transaction Fees and a deposit of 0.01 ENJ is required for the Token Account Deposit, for each new token holder.
    You can obtain cENJ (Canary ENJ) for testing from the Canary faucet.
  • An Enjin Platform Account.
  • A Collection and a Token to mint.

There are two ways to create an Enjin Beam:

  1. Using the Enjin Dashboard
  2. Using the Enjin API & SDKs

Option A. Using the Enjin Dashboard

In the Platform menu, navigate to "Beams". Then, click the "Create Enjin Beam" button.

Creating a Beam

Fill in the beam settings and optional arguments in the corresponding fields.

Create Beam Form

Fill the tokens that you want to include in this Beam (You can add more tokens by adding the "Add Token" button)

Create Beam Form 2

Once you're satisfied with the options, click on the "Create" button at the bottom right corner to create the request.
If a signature request is needed, approve it.

Once the Beam is created, locate it in the "Beams" menu, click the 3 vertical dots () to it's right, then click the "Claim" button to view the QR code.

Claiming a Beam

Need to view multiple "Single-Use" QR codes?

Please note, viewing multiple "Single-Use" QR codes is currently not available in the Platform User Interface.
For the time being, it can be viewed programmatically only via Enjin API & SDKs

The Enjin Beam is now ready to be shared to distribute tokens. Users can scan the QR code and instantly receive your token!
Next skillset to learn is mutating a collection / token.
Proceed to the Freezing & Thawing tutorial to learn more.

Option B. Using the Enjin API & SDKs

Make sure to use the Beam Endpoint
  • Testnet: http://platform.canary.enjin.io/graphql/beam
  • Mainnet: http://platform.enjin.io/graphql/beam

Try the Beam Playground here:

First, create the Beam with the parameters of your choice, such as name, description, image, begin and end date & the number of assets that you would like to distribute.

Mutation:

mutation CreateBeam {
CreateBeam(
name: "My Beam" #Specify beam name
description: "This is a test beam." #Specify beam description
image: "https://assets-global.website-files.com/60f57c496975b84c29335fb7/60f58bd888a6e86e3ff69551_Enjin.svg" #Specify url for beam image - shows during claim process
start: "1st January 2023" #Specify start date
end: "1st January 2024" #Specify end date
collectionId: 36623 #Select the collection ID
tokens: [{
tokenIds: ["1..10", "123"] #Select the Token IDs. Use comma for multiple tokenIds: ["123", "234"], 2 dots for range: ["123", "234..345"]
tokenQuantityPerClaim:1 #Specify the number of tokens a user can receive per claim
claimQuantity:1 #Specify the number of times a user can claim
type:MINT_ON_DEMAND #Select token distribution type
}]
)
}

Next you will need to send a query to get one of the two different code types.

  • Multi-Use Codes: Useful for advertising.
  • Single-Use Codes: Useful for rewarding individuals.

Query: Multi-Use Codes

query GetBeam {
GetBeam(code: "adab7ac8bda71c2e2bf8a3228f0a435f") { #Set the beam code
id
code
name
description
image
start
end
isClaimable
claimsRemaining
qr {
url
payload
}
collection {
collectionId
maxTokenCount
maxTokenSupply
forceSingleMint
frozen
network
}
}
}

Query: Single-Use Codes

query GetSingleUseCodes {
GetSingleUseCodes(code: "adab7ac8bda71c2e2bf8a3228f0a435f") { #Set the beam code
edges {
cursor
node {
qr {
url
}
}
}
totalCount
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
}
}
This query might return items in different pages using Connections

To learn how to use GraphQL cursors for pagination, head to Using the API --> Pagination.

The Enjin Beam is now ready to be shared to distribute tokens. Users can scan the QR code and instantly receive your token!

Explore More Arguments

For a comprehensive view of all available arguments for queries and mutations, please refer to our API Reference. This resource will guide you on how to use the GraphiQL Playground to explore the full structure and functionality of our API.

For instance, you'll find settings such as different Beam flags types with the Flags argument.

What's next?

Proceed to the Freezing & Thawing tutorial to learn more.