curl --request POST \
--url https://api.saber.money/api/v2/wallet/transaction/sell \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Request-Id: <x-request-id>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--header 'X-User-Id: <x-user-id>' \
--data '
{
"source_id": "c41f7d27-781c-41da-b74c-278fe7202af5",
"fiat_symbol": "INR",
"crypto_symbol": "USDT",
"fiat_amount": 100,
"crypto_amount": 1.14,
"payment_method": "bank_transfer",
"uuid": "dc605164-7974-4413-af93-243b346a4a06"
}
'import requests
url = "https://api.saber.money/api/v2/wallet/transaction/sell"
payload = {
"source_id": "c41f7d27-781c-41da-b74c-278fe7202af5",
"fiat_symbol": "INR",
"crypto_symbol": "USDT",
"fiat_amount": 100,
"crypto_amount": 1.14,
"payment_method": "bank_transfer",
"uuid": "dc605164-7974-4413-af93-243b346a4a06"
}
headers = {
"X-Api-Key": "<x-api-key>",
"X-Signature": "<x-signature>",
"X-Timestamp": "<x-timestamp>",
"X-Request-Id": "<x-request-id>",
"X-User-Id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Api-Key': '<x-api-key>',
'X-Signature': '<x-signature>',
'X-Timestamp': '<x-timestamp>',
'X-Request-Id': '<x-request-id>',
'X-User-Id': '<x-user-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source_id: 'c41f7d27-781c-41da-b74c-278fe7202af5',
fiat_symbol: 'INR',
crypto_symbol: 'USDT',
fiat_amount: 100,
crypto_amount: 1.14,
payment_method: 'bank_transfer',
uuid: 'dc605164-7974-4413-af93-243b346a4a06'
})
};
fetch('https://api.saber.money/api/v2/wallet/transaction/sell', 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://api.saber.money/api/v2/wallet/transaction/sell",
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([
'source_id' => 'c41f7d27-781c-41da-b74c-278fe7202af5',
'fiat_symbol' => 'INR',
'crypto_symbol' => 'USDT',
'fiat_amount' => 100,
'crypto_amount' => 1.14,
'payment_method' => 'bank_transfer',
'uuid' => 'dc605164-7974-4413-af93-243b346a4a06'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>",
"X-Request-Id: <x-request-id>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>",
"X-User-Id: <x-user-id>"
],
]);
$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://api.saber.money/api/v2/wallet/transaction/sell"
payload := strings.NewReader("{\n \"source_id\": \"c41f7d27-781c-41da-b74c-278fe7202af5\",\n \"fiat_symbol\": \"INR\",\n \"crypto_symbol\": \"USDT\",\n \"fiat_amount\": 100,\n \"crypto_amount\": 1.14,\n \"payment_method\": \"bank_transfer\",\n \"uuid\": \"dc605164-7974-4413-af93-243b346a4a06\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Request-Id", "<x-request-id>")
req.Header.Add("X-User-Id", "<x-user-id>")
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://api.saber.money/api/v2/wallet/transaction/sell")
.header("X-Api-Key", "<x-api-key>")
.header("X-Signature", "<x-signature>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Request-Id", "<x-request-id>")
.header("X-User-Id", "<x-user-id>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"c41f7d27-781c-41da-b74c-278fe7202af5\",\n \"fiat_symbol\": \"INR\",\n \"crypto_symbol\": \"USDT\",\n \"fiat_amount\": 100,\n \"crypto_amount\": 1.14,\n \"payment_method\": \"bank_transfer\",\n \"uuid\": \"dc605164-7974-4413-af93-243b346a4a06\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saber.money/api/v2/wallet/transaction/sell")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["X-Signature"] = '<x-signature>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Request-Id"] = '<x-request-id>'
request["X-User-Id"] = '<x-user-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"c41f7d27-781c-41da-b74c-278fe7202af5\",\n \"fiat_symbol\": \"INR\",\n \"crypto_symbol\": \"USDT\",\n \"fiat_amount\": 100,\n \"crypto_amount\": 1.14,\n \"payment_method\": \"bank_transfer\",\n \"uuid\": \"dc605164-7974-4413-af93-243b346a4a06\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"status": "CREATED",
"fiat_amount": 100,
"transaction_type": "SELL",
"fiat_symbol": "INR",
"failure_code": null,
"exchange_rate": 82.56976,
"id": "a892dc4a-aecb-4a22-9de4-2990b4179b77",
"crypto_symbol": "USDT",
"created_at": "2022-10-03 07:51:15",
"bank_transaction_id": null,
"source_id": "65d246fc-6a5b-43d7-89bf-944e95ff2279",
"failure_desc": null,
"crypto_amount": 1.14
}
}{
"success": false,
"errors": [
{
"code": 400001,
"text": "missing or invalid parameters"
}
]
}{
"success": false,
"errors": [
{
"code": 400001,
"text": "missing or invalid parameters"
}
]
}{
"success": false,
"errors": [
{
"code": 400001,
"text": "missing or invalid parameters"
}
]
}Create Sell Transaction
Create a sell transaction from the user’s wallet.
Response field values
| Field | Possible Values |
|---|---|
transaction_type | SELL |
status | Typically CREATED immediately after creation |
failure_code, failure_desc | null until the transaction fails |
curl --request POST \
--url https://api.saber.money/api/v2/wallet/transaction/sell \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Request-Id: <x-request-id>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--header 'X-User-Id: <x-user-id>' \
--data '
{
"source_id": "c41f7d27-781c-41da-b74c-278fe7202af5",
"fiat_symbol": "INR",
"crypto_symbol": "USDT",
"fiat_amount": 100,
"crypto_amount": 1.14,
"payment_method": "bank_transfer",
"uuid": "dc605164-7974-4413-af93-243b346a4a06"
}
'import requests
url = "https://api.saber.money/api/v2/wallet/transaction/sell"
payload = {
"source_id": "c41f7d27-781c-41da-b74c-278fe7202af5",
"fiat_symbol": "INR",
"crypto_symbol": "USDT",
"fiat_amount": 100,
"crypto_amount": 1.14,
"payment_method": "bank_transfer",
"uuid": "dc605164-7974-4413-af93-243b346a4a06"
}
headers = {
"X-Api-Key": "<x-api-key>",
"X-Signature": "<x-signature>",
"X-Timestamp": "<x-timestamp>",
"X-Request-Id": "<x-request-id>",
"X-User-Id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Api-Key': '<x-api-key>',
'X-Signature': '<x-signature>',
'X-Timestamp': '<x-timestamp>',
'X-Request-Id': '<x-request-id>',
'X-User-Id': '<x-user-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source_id: 'c41f7d27-781c-41da-b74c-278fe7202af5',
fiat_symbol: 'INR',
crypto_symbol: 'USDT',
fiat_amount: 100,
crypto_amount: 1.14,
payment_method: 'bank_transfer',
uuid: 'dc605164-7974-4413-af93-243b346a4a06'
})
};
fetch('https://api.saber.money/api/v2/wallet/transaction/sell', 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://api.saber.money/api/v2/wallet/transaction/sell",
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([
'source_id' => 'c41f7d27-781c-41da-b74c-278fe7202af5',
'fiat_symbol' => 'INR',
'crypto_symbol' => 'USDT',
'fiat_amount' => 100,
'crypto_amount' => 1.14,
'payment_method' => 'bank_transfer',
'uuid' => 'dc605164-7974-4413-af93-243b346a4a06'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>",
"X-Request-Id: <x-request-id>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>",
"X-User-Id: <x-user-id>"
],
]);
$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://api.saber.money/api/v2/wallet/transaction/sell"
payload := strings.NewReader("{\n \"source_id\": \"c41f7d27-781c-41da-b74c-278fe7202af5\",\n \"fiat_symbol\": \"INR\",\n \"crypto_symbol\": \"USDT\",\n \"fiat_amount\": 100,\n \"crypto_amount\": 1.14,\n \"payment_method\": \"bank_transfer\",\n \"uuid\": \"dc605164-7974-4413-af93-243b346a4a06\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Request-Id", "<x-request-id>")
req.Header.Add("X-User-Id", "<x-user-id>")
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://api.saber.money/api/v2/wallet/transaction/sell")
.header("X-Api-Key", "<x-api-key>")
.header("X-Signature", "<x-signature>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Request-Id", "<x-request-id>")
.header("X-User-Id", "<x-user-id>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"c41f7d27-781c-41da-b74c-278fe7202af5\",\n \"fiat_symbol\": \"INR\",\n \"crypto_symbol\": \"USDT\",\n \"fiat_amount\": 100,\n \"crypto_amount\": 1.14,\n \"payment_method\": \"bank_transfer\",\n \"uuid\": \"dc605164-7974-4413-af93-243b346a4a06\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saber.money/api/v2/wallet/transaction/sell")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["X-Signature"] = '<x-signature>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Request-Id"] = '<x-request-id>'
request["X-User-Id"] = '<x-user-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"c41f7d27-781c-41da-b74c-278fe7202af5\",\n \"fiat_symbol\": \"INR\",\n \"crypto_symbol\": \"USDT\",\n \"fiat_amount\": 100,\n \"crypto_amount\": 1.14,\n \"payment_method\": \"bank_transfer\",\n \"uuid\": \"dc605164-7974-4413-af93-243b346a4a06\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"status": "CREATED",
"fiat_amount": 100,
"transaction_type": "SELL",
"fiat_symbol": "INR",
"failure_code": null,
"exchange_rate": 82.56976,
"id": "a892dc4a-aecb-4a22-9de4-2990b4179b77",
"crypto_symbol": "USDT",
"created_at": "2022-10-03 07:51:15",
"bank_transaction_id": null,
"source_id": "65d246fc-6a5b-43d7-89bf-944e95ff2279",
"failure_desc": null,
"crypto_amount": 1.14
}
}{
"success": false,
"errors": [
{
"code": 400001,
"text": "missing or invalid parameters"
}
]
}{
"success": false,
"errors": [
{
"code": 400001,
"text": "missing or invalid parameters"
}
]
}{
"success": false,
"errors": [
{
"code": 400001,
"text": "missing or invalid parameters"
}
]
}Headers
Your API key (configured in credentials)
HMAC-SHA256 signature (auto-generated) To test manually: HMAC-SHA256 of apiKey + timestamp (or apiKey + timestamp + userId when X-User-Id is required), keyed with your API secret. The HMAC Generator flow computes this for you.
Unix timestamp in seconds (auto-generated) Unix seconds, e.g. Math.floor(Date.now() / 1000). Must match the timestamp used in the X-Signature computation.
Unique request identifier (auto-generated) Any unique string per request, e.g. a UUID.
User UUID (set above)
Body
Source instrument id.
Fiat currency symbol.
Crypto currency symbol.
Fiat amount to sell against.
Crypto amount to sell.
Payment method.
Optional client reference UUID.
Whether the transaction is a first-party transfer.
Related topics
Initiating TransactionCreate External SellCreate Pool Sell TransactionGet Sell Transaction DetailsGet External Sell Transaction DetailsWas this page helpful?