Margin Service API - Transaction - Add

Description

This request allows the Client to add or create a new transaction in CME CORE. The Client must submit the required attributes (specified below) for a new transaction, then the server validates the request. If the request is invalid, the server returns a status and an error message/code and if the request is valid, an internal identifier for the request along with the status are returned.   

Multiple transactions can be added within one message. If processingMode="COMPLETE" then all transactions must pass validation, or none will be added. If processingMode="PARTIAL" then transactions that are invalid will not be added, but any valid transactions will be unaffected. Should this happen, the response will have have /transactionRpt@status="SUCCESS_WITH_ERRORS" and /transactionRpt/transaction/error@code and /transactionRpt/transaction/error@msg present for each transaction that failed.

Request

XPath

Name

Type

Required

Notes

XPath

Name

Type

Required

Notes

/transactionReq@reqUserId

Requesting User ID

String 

No



/transactionReq@processingMode

Processing Mode

Processing Mode

No



/transactionReq/transaction@portfolioId

Portfolio ID

String 

Yes



/transactionReq/transaction@type

Transaction Type

Transaction Type

Yes



/transactionReq/transaction/payload@encoding

Payload Encoding

Transaction Encoding

Yes



/transactionReq/transaction/payload@format

Payload Format

Transaction Format

Yes



/transactionReq/transaction/payload/string

String Payload

String 

Yes



Response

XPath

Name

Type

Required

Notes

XPath

Name

Type

Required

Notes

/transactionRpt@status

Status

Sync Report Status

Yes



/transactionRpt/error@code

Error Code

String 

No



/transactionRpt/error@msg

Error Message

String 

No



/transactionRpt/transaction@createTime

Create Time

Date/Time

Yes



/transactionRpt/transaction@id

ID

String 

Yes



/transactionRpt/transaction@portfolioId

Portfolio ID

String 

Yes



/transactionRpt/transaction@status

Entity Status

Entity Status

Yes



/transactionRpt/transaction@type

Transaction Type

Transaction Type 

Yes



/transactionRpt/transaction@updateTime

Update Time

Date/Time 

Yes



/transactionRpt/transaction/error@code

Error Code

String

No



/transactionRpt/transaction/error@msg

Error Message

String

No



/transactionRpt/transaction/payload@encoding

Payload Encoding

Transaction Encoding

Yes



/transactionRpt/transaction/payload@format

Payload Format

Transaction Format

Yes



/transactionRpt/transaction/payload/string

String Payload

String 

Yes



Errors

HTTP Status Codes

Code

Description

Code

Description

500

The server was not able to process the request. More information (if available) will be provided in the error message.

Using Your Own Id to Identify Invalid Trades

If you supply your own id (Client ID) for each trade, the Margin Services API returns the invalid trades and corresponding reason.

Examples:

Format

Example Requests and Responses

Format

Example Requests and Responses

Invalid all in one request



<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:marginReq xmlns:ns2="http://cmegroup.com/schema/core/1.2"> <margin> <transactions> <transaction type="TRADE"> <payload format="CSV" encoding="STRING"> <string> Firm ID,Account ID,Client ID,Product Type ,Currency,Effective Date,Maturity Date,Notional,Direction,Fixed Rate,Leg1 Index,Leg1 IndexTenor,Leg1 Payfreq,Leg1 CompMethod,Leg2 Index,Leg2 IndexTenor,Leg2 Payfreq,Leg2 CompMethod,Leg1 Spread,Leg2 Spread Test,1234,Test Trade 1,Vanilla,USD,9/6/2011,9/6/2021,"10,000,000",P,0.03123,N/A,N/A,3M,NONE,USD-LIBOR,3M,6M,FLAT,N/A,N/A Test,1234,Test Trade 2,ZERO_COUPON,USD,9/6/2011,9/6/2021,"10,000,000",P,20,N/A,N/A,6M,NONE,USD-LIBOR-BBA,3M,3M,NONE,N/A,N/A Test,1234,Test Trade 3,Vanilla,USD,9/6/2011,9/6/2021,"10,000,000",P,0.03123,N/A,N/A,3M,NONE,USD-LIBOR-BBA,3M,6M,FLAT,N/A,N/A </string> </payload> </transaction> </transactions> </margin> </ns2:marginReq>



Invalid all in one response



<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:marginRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="ERROR"> <error msg="null: Client Id: Test Trade 1 : leg2index='USD-LIBOR' is not an allowed value.,null: Client Id: Test Trade 2 : leg1fixedRate=Fixed rate must be less than 1." code="400"/> </ns2:marginRpt>



Invalid CSV Request



<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:transactionReq xmlns:ns2="http://cmegroup.com/schema/core/1.2" reqUserId="userid"> <transaction portfolioId="${marginPortfolio}" type="TRADE"> <payload encoding="STRING" format="CSV"> <string> Firm ID,Account ID,ClearedTradeId,Product Type ,Currency,Effective Date,Maturity Date,Notional,Direction,Fixed Rate,Leg1 Index, Leg1 IndexTenor,Leg1 Payfreq,Leg1 CompMethod,Leg2 Index,Leg2 IndexTenor,Leg2 Payfreq,Leg2 CompMethod,Leg1 Spread,Leg2 Spread Test,1234,Test Trade 1,Vanilla,USD,9/6/2011,9/6/2021,"10,000,000",P,0.03123,N/A,N/A,6M,NONE,USD-LIBOR-BBA,3M,6M,FLAT,N/A,N/A Test,1234,Test Trade 2,OIS,USD,9/6/2011,9/6/2021,"10,000,000",P,0.03123,N/A,N/A,1T,NONE,USD-Federal-H.15-OIS-COMPOUND,N/A,1T,NONE,N/A,N/A Test,1234,Test Trade 3,ZERO_COUPON,USD,9/6/2011,9/6/2021,"10,000,000",P,0.03123,N/A,N/A,6M,NONE,USD-LIBOR-BBA,3M,3M,NONE,N/A,N/A </string> </payload> </transaction> </ns2:transactionReq>



Invalid CSV Response





Invalid FPML Request





Invalid FPML Response







Examples

Basic
Request



Response



Multiple Transactions in FpML Format
Request



Response
Add Bulk Transactions Request
Add Bulk Transactions Response
Examples by Product in FpML and FIXML Formats
Basis Swap
FRA Request
FRA Response
OIS (Overnight Index Swap)
Vanilla IRS



Vanilla VNS (Variable Notional Swap)



Zero Coupon
Zero Coupon for BRL
Vanilla Swaptions FPML Request Schema 1.3
Vanilla Swaptions FPML Response Schema 1.3
Examples by Product in FixML Format
Futures Request
Futures Response



FX (Forex)



FX Cleared Confirm



FX Options FIXML



FX Options Cleared Confirm
Examples by Product in csv Format
Vanilla IRS (Interest Rate Swap) Request
Vanilla IRS ( Interest Rate Swap) Response



Vanilla VNS (Variable Notional Swap) Request
Vanilla VNS (Variable Notional Swap) Response
ZCS with BRL Request
ZCS with BRL Response
Vanilla Swaptions CSV Example Request
Vanilla Swaptions Example Response



Delta Ladder Request
Delta Ladder Response
FX (Forex) Request



FX (Forex) Response



FX Option CSV Request



FX Options TR Request
Futures & Options CSV Requests

Example 1: Simple CSV Portfolio CSV

CORE API minimally requires the below attributes to build futures and options transactions. Note CORE will auto-fill attributes when able - for instance if a user supplies a valid Globex Ticket Symbol (Ticker Symbol attribute), other product attributes can be left blank. It is expected users leave the Product Name attribute blank.

Example 2: Risk API CSV Portfolio

Risk API CSV or JSON format (see also below) are the expected SPAN 2 input payload formats. These formats are supported for futures and options only and are also compatible with the deployable margin software program. 

Additional details around building a Risk API format payload can be found here.

Please note CORE API seperates transactions into multiple portfolios when the Account ID or Firm ID do not match.

Examples by Product in JSON Format

Risk API JSON or CSV format are the expected SPAN 2 input payload formats. These formats are supported for futures and options only and are also compatible with the deployable margin software program. 

Additional details around building a Risk API format payload can be found here.

Please note CORE API seperates transactions into multiple portfolios when the Account ID or Firm ID do not match.

Futures and Options Request
Futures and Options Response

Please note the response format for CORE API is FIXML regardles of inbound transaction type. CORE API assigns transaction and porfolio IDs to the newly created portfolio. The portfolio ID must be supplied in subsequent Margin actions.

Examples Adding Multiple Rates Products in One Request

These examples show the REQUEST to ADD TRANSACTIONS to an existing portfolio.  The RESPONSE is the subsequent MARGIN RESPONSE when you send a MARGIN GET.  The flow of the calls would be:

Delta Ladder and Futures Request
Delta Ladder and Futures Response
Delta Ladder and IRS Request

 

Delta Ladder and IRS Response
IRS and Futures Request



IRS and Futures Response
Delta Ladder, IRS and Futures Request



Delta Ladder, IRS and Futures Response



 






How was your Client Systems Wiki Experience? Submit Feedback

Copyright © 2024 CME Group Inc. All rights reserved.