Tangocrypto
Search…
⌃K

Sale Phases

What are sale phases?

A sale phase is a control mechanism that defines how you will sell the collection. You can add different phases to control how you will sell the collection. For example, you might have a total of 5000 NFTs, and you want to sell them in three phases.
sale phases
You can create a pre-sale phase to sell the first 1000 NFTs to previous customers at a special price and within a specific time range. You can identify these customers with a condition; that would be an NFT with one particular policy id on their wallets. Then you create another sale phase for the public drop with 3900 NFTs and no conditions, and last, you leave 100 NFTs as a reserve to mint in the last phase.
This is not a real example; the idea is that you can create several sale phases, and each one can have different parameters and conditions.

Parameters

  • name: Sale phase name. For example, pre-sale.
  • type: (Mandatory) Defines.
    • fixed: Use fixed for selling a particular token or token list identified by the token-id on each token. Use random for random sales, it will pick random tokens from the collection.
    • random: Use random for random sales, it will pick random tokens from the collection.
  • total_tokens: (Mandatory) Defines how many NFTs you will sell in this phase. For example, you are doing a pre-sale, and you want to sell 1000 NFTs.
  • reservation_time: (Mandatory) Reservation time in seconds. This timer defines how long an NFT will be reserved once a potential buyer starts the buying process. During this time interval, the NFT won't be available for sale. No other buyer will be able to create a new reservation. If the payment is not received and this timer expires, then the NFT is ready for sale again, and it can be reserved by another buyer.
  • start_date: Starting date for the sale phase in ISO 8601 format yyyy-mm-ddThh:mm:ss[.mmm]. If you don't provide this value you can start selling immediately and the time condition won't be checked.
  • end_date: Ending date for the sale phase in ISO 8601 format yyyy-mm-ddThh:mm:ss[.mmm]. If you don't provide this value, there is no time boundary; thus, you can sell NFTs until you reach the collection's total amount.
  • price_tiers: Create price tiers per sale phase. A price tier is a way to create bundles and sell them for different prices. For example, you can create a price tier with 10 NFTs for 100 ADA, and the buyer will pay 100 ADA and receive 10 NFTs in their wallet. You can create up to 10 price tiers per sale phase.
    • name: Price tier name. You can name your price tiers within a sale phase.
    • quantity: Amount of tokens to mint in a price tier. For example, you can specify that buyers selecting the bronze price tier will mint 1 token and the buyers choosing the silver price tier will mint a bundle with 5 tokens. You can create a price tier with a maximum of 100 tokens.
    • supply: Token supply. If you don''t specify the supply, it will be set to 1 by default.
    • price: Price for the tier. You can include multiple prices and assets. For example, one NFT can be paid with 50 ADA, 1000000 HOSKY or 500000 LQ.

Random sale phase example

Here we are going to create a sale phase for a pre-sale where we want to sale 1000 random NFTs. We have 4 price tiers and the buyers can select the tier they want to buy. For example, if a buyer want's to get 4 random NFTs they can select the Gold tier and pay 30 Ada.
price tiers for a random sale phase
Generate the sale phase with the price tiers and the links for the four buy buttons.
HTTP
cURL
POST /<app-id>/v1/nft/collections/<collection-id>/phases HTTP/1.1
Host: cardano-testnet.tangocrypto.com
x-api-key: <your-api-key>
Content-Type: application/json
Content-Length: 662
{
"name": "pre-sale",
"type": "random",
"total_tokens": 1000,
"reservation_time": 300,
"price_tiers": [
{
"name": "Bronze",
"quantity": 1,
"supply": 1,
"price": 10000000
},
{
"name": "Silver",
"quantity": 2,
"supply": 1,
"price": 20000000
},
{
"name": "Gold",
"quantity": 4,
"supply": 1,
"price": 30000000
},
{
"name": "Platinum",
"quantity": 8,
"supply": 1,
"price": 60000000
}
]
}
curl --location --request POST 'https://cardano-testnet.tangocrypto.com/<app-id>/v1/nft/collections/<collection-id>/phases' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "pre-sale",
"type": "random",
"total_tokens": 1000,
"reservation_time": 300,
"price_tiers": [
{
"name": "Bronze",
"quantity": 1,
"supply": 1,
"price": 10000000
},
{
"name": "Silver",
"quantity": 2,
"supply": 1,
"price": 20000000
},
{
"name": "Gold",
"quantity": 4,
"supply": 1,
"price": 30000000
},
{
"name": "Platinum",
"quantity": 8,
"supply": 1,
"price": 60000000
}
]
}'
Response
In the response we can see that each price tier has an associated payment link. Then we copy that link and embeded it in the button. When the buyer clicks on the button a new window with Tangopay will open and once the payment is done the NFTs are sent to the wallet.
{
"id": "81d190a7ed1847cc97cf515aa2a70bc2",
"type": "random",
"name": "pre-sale",
"active": true,
"reservation_time": 300,
"total_tokens": 1000,
"remaining_tokens": 1000,
"price_tiers": [
{
"id": "01g75fv3y373yss7gegjadxp87",
"name": "Bronze",
"price": {
"ADA": {
"amount": 10000000
}
},
"quantity": 1,
"supply": 1,
"payment_link": "https://buy.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6IjgxZDE5MGE3ZWQxODQ3Y2M5N2NmNTE1YWEyYTcwYmMyIiwicnVsZXMiOltdLCJwcmljZSI6MTAwMDAwMDAsInByaWNlX2lkIjowLCJxdWFudGl0eSI6MSwic3VwcGx5IjoxLCJ0eXBlIjoiUGhhc2VTYWxlIiwidGNjIjoicVgrcGdJUm00Qm5iVVR2UnFzeGtmK3p4VVBoeFUzaE1rRGVqMTdTSGlwckZMd1BkOGpwaTRleDFCQ2d3YXFyUUpRUEd6SFVVdm9BdEdPbU14dUlYY25LU09rVzkxRVZ1YnhhajdwVDRETVVpaU9NZXdIRXV3eHJUVndQVkFnPT0ifQ=="
},
{
"id": "01g75fv3y4y97dgb4ttm7j4hyn",
"name": "Silver",
"price": {
"ADA": {
"amount": 20000000
}
},
"quantity": 2,
"supply": 1,
"payment_link": "https://buy.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6IjgxZDE5MGE3ZWQxODQ3Y2M5N2NmNTE1YWEyYTcwYmMyIiwicnVsZXMiOltdLCJwcmljZSI6MjAwMDAwMDAsInByaWNlX2lkIjoxLCJxdWFudGl0eSI6Miwic3VwcGx5IjoxLCJ0eXBlIjoiUGhhc2VTYWxlIiwidGNjIjoicVgrcGdJUm00Qm5iVVR2UnFzeGtmK3p4VVBoeFUzaE1rRGVqMTdTSGlwckZMd1BkOGpwaTRleDFCQ2d3YXFyUUpRUEd6SFVVdm9BdEdPbU14dUlYY25LU09rVzkxRVZ1YnhhajdwVDRETVVpaU9NZXdIRXV3eHJUVndQVkFnPT0ifQ=="
},
{
"id": "01g75fv3y3j6h1tms5k7c142nq",
"name": "Gold",
"price": {
"ADA": {
"amount": 30000000
}
},
"quantity": 4,
"supply": 1,
"payment_link": "https://buy.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6IjgxZDE5MGE3ZWQxODQ3Y2M5N2NmNTE1YWEyYTcwYmMyIiwicnVsZXMiOltdLCJwcmljZSI6MzAwMDAwMDAsInByaWNlX2lkIjoyLCJxdWFudGl0eSI6NCwic3VwcGx5IjoxLCJ0eXBlIjoiUGhhc2VTYWxlIiwidGNjIjoicVgrcGdJUm00Qm5iVVR2UnFzeGtmK3p4VVBoeFUzaE1rRGVqMTdTSGlwckZMd1BkOGpwaTRleDFCQ2d3YXFyUUpRUEd6SFVVdm9BdEdPbU14dUlYY25LU09rVzkxRVZ1YnhhajdwVDRETVVpaU9NZXdIRXV3eHJUVndQVkFnPT0ifQ=="
},
{
"id": "01g769vt2vwthc77j7hw0wdvj3",
"name": "Platinum",
"price": {
"ADA": {
"amount": 60000000
}
},
"quantity": 8,
"supply": 1,
"payment_link": "https://by.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6IjgxZDE5MGE3ZWQxODQ3Y2M5N2NmNTE1YWEyYTcwYmMyIiwicnVsZXMiOltdLCJwcmljZSI6NjAwMDAwMDAsInByaWNlX2lkIjozLCJxdWFudGl0eSI6OCwic3VwcGx5IjoxLCJ0eXBlIjoiUGhhc2VTYWxlIiwidGNjIjoicVgrcGdJUm00Qm5iVVR2UnFzeGtmK3p4VVBoeFUzaE1rRGVqMTdTSGlwckZMd1BkOGpwaTRleDFCQ2d3YXFyUUpRUEd6SFVVdm9BdEdPbU14dUlYY25LU09rVzkxRVZ1YnhhajdwVDRETVVpaU9NZXdIRXV3eHJUVndQVkFnPT0ifQ=="
}
],
"created_at": "2022-05-24T03:10:58.988Z",
"updated_at": "2022-05-24T03:10:58.988Z"
}

Fixed sale phase example

Here we are going to create sale phase with thee handpicked NFTs and each one will have a different price.
Sale phase with specific NFTs (fixed sale)
First we need the ids of the items we want to sell. For that we have to list the NFTs in the collection with the following endpoint.
HTTP
cURL
GET /<app-id>/v1/nft/collections/<collection-id>/tokens?size=20 HTTP/1.1
Host: cardano-testnet.tangocrypto.com
x-api-key: <your-api-key>
curl --location --request GET 'https://cardano-testnet.tangocrypto.com/<app-id>/v1/nft/collections/<collection-id>/tokens?size=20' \
--header 'x-api-key: <your-api-key>'
It will return this:
{
"data": [
{
"id": "1268f62589414a5180299b3279810188",
"asset_name": "Cool#01",
"name": "Cool #01",
"fingerprint": "asset126gzze8hpwrh2y9uh05nl59ztdyrnpuxuw57k7",
"status": "FOR_SALE",
"phase_price": 999000000,
"phase_supply": 1,
"phase_available": true,
"description": "Cool bear #01",
"image": "ipfs://QmP8uBgxmTpqqqasQRCEpiq1g9KEjxuRfR5VcvifWoNo",
"media_type": "image/png",
"policy": {
"lock": true,
"lock_time": "2022-12-24T00:00:00.000Z",
"policy_id": "1da9d11690a1cf0b12e379c737a291eba9704c2af4aeb2626808ed5d",
"script": {
"type": "all",
"scripts": [
{
"type": "sig",
"keyHash": "56f10afff7e9c144673f6b13a17009ea6df4acddf54a92729d88f1fe"
},
{
"type": "before",
"slot": 77470767
}
]
}
},
"metadata": {
"721": {
"1da9d11690a1cf0b12e379c737a291eba9704c2af4aeb2626808ed5d": {
"Cool#01": {
"name": "Cool #01",
"description": "Cool bear #01",
"image": "ipfs://QmP8uBgxmTpqqqasQRCEpiq1g9KEjxuRfR5VcvifWoNo",
"mediaType": "image/png",
"color": "Yellow",
"body": "Brown",
"eyes": "Green eyeglasses",
"face": "Happy",
"accessory": "Baseball cap",
"collection": "Tangocrypto Collection",
"artist": "Tangocrypto",
"twitter": "https://twitter.com/tango_crypto",
"website": "https://www.tangocrypto.com",
"copyright": "Tangocrypto 2022",
"serial_no": "12345545",
"md5checksum": "bc527343c7ffc103111f3a694b004e2f"
}
},
"version": "1.0"
}
},
"created_at": "2022-05-23T15:29:46.358Z",
"updated_at": "2022-05-23T15:40:42.648Z"
},
{
"id": "13f47a93d80442e593fcf734de4d90bf",
"asset_name": "Cool#02",
"name": "Cool #02",
"fingerprint": "asset1hzh0uut85ypcueu88422pmgf6twzj2c52f73a5",
"status": "FOR_SALE",
"phase_price": 1199000000,
"phase_supply": 1,
"phase_available": true,
"description": "Cool bear #02",
"image": "ipfs://QmP8uBgxmTiouCUbasQRCEpiq1g9KEjxuRfR5VcvifWoNo",
"media_type": "image/png",
"policy": {
"lock": true,
"lock_time": "2022-12-24T00:00:00.000Z",
"policy_id": "1da9d11690a1cf0b12e379c737a291eba9704c2af4aeb2626808ed5d",
"script": {
"type": "all",
"scripts": [
{
"type": "sig",
"keyHash": "56f10afff7e9c144673f6b13a17009ea6df4acddf54a92729d88f1fe"
},
{
"type": "before",
"slot": 77470767
}
]
}
},
"metadata": {
"721": {
"1da9d11690a1cf0b12e379c737a291eba9704c2af4aeb2626808ed5d": {
"Cool#02": {
"name": "Cool #02",
"description": "Cool bear #02",
"image": "ipfs://QmP8uBgxmTiouCUbasQRCEpiq1g9KEjxuRfR5VcvifWoNo",
"mediaType": "image/png",
"color": "Green",
"body": "Brown",
"eyes": "Orange eyeglasses",
"face": "Happy",
"accessory": "Visor",
"collection": "Tangocrypto Collection",
"artist": "Tangocrypto",
"twitter": "https://twitter.com/tango_crypto",
"website": "https://www.tangocrypto.com",
"copyright": "Tangocrypto 2022",
"serial_no": "13414515",
"md5checksum": "bc527343c7ffc10324kj234a694b004e2f"
}
},
"version": "1.0"
}
},
"created_at": "2022-05-21T13:50:37.574Z",
"updated_at": "2022-05-25T05:23:03.501Z"
},
{
"id": "33abde7a70104e88b87fd715a918f318",
"asset_name": "Cool#03",
"name": "Cool #03",
"fingerprint": "asset1m5ym3xeqxxnfq3e7tec903x0dmztfcgfv8amh2",
"status": "FOR_SALE",
"phase_price": 2000000000,
"phase_supply": 1,
"phase_available": true,
"description": "Cool bear #03",
"image": "ipfs://QmZHWcx7afrxuvcqeqntZtfv93c2V78BWjyi9LCwUEKZmx",
"media_type": "png",
"policy": {
"lock": true,
"lock_time": "2022-12-24T00:00:00.000Z",
"policy_id": "1da9d11690a1cf0b12e379c737a291eba9704c2af4aeb2626808ed5d",
"script": {
"type": "all",
"scripts": [
{
"type": "sig",
"keyHash": "56f10afff7e9c144673f6b13a17009ea6df4acddf54a92729d88f1fe"
},
{
"type": "before",
"slot": 77470767
}
]
}
},
"metadata": {
"721": {
"1da9d11690a1cf0b12e379c737a291eba9704c2af4aeb2626808ed5d": {
"Cool#03": {
"name": "Cool #03",
"description": "Cool bear #03",
"image": "ipfs://QmZHWcx7afrxuvcqeqntZtfv93c2V78BWjyi9LCwUEKZmx",
"mediaType": "image/png",
"color": "Orange",
"body": "Brown",
"eyes": "Sunglasses",
"face": "Happy",
"accessory": "Toy",
"collection": "Tangocrypto Collection",
"artist": "Tangocrypto",
"twitter": "https://twitter.com/tango_crypto",
"website": "https://www.tangocrypto.com",
"copyright": "Tangocrypto 2022",
"serial_no": "9274424672",
"md5checksum": "bvc667343c7ffc103111f3a6922204e9y"
}
},
"version": "1.0"
}
},
"created_at": "2022-05-21T12:13:38.449Z",
"updated_at": "2022-05-25T05:23:03.501Z"
}
],
"cursor": ""
}
Now we have the ids and we can generate the sale phase. We specify is a fixed sale and provide the tokens we want to sale and the price for each one.
HTTP
cURL
POST /<app-id>/v1/nft/collections/<collection-id>/phases HTTP/1.1
Host: cardano-testnet.tangocrypto.com
x-api-key: <your-api-key>
Content-Type: application/json
Content-Length: 662
{
"type": "fixed",
"reservation_time": 300,
"total_tokens": 3,
"tokens": [
{
"id": "1268f62589414a5180299b3279810188",
"price": 999000000,
"supply": 1
},
{
"id": "13f47a93d80442e593fcf734de4d90bf",
"price": 1199000000,
"supply": 1
},
{
"id": "33abde7a70104e88b87fd715a918f318",
"price": 2000000000,
"supply": 1
}
]
}
curl --location --request POST 'https://cardano-testnet.tangocrypto.com/<app-id>/v1/nft/collections/<collection-id>/phases' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "fixed",
"total_tokens": 3,
"reservation_time": 300,
"tokens": [
{
"id": "1268f62589414a5180299b3279810188",
"price": {
"ADA": {
"amount": 999000000
}
}
},
{
"id": "13f47a93d80442e593fcf734de4d90bf",
"price": {
"ADA": {
"amount": 1199000000
}
}
},
{
"id": "33abde7a70104e88b87fd715a918f318",
"price": {
"ADA": {
"amount": 2000000000
}
}
}
]
}'
Response
In the response we can see that each NFT has an associated payment link. Then we copy that link and embeded it in the button. When the buyer clicks on the button a new window with Tangopay will open and once the payment is done the NFTs are sent to the wallet.
{
"id": "bb3cea5b713e409599310227e88574fb",
"type": "fixed",
"active": true,
"reservation_time": 300,
"total_tokens": 3,
"remaining_tokens": 3,
"tokens": [
{
"id": "1268f62589414a5180299b3279810188",
"price": {
"ADA": {
"amount": 999000000
}
}
"supply": 1,
"payment_link": "https://buy.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6ImJiM2NlYTViNzEzZTQwOTU5OTMxMDIyN2U4ODU3NGZiIiwicnVsZXMiOltdLCJwcmljZSI6OTk5MDAwMDAwLCJ0b2tlbl9pZCI6IjEyNjhmNjI1ODk0MTRhNTE4MDI5OWIzMjc5ODEwMTg4IiwicXVhbnRpdHkiOjEsInN1cHBseSI6MSwidHlwZSI6IlBoYXNlU2FsZSIsInRjYyI6InFYK3BnSVJtNEJuYlVUdlJxc3hrZit6eFVQaHhVM2hNa0RlajE3U0hpcHJGTHdQZDhqcGk0ZXgxQkNnd2FxclFKUVBHekhVVXZvQXRHT21NeHVJWGNuS1NPa1c5MUVWdWJ4YWo3cFQ0RE1VaWlPTWV3SEV1d3hyVFZ3UFZBZz09In0="
},
{
"id": "13f47a93d80442e593fcf734de4d90bf",
"price": {
"ADA": {
"amount": 1199000000
}
}
"supply": 1,
"payment_link": "https://buy.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6ImJiM2NlYTViNzEzZTQwOTU5OTMxMDIyN2U4ODU3NGZiIiwicnVsZXMiOltdLCJwcmljZSI6MTE5OTAwMDAwMCwidG9rZW5faWQiOiIxM2Y0N2E5M2Q4MDQ0MmU1OTNmY2Y3MzRkZTRkOTBiZiIsInF1YW50aXR5IjoxLCJzdXBwbHkiOjEsInR5cGUiOiJQaGFzZVNhbGUiLCJ0Y2MiOiJxWCtwZ0lSbTRCbmJVVHZScXN4a2YrenhVUGh4VTNoTWtEZWoxN1NIaXByRkx3UGQ4anBpNGV4MUJDZ3dhcXJRSlFQR3pIVVV2b0F0R09tTXh1SVhjbktTT2tXOTFFVnVieGFqN3BUNERNVWlpT01ld0hFdXd4clRWd1BWQWc9PSJ9"
},
{
"id": "33abde7a70104e88b87fd715a918f318",
"price": {
"ADA": {
"amount": 2000000000
}
}
"supply": 1,
"payment_link": "https://buy.tangocrypto.com?q=test_eyJjb2xsZWN0aW9uX2lkIjoiOTFjMjYyZmRkYjljNGYyOWJmZDc0MTI1NmJmMzAxMWIiLCJwaGFzZV9pZCI6ImJiM2NlYTViNzEzZTQwOTU5OTMxMDIyN2U4ODU3NGZiIiwicnVsZXMiOltdLCJwcmljZSI6MjAwMDAwMDAwMCwidG9rZW5faWQiOiIzM2FiZGU3YTcwMTA0ZTg4Yjg3ZmQ3MTVhOTE4ZjMxOCIsInF1YW50aXR5IjoxLCJzdXBwbHkiOjEsInR5cGUiOiJQaGFzZVNhbGUiLCJ0Y2MiOiJxWCtwZ0lSbTRCbmJVVHZScXN4a2YrenhVUGh4VTNoTWtEZWoxN1NIaXByRkx3UGQ4anBpNGV4MUJDZ3dhcXJRSlFQR3pIVVV2b0F0R09tTXh1SVhjbktTT2tXOTFFVnVieGFqN3BUNERNVWlpT01ld0hFdXd4clRWd1BWQWc9PSJ9"
}
],
"created_at": "2022-05-24T04:53:04.312Z",
"updated_at": "2022-05-24T04:53:04.312Z"
}