API Guide

General Usage

13min

Enefits API

The Enefits API gives developers access to many of the features that drive the Enefits Exchange that connects brands to the web3 world - and vice versa.

If you're interested in integrating the SDK in your app for verification of ownership of NFTs and confirming Enefits Offer eligibility, head to this documentation to learn more.

To obtain an API Key, simply register at http://enefits.co, go to Developer in the account menu in the top right section. From there, generate an API Key and save this for all API requests as defined below. We only show this once so if you lose this API Key, you’ll have to re-generate from the Developer section.

In this documentation we refer to the API Key as {api_key}

The base url for all requests is https://api.enefits.co/developer/v1/

If you have any trouble getting started with this API or need general help, e-mail [email protected].

/offers.json (GET)

Retrieve active offers from Enefits Offer Network for a given NFT collection by smart contract address.

Request Parameters

Parameter

Description

Required

api_key

Your API Key

Yes

contract_address

The smart contract address of the collection you would like to retrieve offers for

Yes

token_id

A specific token ID in the collection represented by the contract_address

No

chain

Options: ETH, SOL, MATIC If this is not provided, the API aims to use contract_address alone to determine chain

No

network

Options: mainnet, testnet If this is not provided, the API determines the chain network based on supplied contract_address

No



Response

JSON


/address/{owner_address}/offers.json (GET)

Retrieve active offers from Enefits Offer Network for a given owner address.

Request Parameters

Parameter

Description

Required

api_key

Your API Key

Yes

owner_address

The owner address to retrieve offers for

Yes

scope

Options: account, global (requires special api_key permissions; contact: [email protected]) account: Returns offers for account that owns api_key global: Returns all offers that owner_address is eligible for

No

chain

Options: ETH, SOL, MATIC

No

Response

JSON


/express-mint.json (POST)

Mint a new NFT on the Polygon blockchain.

Request Parameters

Parameter

Description

Required

api_key

Your API Key

Yes

name

Name of the Collection/NFT

Yes

description

Short description of the NFT

Yes

asset_url

URL of the digital asset (image, audio, video etc) that is the NFT's creative

Yes

symbol

A unique symbol to identify the NFT (maximum of 8 characters)

Yes

website

Website for the NFT

No

network

Network to use; valid are testnet (default) and `mainnet`

No

transfer_address

Account address to which NFT will be tranferred after being minted (either a crypto address or an e-mail address)

No

Response

  • On successful minting, the API returns with HTTP status code `200`
  • When any of the mandatory input fields are missing, the API fails with HTTP status code `422 - Unprocessable content`
  • When minting fails due to insufficient MATIC balance, the API fails with custom HTTP status code `420`
Success
Invalid Input
Insufficient Balance




/nftemplate/claim.json (POST)

Create an NFT from an NFTemplate

Request Parameters

Parameter

Description

Required

api_key

Your API Key

Yes

nftemplate_id

The nftemplate_id of the NFTemplate. To get the nftemplate_id click on the NFTemplate card from the NFT collection the NFTemplate is listed under to visit the NFTemplate Details screen and copy/paste from there

Yes

address

Wallet address to send NFT to after minting

Yes, if no email param is provided

email

Email address to send NFT to after minting

Yes, if no address param is provided

flow

Options: claim, direct claim: User must claim via claim page direct: Automatically delivers NFT to user via email; requires email param to be present

No (defaults to claim)

Response

  • On successful minting, the API returns with HTTP status code `200`
  • When any of the mandatory input fields are missing, the API fails with HTTP status code `422 - Unprocessable content`
  • When minting fails due to insufficient MATIC balance, the API fails with custom HTTP status code `420`
Success
Invalid Input
Insufficient Balance