---
title: General Usage
slug: general-usage
createdAt: 2022-04-05T08:58:23.000Z
---

# 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.

:::hint{type="info"}
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](https://docs.enefits.co/xhPd-general-usage) to learn more.
:::

To obtain an API Key, simply register at [http://enefits.co](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 &#x7B;api\_key}

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

If you have any trouble getting started with this API or need general help, e-mail [help@enefits.co](mailto\:help@enefits.co).

# /offers.json (GET)

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

Usage: [https://api.enefits.co/developer/v1/offers.json?api\_key=&#x7B;api\_key}\&contract\_address=&#x7B;contract\_address}](https://api.enefits.co/developer/v1/offers.json?api_key=\{api_key}\&contract_address=\{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<br />*If this is not provided, the API aims to use contract\_address alone to determine chain*            | No       |
| network           | Options: mainnet, testnet<br />*If this is not provided, the API determines the chain network based on supplied contract\_address* | No       |



### Response

```json
{
   "status":"success",
   "message":null,
   "data":{
      "offers":[
         {
            "_id":"620b1c827cc1181c540db432",
            "name":"My Test Offer",
            "description":"A test offer for the world.",
            "promo_description":"The best Offer for NFT Holders",
            "type":"access",
            "expires_at":null,
            "slug":"my-test-offer",
            "collection_ids":[
               
            ],
            "user_id":"620b1c4a00fe583edd22e0c2",
            "updated_at":"2022-03-04 11:52:33",
            "created_at":"2022-02-15 03:22:42",
            "meta_collection_ids":[
               "620a5e1cc969ce0da9575eb1",
               "620a6227c969ce0da9580a8f"
            ]
         },
         {
            "_id":"620b5006b1a45a308126bb22",
            "name":"TicketHub Priority Access",
            "description":"Priority Lane Access for NFT Holders",
            "promo_description":"Priority Lane Access for NFT Holders",
            "type":"access",
            "expires_at":null,
            "slug":"tickethub-priority-access",
            "collection_ids":[
               
            ],
            "user_id":"620b4fd5087bb5370f220072",
            "updated_at":"2022-02-15 07:02:30",
            "created_at":"2022-02-15 07:02:30"
         }
      ]
   }
}
```

# /address/&#x7B;owner\_address}/offers.json (GET)

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

Usage: [https://api.enefits.co/developer/v1/address/&#x7B;owner\_address}/offers.json?api\_key=&#x7B;api\_key}](https://api.enefits.co/developer/v1/address/\{owner_address}/offers.json?api_key=\{api_key})

### 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: [api@enefits.co](#))<br /><br />*account*: Returns offers for account that owns `api_key`<br />*global*: Returns *all* offers that `owner_address` is eligible for | No       |
| chain          | Options: ETH, SOL, MATIC                                                                                                                                                                                                                     | No       |

### Response

```json
{
   "status":"success",
   "message":null,
   "data":{
      "offers":[
         {
            "_id":"620b1c827cc1181c540db432",
            "name":"My Test Offer",
            "description":"A test offer for the world.",
            "promo_description":"The best Offer for NFT Holders",
            "type":"access",
            "expires_at":null,
            "slug":"my-test-offer",
            "collection_ids":[
               
            ],
            "user_id":"620b1c4a00fe583edd22e0c2",
            "updated_at":"2022-03-04 11:52:33",
            "created_at":"2022-02-15 03:22:42",
            "meta_collection_ids":[
               "620a5e1cc969ce0da9575eb1",
               "620a6227c969ce0da9580a8f"
            ]
         },
         {
            "_id":"620b5006b1a45a308126bb22",
            "name":"TicketHub Priority Access",
            "description":"Priority Lane Access for NFT Holders",
            "promo_description":"Priority Lane Access for NFT Holders",
            "type":"access",
            "expires_at":null,
            "slug":"tickethub-priority-access",
            "collection_ids":[
               
            ],
            "user_id":"620b4fd5087bb5370f220072",
            "updated_at":"2022-02-15 07:02:30",
            "created_at":"2022-02-15 07:02:30"
         }
      ]
   }
}
```

# /express-mint.json (POST)

Mint a new NFT on the Polygon blockchain.

Usage: [https://api.enefits.co/developer/v1/express-mint.json?api\_key=&#x7B;api\_key}](https://api.enefits.co/developer/v1/express-mint.json?api_key=\{api_key})

### 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\`

:::CodeblockTabs
Success

```json
{
    "status": "success",
    "message": null,
    "data": {
        "collection": {
            "_id": "62af1d241e397c11194a2bf3",
            "name": "My Milkshake",
            "slug": "my-milkshake",,
            "blockchain": "matic",
            "network": "testnet",
            "metadata": null,
            "total_supply": 1,
            "updated_at": "2022-06-19 12:57:39",
            "created_at": "2022-06-19 12:57:08",
            "floor_price": 1,
            "num_owners": 1,
            "collection_url": null,
            "main_collection": {
                "_id": "62af1d241e397c11194a2bf2",
                "name": "My Milkshake",
                "description": "Doesn't exactly bring out anyone to the yard",
                "website": null,
                "image_url": "https://res.cloudinary.com/enefits/image/upload/v1648551239/flpyff2997sxdijqrlyt.jpg",
                "symbol": "KR1SH4KE",
                "network": "testnet",
                "blockchain": "matic",
                "is_express": true,
                "user_id": "62265864b8cdef61914fe833",
                "slug": "my-milkshake",
                "total_supply": 1,
                "transfer_wallet_address": "0xA7988BfDf0c836900d87430f7f1a541deD9c8732",
                "updated_at": "2022-06-19 12:57:39",
                "created_at": "2022-06-19 12:57:08",
                "tx_id": "0xe9e290661f445f5345238a44249d91e026f6b0c5e2045da8ae355f0fc51f4ffc",
                "contract_address": "0x73cf2f3462eb8d244cfa46aea6f5ce7c04a1a411",
                "token_max_id": 1,
                "link_explorer": "https://mumbai.polygonscan.com/address/0x73cf2f3462eb8d244cfa46aea6f5ce7c04a1a411",
                "status": "live",
                "status_message": "Collection is live on blockchain"
            }
        }
    }
}       
```

Invalid Input

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "description": [
            "The description field is required."
        ],
        "symbol": [
            "The symbol field is required."
        ]
    }
}
```

Insufficient Balance

```json
{
    "message": "Not enough balance to cover transaction charges. Please refill your wallet.",
    "data": {},
    "errors": {
        "estimate": 0.4059999999999999,
        "balance": 0,
    }
}
```
:::



# /nftemplate/claim.json (POST)

Create an NFT from an NFTemplate

Usage: [https://api.enefits.co/developer/v1/nftemplate/claim.json?api\_key=&#x7B;api\_key}](https://api.enefits.co/developer/v1/nftemplate/claim.json?api_key=\{api_key})

### 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<br /><br />*claim*: User must claim via claim page<br />*direct*: Automatically delivers NFT to user via email; requires `email` param to be present                                            | No (defaults to **claim**)<br />        |

### 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\`

:::CodeblockTabs
Success

```json
{
    "status": "success",
    "message": "Minting has been queued and will be added to blockchain. Please allow a few minutes for the transaction to be initiated and for asset to go live on blockchain",
    "data": []
}
```

Invalid Input

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "address": [
            "The address must start with one of the following: 0x, 0X"
        ]    
    }
}
```

Insufficient Balance

```json
{
    "message": "Not enough balance to cover transaction charges. Please refill your wallet.",
    "data": {},
    "errors": {
        "estimate": 0.4059999999999999,
        "balance": 0,
    }
}
```
:::

