Buy Presale
Participate in the presale from a holder's account with USDC.
POSTapi.metal.build/holder/:holderId/buy-presale
Buy presale
This endpoint allows you to buy presale with USDC.
Required attributes
- Name
presaleId
- Type
- string
- Description
The ID of the presale you want to buy.
- Name
usdcAmount
- Type
- number
- Description
The amount of USDC you want to spend on the presale.
Request
POST
api.metal.build/holder/:holderId/buy-presaleconst response = await fetch('https://api.metal.build/holder/:holderId/buy-presale', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_SECRET_API_KEY',
},
body: JSON.stringify({
"presaleId": "81ce774a-ebaf-4d19-ba77-b1dbb41bc5d1",
"usdcAmount": 0.5
}),
})
const presaleBuy = await response.json()
Response
{
"success": true
}