-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanual-order.http
More file actions
316 lines (291 loc) · 15.9 KB
/
manual-order.http
File metadata and controls
316 lines (291 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
### create trade orders (a buy order, with custom field)
@accountId = 48d42589-8b74-4804-b762-c7f609b8a3cd
@instrumentId = 2841d9de-d2bb-43e8-9a58-696c2a213c16
@orderAmount = 1.00
@orderPrice = 42.00
POST {{apiUrl}} HTTP/1.1
SOAPAction: "http://tempuri.org/CreateTradeOrders"
Content-Type: text/xml; charset=utf-8
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateTradeOrders xmlns="http://tempuri.org/">
<req>
<Credentials>
<UserName>{{userName}}</UserName>
<Password>{{password}}</Password>
</Credentials>
<identify>{{identify}}</identify>
<Entities>
<TradeOrder>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<CustomFields>
<CustomField>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<FieldName>MyCustomField</FieldName>
<Value>SecretValue</Value>
<HiddenFromGui>false</HiddenFromGui>
</CustomField>
</CustomFields>
<TradeOrderDirectionKey>Buy</TradeOrderDirectionKey>
<Account>{{accountId}}</Account>
<Instrument>{{instrumentId}}</Instrument>
<InstrumentAmount>{{orderAmount}}</InstrumentAmount>
<CashAmount xsi:nil="true"/>
<CommissionAmount>0</CommissionAmount>
<OverrideCommissionAmount>false</OverrideCommissionAmount>
<IsUnitOrder>true</IsUnitOrder>
<ReserveAssets>false</ReserveAssets>
<LimitPrice>{{orderPrice}}</LimitPrice>
<ExternalReference>MyExternalReference</ExternalReference>
<ExecutionInterfaceKey>Manual</ExecutionInterfaceKey>
<OrderDateAndTime>0001-01-01T00:00:00</OrderDateAndTime>
<OrderSettlementType>PAYMENT</OrderSettlementType>
<DecisionMakerWithinFirm>00000000-0000-0000-0000-000000000000</DecisionMakerWithinFirm>
<ShortSellingIndicator xsi:nil="true"/>
<BusinessEventId>00000000-0000-0000-0000-000000000000</BusinessEventId>
</TradeOrder>
</Entities>
</req>
</CreateTradeOrders>
</s:Body>
</s:Envelope>
### get all trade order created one day around on a specified account
POST {{apiUrl}} HTTP/1.1
SOAPAction: http://tempuri.org/GetTradeOrders
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetTradeOrders xmlns="http://tempuri.org/">
<req>
<Credentials>
<UserName>{{userName}}</UserName>
<Password>{{password}}</Password>
</Credentials>
<identify>{{identify}}</identify>
<Args>
<Accounts>
<guid>{{accountId}}</guid>
</Accounts>
<CreatedDateFrom>{{$datetime iso8601 -1 d}}</CreatedDateFrom>
<CreatedDateTo>{{$datetime iso8601 1 d}}</CreatedDateTo>
</Args>
<Fields>
{{allOrderFields}}
</Fields>
</req>
</GetTradeOrders>
</soap:Body>
</soap:Envelope>
### execute trade orders
@orderId = 91eaa03e-1af3-4881-8157-3b6b89f48144
@instrumentAmount = 42.00
@executePrice = 1.00
@counterPartyAccountId = 6a11b5fe-5941-44fc-b38a-58576a48ecdb
@feeAccountId = c62aed0a-f792-4615-a7c1-3c6a8ec875a4
@cashCustodyAccountId = cdd9b393-6593-4912-bdbf-2d207bd7817a
@tradeDateAndTime = {{$datetime iso8601}}
POST {{apiUrl}} HTTP/1.1
SOAPAction: "http://tempuri.org/ExecuteOrders"
Content-Type: text/xml; charset=utf-8
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ExecuteOrders xmlns="http://tempuri.org/">
<req>
<Credentials>
<UserName>{{userName}}</UserName>
<Password>{{password}}</Password>
</Credentials>
<identify>{{identify}}</identify>
<Entities>
<OrderExecuteBase xsi:type="ManualOrderExecute">
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<OrderBrickId>{{orderId}}</OrderBrickId>
<InstrumentAmount>{{instrumentAmount}}</InstrumentAmount>
<CashAmount xsi:nil="true"/>
<Price>{{executePrice}}</Price>
<TradeDate>{{tradeDateAndTime}}</TradeDate>
<ValueDate>{{$datetime iso8601 2 d}}</ValueDate>
<SettlementDate>{{$datetime iso8601 2 d}}</SettlementDate>
<CounterPartyAccountBrickId>{{counterPartyAccountId}}</CounterPartyAccountBrickId>
<FeeAccountBrickId>{{feeAccountId}}</FeeAccountBrickId>
<CashCustodyAccountBrickId>{{cashCustodyAccountId}}</CashCustodyAccountBrickId>
<InstrumentCustodyAccountBrickId>00000000-0000-0000-0000-000000000000</InstrumentCustodyAccountBrickId>
<TrsInformation>
<TradingVenueBrickId xsi:nil="true"/>
<TRSTradingCapacity>AOTC</TRSTradingCapacity>
<INTC>false</INTC>
<ExecutionWithinFirmType>ALGO</ExecutionWithinFirmType>
<ExecutionWithinFirm_USER xsi:nil="true"/>
<ExecutionWithinFirm_ALGO xsi:nil="true"/>
<TradeTime>{{tradeDateAndTime}}</TradeTime>
</TrsInformation>
</OrderExecuteBase>
</Entities>
</req>
</ExecuteOrders>
</s:Body>
</s:Envelope>
### settle trade orders (settle one specified order)
@settlementDate = {{$datetime iso8601 2 d}}
@valueDate = {{$datetime iso8601 2 d}}
POST {{apiUrl}} HTTP/1.1
SOAPAction: "http://tempuri.org/SettleOrders"
Content-Type: text/xml; charset=utf-8
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SettleOrders xmlns="http://tempuri.org/">
<req>
<Credentials>
<UserName>{{userName}}</UserName>
<Password>{{password}}</Password>
</Credentials>
<identify>{{identify}}</identify>
<Entities>
<OrderSettleBase xsi:type="ManualOrderSettle">
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<OrderBrickId>{{orderId}}</OrderBrickId>
<CashSettlementDate>{{settlementDate}}</CashSettlementDate>
<InstrumentSettlementDate>{{settlementDate}}</InstrumentSettlementDate>
<CashValueDate>{{valueDate}}</CashValueDate>
<InstrumentValueDate>{{valueDate}}</InstrumentValueDate>
</OrderSettleBase>
</Entities>
</req>
</SettleOrders>
</s:Body>
</s:Envelope>
### create business transactions (custom commission on the trande)
// from one account to another, trade dimension only, with custom fields on super transaction and on first business transaction
// the transaction will have correct reference to the trade order (the references by OrderId and BusinessEventId on super transaction)
// the transaction will be visible on trade order note (the reference by NoteId on super transaction)
@accountFromId = 48d42589-8b74-4804-b762-c7f609b8a3cd
@accountToId = faec023e-f10d-43e6-b082-0b34d487c1db
@assetId = 06e093dc-3e8c-4592-b28f-2c48d8a266b1
@amount = 100.00
@reference = Manualy created transaction
@transactionType = Default_Payment_Trade_Cash_Commission
@tradeDate = {{$datetime iso8601}}
@businessEventId = 33a2e733-8b71-463b-b62f-789a9e76b427
@noteId = 8ff23626-13c8-4573-bd28-9af6341a5943
POST {{apiUrl}} HTTP/1.1
SOAPAction: "http://tempuri.org/CreateBusinessTransactions"
Content-Type: text/xml; charset=utf-8
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateBusinessTransactions xmlns="http://tempuri.org/">
<req>
<Credentials>
<UserName>{{userName}}</UserName>
<Password>{{password}}</Password>
</Credentials>
<identify>{{identify}}</identify>
<Entities>
<SuperTransaction>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<CustomFields>
<CustomField>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<FieldName>SuperCustomField</FieldName>
<Value>super-transaction</Value>
<HiddenFromGui>false</HiddenFromGui>
</CustomField>
</CustomFields>
<BusinessTransactions>
<BusinessTransaction>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CustomFields>
<CustomField>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<FieldName>TransactionCustomField</FieldName>
<Value>transaction</Value>
<HiddenFromGui>false</HiddenFromGui>
</CustomField>
</CustomFields>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<Account>{{accountFromId}}</Account>
<BusinessTransactionType>{{transactionType}}</BusinessTransactionType>
<TransactionReference>{{reference}}</TransactionReference>
<Asset1>{{assetId}}</Asset1>
<Asset2>00000000-0000-0000-0000-000000000000</Asset2>
<AmountAsset1>-{{amount}}</AmountAsset1>
<AmountAsset2>0</AmountAsset2>
<CustodyAccountAsset1>00000000-0000-0000-0000-000000000000</CustodyAccountAsset1>
<CustodyAccountAsset2>00000000-0000-0000-0000-000000000000</CustodyAccountAsset2>
<TradeDate>{{tradeDate}}</TradeDate>
<SettlementDate>0001-01-01T00:00:00</SettlementDate>
<ValueDate>0001-01-01T00:00:00</ValueDate>
<Price>0</Price>
<AcquisitionValue>0</AcquisitionValue>
<AcquisitionValueAccountCurrency>0</AcquisitionValueAccountCurrency>
</BusinessTransaction>
<BusinessTransaction>
<BrickId>00000000-0000-0000-0000-000000000000</BrickId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<Account>{{accountToId}}</Account>
<BusinessTransactionType>{{transactionType}}</BusinessTransactionType>
<TransactionReference>{{reference}}</TransactionReference>
<Asset1>{{assetId}}</Asset1>
<Asset2>00000000-0000-0000-0000-000000000000</Asset2>
<AmountAsset1>{{amount}}</AmountAsset1>
<AmountAsset2>0</AmountAsset2>
<CustodyAccountAsset1>00000000-0000-0000-0000-000000000000</CustodyAccountAsset1>
<CustodyAccountAsset2>00000000-0000-0000-0000-000000000000</CustodyAccountAsset2>
<TradeDate>{{tradeDate}}</TradeDate>
<SettlementDate>0001-01-01T00:00:00</SettlementDate>
<ValueDate>0001-01-01T00:00:00</ValueDate>
<Price>0</Price>
<AcquisitionValue>0</AcquisitionValue>
<AcquisitionValueAccountCurrency>0</AcquisitionValueAccountCurrency>
</BusinessTransaction>
</BusinessTransactions>
<InsurancePolicy>00000000-0000-0000-0000-000000000000</InsurancePolicy>
<InsuranceClaim>00000000-0000-0000-0000-000000000000</InsuranceClaim>
<Batch>00000000-0000-0000-0000-000000000000</Batch>
<BusinessEventId>{{businessEventId}}</BusinessEventId>
<OrderId>{{orderId}}</OrderId>
<NoteId>{{noteId}}</NoteId>
</SuperTransaction>
</Entities>
</req>
</CreateBusinessTransactions>
</s:Body>
</s:Envelope>
### get business transactions affecting a specified account
@accountId = 48d42589-8b74-4804-b762-c7f609b8a3cd
POST https://bfs1.bricknode.com/tbccapitaldev/api/bfsapi.asmx HTTP/1.1
SOAPAction: "http://tempuri.org/GetBusinessTransactions"
Content-Type: text/xml; charset=utf-8
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetBusinessTransactions xmlns="http://tempuri.org/">
<req>
<Credentials>
<UserName>{{userName}}</UserName>
<Password>{{password}}</Password>
</Credentials>
<identify>{{identify}}</identify>
<Args>
<Accounts>
<guid>{{accountId}}</guid>
</Accounts>
</Args>
<Fields>
{{allBusinessTransactionFields}}
</Fields>
</req>
</GetBusinessTransactions>
</s:Body>
</s:Envelope>