Prepare a sell
curl --request POST \
--url https://partners-api.sandbox.securitize.io/stocks/v1/stocks/off-ramp/{contractAddress}/prepare-execute-transaction \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"investorId": "6b31c0e9a4f2d17e85c3b904",
"signedPrice": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeW1ib2wiOiJBQVBML1VTRCJ9.c2lnbmF0dXJl",
"slippageBps": "50",
"assetAmount": "2000000000",
"minOutputAmount": "460127800"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
investorId: '6b31c0e9a4f2d17e85c3b904',
signedPrice: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeW1ib2wiOiJBQVBML1VTRCJ9.c2lnbmF0dXJl',
slippageBps: '50',
assetAmount: '2000000000',
minOutputAmount: '460127800'
})
};
fetch('https://partners-api.sandbox.securitize.io/stocks/v1/stocks/off-ramp/{contractAddress}/prepare-execute-transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners-api.sandbox.securitize.io/stocks/v1/stocks/off-ramp/{contractAddress}/prepare-execute-transaction"
payload = {
"investorId": "6b31c0e9a4f2d17e85c3b904",
"signedPrice": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeW1ib2wiOiJBQVBML1VTRCJ9.c2lnbmF0dXJl",
"slippageBps": "50",
"assetAmount": "2000000000",
"minOutputAmount": "460127800"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"unsignedTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA…",
"additionalData": {
"anchorPrice": "231250000000000000000",
"operator": "Gp3ratorRoutr9sXcR8yLmB3hW9sJdE6aK1uNqG5tYpC"
}
}{
"statusCode": 400,
"message": "EXPIRED_PRICE",
"error": "Bad Request"
}{
"message": "No API key found in request"
}{
"statusCode": 403,
"message": "UNAUTHORIZED_INVESTOR",
"error": "Forbidden"
}{
"statusCode": 404,
"message": "SYMBOL_NOT_FOUND",
"error": "Not Found"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Trading
Prepare a sell
Builds the transaction that sells the stock token for USDC, from the investor’s linked wallet. Everything said for a buy holds: the same checks, Securitize pays the network fee, sign without modifying, submit within 120 seconds.
POST
/
stocks
/
off-ramp
/
{contractAddress}
/
prepare-execute-transaction
Prepare a sell
curl --request POST \
--url https://partners-api.sandbox.securitize.io/stocks/v1/stocks/off-ramp/{contractAddress}/prepare-execute-transaction \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"investorId": "6b31c0e9a4f2d17e85c3b904",
"signedPrice": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeW1ib2wiOiJBQVBML1VTRCJ9.c2lnbmF0dXJl",
"slippageBps": "50",
"assetAmount": "2000000000",
"minOutputAmount": "460127800"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
investorId: '6b31c0e9a4f2d17e85c3b904',
signedPrice: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeW1ib2wiOiJBQVBML1VTRCJ9.c2lnbmF0dXJl',
slippageBps: '50',
assetAmount: '2000000000',
minOutputAmount: '460127800'
})
};
fetch('https://partners-api.sandbox.securitize.io/stocks/v1/stocks/off-ramp/{contractAddress}/prepare-execute-transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners-api.sandbox.securitize.io/stocks/v1/stocks/off-ramp/{contractAddress}/prepare-execute-transaction"
payload = {
"investorId": "6b31c0e9a4f2d17e85c3b904",
"signedPrice": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeW1ib2wiOiJBQVBML1VTRCJ9.c2lnbmF0dXJl",
"slippageBps": "50",
"assetAmount": "2000000000",
"minOutputAmount": "460127800"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"unsignedTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA…",
"additionalData": {
"anchorPrice": "231250000000000000000",
"operator": "Gp3ratorRoutr9sXcR8yLmB3hW9sJdE6aK1uNqG5tYpC"
}
}{
"statusCode": 400,
"message": "EXPIRED_PRICE",
"error": "Bad Request"
}{
"message": "No API key found in request"
}{
"statusCode": 403,
"message": "UNAUTHORIZED_INVESTOR",
"error": "Forbidden"
}{
"statusCode": 404,
"message": "SYMBOL_NOT_FOUND",
"error": "Not Found"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Authorizations
Path Parameters
Body
application/json
Response
The transaction for the investor's wallet to sign.