POST
https://api.cryptohopper.com/v1/hopper/{id}/position/sync
Adds an open position for a coin balance the hopper does not track yet, using the amount and rate you send, and records a matching buy trade.
OAuth scope:
read manage About scopes
currency, amount and rate are all required. Not available for exchange arbitrage, market maker, copy and grid bots.
Example request
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/sync" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"currency":"ETH","amount":0.25,"rate":3120.45}'
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/sync', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"currency": "ETH",
"amount": 0.25,
"rate": 3120.45
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/sync",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"currency": "ETH",
"amount": 0.25,
"rate": 3120.45
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/sync');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'ETH',
'amount' => 0.25,
'rate' => 3120.45,
]),
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Hopper ID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
currency | string | Optional | |
rate | number | Optional | |
amount | number | Optional |
Response
{
"data": "Position has been synced."
}