Quickstart

This guide will help you get started with the Cumulus9 API. We’ll cover how to authenticate using an API Key, submit a portfolio for margin calculations, and retrieve the results.

Make your first API request

Use your API Key as a Bearer token to submit a portfolio for margin calculations.

POST
/portfolios
# example of portfolio payload
portfolio_payload='
{
    "vendor_symbology": "clearing",
    "calculation_type": "margins",
    "execution_mode": "sync",
    "portfolio": [
        {
            "account_code": "Account 001",
            "exchange_code": "ASX",
            "contract_code": "XT",
            "contract_type": "F",
            "contract_expiry": "DEC-25",
            "contract_strike": "",
            "net_position": "500"
        },
        {
            "account_code": "Account 001",
            "exchange_code": "ICE.EU",
            "contract_code": "B",
            "contract_type": "Future",
            "contract_expiry": "DEC-25",
            "contract_strike": "",
            "net_position": "500"
        },
        {
            "account_code": "Account 001",
            "exchange_code": "NYMEX",
            "contract_code": "LO",
            "contract_type": "CALL",
            "contract_expiry": "202512",
            "contract_strike": "50.1",
            "net_position": "-1000"
        },
        {
            "account_code": "Account 002",
            "exchange_code": "EUREX",
            "contract_code": "FDAX",
            "contract_type": "FUT",
            "contract_expiry": "202612",
            "contract_strike": "",
            "net_position": "-50"
        }
    ]
}'

# post portfolio
headers=("Content-Type: application/json" "Authorization: Bearer $c9_api_secret")
response=$(curl -s -X POST "$c9_api_endpoint/portfolios" -H "${headers[1]}" -H "${headers[2]}" -d "$portfolio_payload" | jq)

echo $response

What's next?

Great, you have now made your first request to the API. Here are a few links that might be handy for more details:

Was this page helpful?