Receive Trade Update
curl --request POST \
--url https://api.example.com/api/internal/execution/trade-update \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "<string>",
"event_type": "<string>",
"order_id": "<string>",
"dedup_key": "<string>",
"client_order_id": "<string>",
"filled_qty": 123,
"filled_avg_price": 123,
"filled_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"replaced_by": "<string>",
"total_order_qty": 123,
"fill_context": "entry",
"source": "websocket",
"received_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/api/internal/execution/trade-update"
payload = {
"user_id": "<string>",
"event_type": "<string>",
"order_id": "<string>",
"dedup_key": "<string>",
"client_order_id": "<string>",
"filled_qty": 123,
"filled_avg_price": 123,
"filled_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"replaced_by": "<string>",
"total_order_qty": 123,
"fill_context": "entry",
"source": "websocket",
"received_at": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
event_type: '<string>',
order_id: '<string>',
dedup_key: '<string>',
client_order_id: '<string>',
filled_qty: 123,
filled_avg_price: 123,
filled_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
replaced_by: '<string>',
total_order_qty: 123,
fill_context: 'entry',
source: 'websocket',
received_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/api/internal/execution/trade-update', 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.example.com/api/internal/execution/trade-update",
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([
'user_id' => '<string>',
'event_type' => '<string>',
'order_id' => '<string>',
'dedup_key' => '<string>',
'client_order_id' => '<string>',
'filled_qty' => 123,
'filled_avg_price' => 123,
'filled_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'replaced_by' => '<string>',
'total_order_qty' => 123,
'fill_context' => 'entry',
'source' => 'websocket',
'received_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/internal/execution/trade-update"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"event_type\": \"<string>\",\n \"order_id\": \"<string>\",\n \"dedup_key\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"filled_qty\": 123,\n \"filled_avg_price\": 123,\n \"filled_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"replaced_by\": \"<string>\",\n \"total_order_qty\": 123,\n \"fill_context\": \"entry\",\n \"source\": \"websocket\",\n \"received_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/internal/execution/trade-update")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"event_type\": \"<string>\",\n \"order_id\": \"<string>\",\n \"dedup_key\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"filled_qty\": 123,\n \"filled_avg_price\": 123,\n \"filled_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"replaced_by\": \"<string>\",\n \"total_order_qty\": 123,\n \"fill_context\": \"entry\",\n \"source\": \"websocket\",\n \"received_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/internal/execution/trade-update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"event_type\": \"<string>\",\n \"order_id\": \"<string>\",\n \"dedup_key\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"filled_qty\": 123,\n \"filled_avg_price\": 123,\n \"filled_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"replaced_by\": \"<string>\",\n \"total_order_qty\": 123,\n \"fill_context\": \"entry\",\n \"source\": \"websocket\",\n \"received_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Internal Execution
Receive Trade Update
Receive a forwarded trade update event from the Go WebSocket consumer.
Validates auth, uses Go-computed dedup key, and delegates to process_trade_update().
POST
/
api
/
internal
/
execution
/
trade-update
Receive Trade Update
curl --request POST \
--url https://api.example.com/api/internal/execution/trade-update \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "<string>",
"event_type": "<string>",
"order_id": "<string>",
"dedup_key": "<string>",
"client_order_id": "<string>",
"filled_qty": 123,
"filled_avg_price": 123,
"filled_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"replaced_by": "<string>",
"total_order_qty": 123,
"fill_context": "entry",
"source": "websocket",
"received_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/api/internal/execution/trade-update"
payload = {
"user_id": "<string>",
"event_type": "<string>",
"order_id": "<string>",
"dedup_key": "<string>",
"client_order_id": "<string>",
"filled_qty": 123,
"filled_avg_price": 123,
"filled_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"replaced_by": "<string>",
"total_order_qty": 123,
"fill_context": "entry",
"source": "websocket",
"received_at": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
event_type: '<string>',
order_id: '<string>',
dedup_key: '<string>',
client_order_id: '<string>',
filled_qty: 123,
filled_avg_price: 123,
filled_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
replaced_by: '<string>',
total_order_qty: 123,
fill_context: 'entry',
source: 'websocket',
received_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/api/internal/execution/trade-update', 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.example.com/api/internal/execution/trade-update",
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([
'user_id' => '<string>',
'event_type' => '<string>',
'order_id' => '<string>',
'dedup_key' => '<string>',
'client_order_id' => '<string>',
'filled_qty' => 123,
'filled_avg_price' => 123,
'filled_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'replaced_by' => '<string>',
'total_order_qty' => 123,
'fill_context' => 'entry',
'source' => 'websocket',
'received_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/internal/execution/trade-update"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"event_type\": \"<string>\",\n \"order_id\": \"<string>\",\n \"dedup_key\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"filled_qty\": 123,\n \"filled_avg_price\": 123,\n \"filled_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"replaced_by\": \"<string>\",\n \"total_order_qty\": 123,\n \"fill_context\": \"entry\",\n \"source\": \"websocket\",\n \"received_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/internal/execution/trade-update")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"event_type\": \"<string>\",\n \"order_id\": \"<string>\",\n \"dedup_key\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"filled_qty\": 123,\n \"filled_avg_price\": 123,\n \"filled_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"replaced_by\": \"<string>\",\n \"total_order_qty\": 123,\n \"fill_context\": \"entry\",\n \"source\": \"websocket\",\n \"received_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/internal/execution/trade-update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"event_type\": \"<string>\",\n \"order_id\": \"<string>\",\n \"dedup_key\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"filled_qty\": 123,\n \"filled_avg_price\": 123,\n \"filled_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"replaced_by\": \"<string>\",\n \"total_order_qty\": 123,\n \"fill_context\": \"entry\",\n \"source\": \"websocket\",\n \"received_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request model for POST /api/internal/execution/trade-update.
Guarantees Decimal parsing for prices/quantities (QR-I1). Dedup key computed by Go, validated as 64-char hex (SEC-6c).
Pattern:
^[0-9a-f-]{36}$Pattern:
^(fill|partial_fill|canceled|rejected|expired|replaced|order_cancel_rejected|done_for_day)$Maximum string length:
64Pattern:
^[a-f0-9-]+$Pattern:
^[0-9a-f]{64}$Maximum string length:
64Maximum string length:
64Pattern:
^(entry|exit)$Pattern:
^(websocket)$Response
Successful Response