Skip to main content
POST
/
create-vesting-grant
Create Vesting Grant
curl --request POST \
  --url https://tokens.shakesco.com/create-vesting-grant \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_ref": "<string>",
  "total_amount": 123,
  "vesting_duration": "<string>",
  "cliff_duration": "<string>",
  "cliff_percent": 123
}
'
import requests

url = "https://tokens.shakesco.com/create-vesting-grant"

payload = {
"customer_ref": "<string>",
"total_amount": 123,
"vesting_duration": "<string>",
"cliff_duration": "<string>",
"cliff_percent": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_ref: '<string>',
total_amount: 123,
vesting_duration: '<string>',
cliff_duration: '<string>',
cliff_percent: 123
})
};

fetch('https://tokens.shakesco.com/create-vesting-grant', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://tokens.shakesco.com/create-vesting-grant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_ref' => '<string>',
'total_amount' => 123,
'vesting_duration' => '<string>',
'cliff_duration' => '<string>',
'cliff_percent' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://tokens.shakesco.com/create-vesting-grant"

payload := strings.NewReader("{\n \"customer_ref\": \"<string>\",\n \"total_amount\": 123,\n \"vesting_duration\": \"<string>\",\n \"cliff_duration\": \"<string>\",\n \"cliff_percent\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://tokens.shakesco.com/create-vesting-grant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_ref\": \"<string>\",\n \"total_amount\": 123,\n \"vesting_duration\": \"<string>\",\n \"cliff_duration\": \"<string>\",\n \"cliff_percent\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://tokens.shakesco.com/create-vesting-grant")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_ref\": \"<string>\",\n \"total_amount\": 123,\n \"vesting_duration\": \"<string>\",\n \"cliff_duration\": \"<string>\",\n \"cliff_percent\": 123\n}"

response = http.request(request)
puts response.read_body
{ "tx_hash": "0xabc..." }
{ "error": "An active vesting grant already exists" }
For the complete documentation index, see llms.txt. Creates a vesting grant for a customer. Tokens are released gradually: a percentage unlocks at the cliff, and the rest unlocks linearly over the remaining vesting period. Each customer can have at most one active grant at a time.
Treat this as a transaction. If you don’t get a 200 OK, check /vesting-info before retrying. A successful retry over an existing grant returns 409.

Request Body

customer_ref
string
required
Your unique identifier for this customer
total_amount
number
required
Total tokens to vest. Decimals allowed.
vesting_duration
string
required
Total vesting period in seconds
cliff_duration
string
required
Cliff period in seconds. No tokens vest before this point.
cliff_percent
number
required
Percent of total released at the cliff (25 = 25%). Decimals allowed.

Response

tx_hash
string
Reference identifier for the grant
await fetch("https://tokens.shakesco.com/create-vesting-grant", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    customer_ref: "customer-123",
    total_amount: 1000,
    vesting_duration: "31536000",
    cliff_duration: "7776000",
    cliff_percent: 25,
  }),
});
{ "tx_hash": "0xabc..." }
{ "error": "An active vesting grant already exists" }