Trading Groups


GET tradinggroups

Description

Get the details for all trading groups owned by the requester's organization.

Resource URL

https://api.optionscity.com/tradinggroups
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
page 1-indexed page to retrieve. Default is 1. No Number
per_page Number of entries returned per page. Default is 20. No Number
query Partial or full trading group names to filter on, to limit results accordingly. No String

Example Request

GET https://api.optionscity.com/tradinggroups

Example Response

[ {
  "id" : 1234,
  "name" : "My Trading Group",
  "org_id" : 1,
  "org_name" : "My Organization",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "myhost.com",
  "gmi_ftp_port" : 2221,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
}, {
  "id" : 1235,
  "name" : "Other Trading Group",
  "org_id" : 2,
  "org_name" : "Other Organization",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "otherhost.com",
  "gmi_ftp_port" : 2223,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
} ]

GET tradinggroups/:id

Description

Get the details for the specified trading group.

Resource URL

https://api.optionscity.com/tradinggroups/:id
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The unique City API identifier for the trading group. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/94857

Example Response

{
  "id" : 1234,
  "name" : "My Trading Group",
  "org_id" : 1,
  "org_name" : "My Organization",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "myhost.com",
  "gmi_ftp_port" : 2221,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
}

POST tradinggroups

Description

Create a new trading group.

Resource URL

https://api.optionscity.com/tradinggroups
Authentication Required
HTTP Methods POST
Media Types application/json
Response Object Tradinggroups
Response Type Standard
Request Object Tradinggroups

Example Request

POST https://api.optionscity.com/tradinggroups
{
  "name" : "My Trading Group",
  "org_id" : 1,
  "org_name" : "My Trading Group",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "myhost.com",
  "gmi_ftp_port" : 2221,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
}

Example Response

{
  "id" : 1234,
  "name" : "My Trading Group",
  "org_id" : 1,
  "org_name" : "My Organization",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "myhost.com",
  "gmi_ftp_port" : 2221,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
}

PUT tradinggroups/:id

Description

Modify an existing trading group.

Resource URL

https://api.optionscity.com/tradinggroups/:id
Authentication Required
HTTP Methods PUT
Media Types application/json
Response Object Tradinggroups
Response Type Standard
Request Object Tradinggroups

Parameters

NameDescriptionRequired?Type
id The trading group ID to modify. Yes Number

Example Request

PUT https://api.optionscity.com/tradinggroups/1
{
  "name" : "My Trading Group",
  "org_id" : 1,
  "org_name" : "My Trading Group",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "myhost.com",
  "gmi_ftp_port" : 2221,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
}

DELETE tradinggroups/:id

Description

Delete an existing trading group.

Resource URL

https://api.optionscity.com/tradinggroups/:id
Authentication Required
HTTP Methods DELETE
Media Types --
Response Object None
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The trading group ID to delete. Yes Number

Example Request

DELETE https://api.optionscity.com/tradinggroups/1

GET linkabletradinggroups

Description

Get the ids and names of all the trading groups the requester has access to, including ones owned by other orgs that the requester's org is linked to.

Resource URL

https://api.optionscity.com/linkabletradinggroups
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object See example
Response Type Standard

Parameters

NameDescriptionRequired?Type
page 1-indexed page to retrieve. Default is 1. No Number
per_page Number of entries returned per page. Default is 20. No Number
query Partial or full trading group names to filter on, to limit results accordingly. No String

Example Request

GET https://api.optionscity.com/linkabletradinggroups

Example Response

{
  "id" : 49,
  "name" : "Trader McTraderson"
}

GET Account GMI Columns

Description

Get currently configured GMI account column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/account
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/1/gmicolumns/account

Example Response

{
  "ysname" : 0,
  "yoffic" : 1,
  "yacct" : 2
}

PUT Account GMI Columns

Description

Modify currently configured GMI account column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/account
Authentication Required
HTTP Methods PUT
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

PUT https://api.optionscity.com/tradinggroups/1/gmicolumns/account

GET Transaction GMI Columns

Description

Get currently configured GMI position column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/transaction
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/1/gmicolumns/transaction

Example Response

{
  "pacct" : 0,
  "pbs" : 1,
  "pcard" : 2,
  "pctym" : 3,
  "expy" : 4,
  "pexch" : 5,
  "pexpdt" : 6,
  "pfc" : 7,
  "poffic" : 8,
  "pqty" : 9,
  "precid" : 10,
  "psdsc1" : 11,
  "pstrik" : 12,
  "psubty" : 13,
  "ptdate" : 14,
  "ptpric" : 15,
  "pcomm" : 16,
  "pfee2" : 17
}

PUT Transaction GMI Columns

Description

Modify currently configured GMI transaction column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/transaction
Authentication Required
HTTP Methods PUT
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

PUT https://api.optionscity.com/tradinggroups/1/gmicolumns/transaction

GET Position GMI Columns

Description

Get currently configured GMI account column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/position
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/1/gmicolumns/position

Example Response

{
  "pacct" : 0,
  "pbs" : 1,
  "pctym" : 2,
  "pexch" : 3,
  "pexpdt" : 4,
  "pfc" : 5,
  "poffic" : 6,
  "pqty" : 7,
  "psdsc1" : 8,
  "pstrik" : 9,
  "psubty" : 10,
  "ptpric" : 11
}

PUT Position GMI Columns

Description

Modify currently configured GMI position column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/position
Authentication Required
HTTP Methods PUT
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

PUT https://api.optionscity.com/tradinggroups/1/gmicolumns/position

GET Money GMI Columns

Description

Get currently configured GMI position column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/money
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/1/gmicolumns/money

Example Response

{
  "macct" : 0,
  "matype" : 1,
  "mbal" : 2,
  "meir" : 3,
  "memr" : 4,
  "mfir" : 5,
  "mlqval" : 6,
  "mlvust" : 16,
  "mme" : 7,
  "mmtdc" : 8,
  "moffic" : 9,
  "mote" : 10,
  "mprem" : 11,
  "mtar" : 12,
  "mte" : 13,
  "munupl" : 14,
  "mwf" : 15
}

PUT Money GMI Columns

Description

Modify currently configured GMI money column order.

Resource URL

https://api.optionscity.com/tradinggroups/:id/gmicolumns/money
Authentication Required
HTTP Methods PUT
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

PUT https://api.optionscity.com/tradinggroups/1/gmicolumns/money

GET Force GMI synchronize

Description

Force a gmi sync.

Resource URL

https://api.optionscity.com/tradinggroups/:id/synchronize
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Tradinggroups
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The unique City API identifier for the trading group. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/94857/synchronize

GET Organization Access

Description

Get trading group organizational access.

Resource URL

https://api.optionscity.com/tradinggroups/:id/orgaccess
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Organization
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

GET https://api.optionscity.com/tradinggroups/1/orgaccess

Example Response

[ {
  "id" : 12345,
  "unique_name" : "abcfutures",
  "name" : "ABC Futures",
  "is_vor" : false,
  "customer_redirect_url" : "http://optionshop.com"
} ]

POST Organization Access

Description

POST trading group organizational access.

Resource URL

https://api.optionscity.com/tradinggroups/:id/orgaccess
Authentication Required
HTTP Methods POST
Media Types application/json
Response Object Organization
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group ID. Yes Number

Example Request

POST https://api.optionscity.com/tradinggroups/1/orgaccess
{
  "org_id" : 1
}

Example Response

{
  "id" : 12345,
  "unique_name" : "abcfutures",
  "name" : "ABC Futures",
  "is_vor" : false,
  "customer_redirect_url" : "http://optionshop.com"
}

DELETE Oranization Access

Description

Remove trading group access to an organizaton.

Resource URL

https://api.optionscity.com/tradinggroups/:id/orgaccess/:orgId
Authentication Required
HTTP Methods DELETE
Media Types --
Response Object None
Response Type Standard

Parameters

NameDescriptionRequired?Type
id The owning trading group id. Yes Number
orgId The organization id for a given trading group. Yes Number

Example Request

DELETE https://api.optionscity.com/tradinggroups/1/orgaccess/123

Trading Group Object

Description

Basic information for a trading group.

Fields

Field Type Optional Description
id Number No The City API ID for the trading group.
name String No The name given to the trading group.
org_id String No The City API organization ID this trading group belongs to.
gmi_ftp_host String Yes URL to gmi ftp host.
gmi_ftp_post Number Yes URL to gmi ftp host.
gmi_transactions_file_prefix String Yes Matches start of gmi transactions file name.
gmi_positions_file_prefix String Yes Matches start of gmi positions file name.
gmi_balances_file_prefix String Yes Matches start of gmi balances file name.
gmi_customers_file_prefix String Yes Matches start of gmi customers file name.
gmi_ftp_password String Yes Password for gmi ftp site.
gmi_currency_type String Yes Currency of gmi file.
gmi_ftp_path String Yes Path to gmi file.
gmi_ftp_username String Yes Username for gmi ftp site.
skip_first_gmi_line Boolean No Skip first line if column headers are included
override_gmi_col_positions Boolean No Whether to override gmi col positions
linked_orgs_can_manage_risk Boolean No Whether linked orgs can manage risk
allow_kill_all_accounts Boolean No Whether to allow admin to kill trading for all accounts

JSON Sample

{
  "id" : 1234,
  "name" : "My Trading Group",
  "org_id" : 1,
  "org_name" : "My Organization",
  "skip_first_gmi_line" : false,
  "override_gmi_col_positions" : false,
  "gmi_ftp_host" : "myhost.com",
  "gmi_ftp_port" : 2221,
  "gmi_transactions_file_prefix" : "GMI_TRANS_",
  "gmi_positions_file_prefix" : "GMI_POS_",
  "gmi_balances_file_prefix" : "GMI_MONEY_",
  "gmi_customers_file_prefix" : "GMI_CUST_",
  "gmi_ftp_path" : "./path/to/gmi",
  "gmi_ftp_username" : "MYUSER",
  "gmi_ftp_password" : "MYPASS",
  "gmi_currency_type" : "USD",
  "linked_orgs_can_manage_risk" : false,
  "allow_kill_all_accounts" : false
}

Account GMI Columns Object

Description

Account GMI columns.

Fields

Field Type Optional Description
ysname Number Yes ysname
yoffic Number Yes yoffic
yacct Number Yes yacct

JSON Sample

{
  "ysname" : 0,
  "yoffic" : 1,
  "yacct" : 2
}

Transaction GMI Columns Object

Description

Transaction GMI columns.

Fields

Field Type Optional Description
pacct Number Yes pacct
pbs Number Yes pbs
pcard Number Yes pcard
pctym Number Yes pctym
pexch Number Yes pexch
pexpdt Number Yes pexpdt
pfc Number Yes pfc
poffic Number Yes poffic
pqty Number Yes pqty
precid Number Yes precid
psdsc1 Number Yes psdsc1
psubty Number Yes psubty
ptdate Number Yes ptdate
ptpric Number Yes ptpric
pcomm Number Yes pcomm
pfee2 Number Yes pfee2

JSON Sample

{
  "pacct" : 0,
  "pbs" : 1,
  "pcard" : 2,
  "pctym" : 3,
  "expy" : 4,
  "pexch" : 5,
  "pexpdt" : 6,
  "pfc" : 7,
  "poffic" : 8,
  "pqty" : 9,
  "precid" : 10,
  "psdsc1" : 11,
  "pstrik" : 12,
  "psubty" : 13,
  "ptdate" : 14,
  "ptpric" : 15,
  "pcomm" : 16,
  "pfee2" : 17
}

Money GMI Columns Object

Description

Money GMI columns.

Fields

Field Type Optional Description
macct Number Yes macct
matype Number Yes matype
mbal Number Yes mbal
meir Number Yes meir
memr Number Yes memr
mfir Number Yes mfir
mlqval Number Yes mlqval
mme Number Yes mme
mmtdc Number Yes mmtdc
moffic Number Yes moffic
mote Number Yes mote
mprem Number Yes mprem
mtar Number Yes mtar
mte Number Yes mte
munupl Number Yes munupl
mwf Number Yes mwf

JSON Sample

{
  "macct" : 0,
  "matype" : 1,
  "mbal" : 2,
  "meir" : 3,
  "memr" : 4,
  "mfir" : 5,
  "mlqval" : 6,
  "mlvust" : 16,
  "mme" : 7,
  "mmtdc" : 8,
  "moffic" : 9,
  "mote" : 10,
  "mprem" : 11,
  "mtar" : 12,
  "mte" : 13,
  "munupl" : 14,
  "mwf" : 15
}

Position GMI Columns Object

Description

Position GMI columns.

Fields

Field Type Optional Description
pacct Number Yes pacct
pbs Number Yes pbs
pctym Number Yes pctym
pexch Number Yes pexch
pexpdt Number Yes pexpdt
pfc Number Yes pfc
poffic Number Yes poffic
pqty Number Yes pqty
psdsc1 Number Yes psdsc1
pstrik Number Yes pstrik
psubty Number Yes psubty
ptpric Number Yes ptpric

JSON Sample

{
  "pacct" : 0,
  "pbs" : 1,
  "pctym" : 2,
  "pexch" : 3,
  "pexpdt" : 4,
  "pfc" : 5,
  "poffic" : 6,
  "pqty" : 7,
  "psdsc1" : 8,
  "pstrik" : 9,
  "psubty" : 10,
  "ptpric" : 11
}

* Date and time elements are ISO-8601 string representations