Modify a working order
curl --request PATCH \
--url https://developers.fundingperpetuals.com/v1/orders/{order_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": 123,
"size": 123
}
'import requests
url = "https://developers.fundingperpetuals.com/v1/orders/{order_id}"
payload = {
"price": 123,
"size": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: 123, size: 123})
};
fetch('https://developers.fundingperpetuals.com/v1/orders/{order_id}', 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://developers.fundingperpetuals.com/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'price' => 123,
'size' => 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://developers.fundingperpetuals.com/v1/orders/{order_id}"
payload := strings.NewReader("{\n \"price\": 123,\n \"size\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://developers.fundingperpetuals.com/v1/orders/{order_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 123,\n \"size\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developers.fundingperpetuals.com/v1/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": 123,\n \"size\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"account_id": "<string>",
"market_id": "<string>",
"provider": "<string>",
"symbol": "<string>",
"coin": "<string>",
"size": 123,
"expected_price": 123,
"leverage": 123,
"reduce_only": true,
"requested_at": 123,
"initial_size": 123,
"filled_size": 123,
"fill_price": 123,
"trigger_price": 123,
"limit_price": 123,
"notional": 123,
"fee": 123,
"realized_pnl": 123,
"gtd_expires_at": 123,
"attached_take_profit_price": 123,
"attached_stop_loss_price": 123,
"chase_offset": 123,
"chase_cap_price": 123,
"trigger_market_id": "<string>",
"target_position_id": "<string>",
"partial_of_order_id": "<string>",
"partial_fill_root_order_id": "<string>",
"twap_order_id": "<string>",
"scaled_order_id": "<string>",
"reject_reason": "<string>",
"reject_rule_id": "<string>",
"settled_at": 123,
"canceled_at": 123
},
"queued": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_id": "<string>",
"rule_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Orders
Modify a working order
Reprices a modifiable order and optionally changes its size.
PATCH
/
v1
/
orders
/
{order_id}
Modify a working order
curl --request PATCH \
--url https://developers.fundingperpetuals.com/v1/orders/{order_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": 123,
"size": 123
}
'import requests
url = "https://developers.fundingperpetuals.com/v1/orders/{order_id}"
payload = {
"price": 123,
"size": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: 123, size: 123})
};
fetch('https://developers.fundingperpetuals.com/v1/orders/{order_id}', 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://developers.fundingperpetuals.com/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'price' => 123,
'size' => 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://developers.fundingperpetuals.com/v1/orders/{order_id}"
payload := strings.NewReader("{\n \"price\": 123,\n \"size\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://developers.fundingperpetuals.com/v1/orders/{order_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 123,\n \"size\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developers.fundingperpetuals.com/v1/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": 123,\n \"size\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"account_id": "<string>",
"market_id": "<string>",
"provider": "<string>",
"symbol": "<string>",
"coin": "<string>",
"size": 123,
"expected_price": 123,
"leverage": 123,
"reduce_only": true,
"requested_at": 123,
"initial_size": 123,
"filled_size": 123,
"fill_price": 123,
"trigger_price": 123,
"limit_price": 123,
"notional": 123,
"fee": 123,
"realized_pnl": 123,
"gtd_expires_at": 123,
"attached_take_profit_price": 123,
"attached_stop_loss_price": 123,
"chase_offset": 123,
"chase_cap_price": 123,
"trigger_market_id": "<string>",
"target_position_id": "<string>",
"partial_of_order_id": "<string>",
"partial_fill_root_order_id": "<string>",
"twap_order_id": "<string>",
"scaled_order_id": "<string>",
"reject_reason": "<string>",
"reject_rule_id": "<string>",
"settled_at": 123,
"canceled_at": 123
},
"queued": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_id": "<string>",
"rule_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}⌘I