API Guide
General Usage
13 min
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 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 {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={api key}\&contract address={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 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 { "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/{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/{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 ) 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 { "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={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` success { "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 { "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 { "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={api key} request parameters 118,505,120 false left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type 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 { "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 { "message" "the given data was invalid ", "errors" { "address" \[ "the address must start with one of the following 0x, 0x" ] } } insufficient balance { "message" "not enough balance to cover transaction charges please refill your wallet ", "data" {}, "errors" { "estimate" 0 4059999999999999, "balance" 0, } }