Copy link
Using API for NFT
Postman collection with all endpoints - Using_API_for_NFT.postman_collection.zip
Login to wallet
You need to log in to your wallet to get the token necessary to get the wallet balance and withdraw NFT.
post
https://api.cpay.world
/api/public/auth
Endpoint POST /api/public/auth
Parameters
Request body
- publicKey
*
string
- privateKey
*
string
- walletId
*
string
- passphrase
*
string
Responses
- 200:OK{token: "String"}
- 200:Example{token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYyMDI5MDg0ZDA4NmM2MDExMzc3ODFlMiIsInVzZXIiOiI2MDlhNjM0MGU1ZTFjZjAyMTU2ZDBkZjciLCJpYXQiOjE2OTgyNDU5NTcsImV4cCI6MTY5ODMzMjM1N30.ogoBh6UolGWJUy0bOcNPjNNqPqstoj8ld_u3siUSEQU"}
Get wallet balance
get
https://api.cpay.world
/api/public/wallet
Endpoint GET /api/public/wallet
Responses
- 200:OK{"status": "string","data": {"currencyId": "string","balance": "string","balanceUSD": "string","holdBalance": "string","availableBalance": "string","availableBalanceUSD": "string","tokens": [{"currencyId": "string","currencyName": "string","balance": "string","holdBalance": "string","balanceUSD": "string","availableBalance": "string","availableBalanceUSD": "string"}],"nfts": {"erc721": [{"contractAddress": "string","tokenId": "string","name": "string","symbol": "string","balance": 0,"holdBalance": 0}],"erc1155": [{"contractAddress": "string","tokenId": "string","name": "string","symbol": "string","balance": 0,"holdBalance": 0}]}}}
- 200:Example{"status": "success","data": {"currencyId": "60ebfe8ffe376807f22943ef","balance": "0.004464285714285714","holdBalance": "0","balanceUSD": "1","availableBalance": "0.004464285714285714","availableBalanceUSD": "1","nfts": {"erc721": [{"contractAddress": "0x9e8C1e7B35f646A606644a5532C6103C647938cf","name": "Cobee.Combo","symbol": "COBEE","tokenId": "215693","balance": 1,"holdBalance": 0}],"erc1155": [{"contractAddress": "0x2DFEb752222ccceCB9BC0a934b02C3A86f633900","name": "","symbol": "","tokenId": "10020100003","balance": 1,"holdBalance": 0}]}}}
Estimate NFT withdrawal
post
https://api.cpay.world
/api/public/transaction/feeNft
Endpoint POST /api/public/transaction/feeNft
Parameters
Request body
- to
*
string
- amount
*
object
- contractAddress
*
string
- tokenId
*
string
- type
*
erc721
ERC721, ERC1155
- password
string
- sign
string
base64 format
Responses
- 200:OK{"status": "string","data": {"to": "string","amount": {},"contractAddress": "string","tokenId": "string","type": "erc721"}}
- 200:Example{"status": "success","data": {"fee": "0.000310593","minerFee": "0.000310593","systemFee": "0","currencySystemFee": "BNB","currencyMinerFee": "BNB"}}
NFT withdraw
post
https://api.cpay.world
/api/public/withdrawal/nft
Endpoint POST /api/public/withdrawal/nft
Parameters
Request body
- to
*
string
- amount
*
object
- contractAddress
*
string
- tokenId
*
string
- type
*
erc721
ERC721, ERC1155
- password
string
- sign
string
base64 format
Responses
- 200:OK{"status": "string","data": {"to": "string","amount": {},"contractAddress": "string","tokenId": "string","type": "erc721"}}
- 200:Example{"status": "success","data": {"id": "65396c89c42d5826fb296abe"}}