Pre Trade Compliance

View as MarkdownOpen in Claude

The /api/v1/restrictions can be used to apply trade-related rules and restrictions to an account or user, or to an entire account family, including all client/sub-accounts. Updates to PTC restrictions, rules, and associations can be sent to IBKR using RESTful Web API.

  • /api/v1/restrictions: Service is used to apply restrictions and manage rules or associations for Pre-Trade Compliance using the API.

  • /api/v1/restrictions/verify: Service is used to validate that the contents included in the CSV file is in good order.

Restrictions will be sent in CSV Format and will be sent in same format that is used to upload CSV files within the IBKR Hosted Platform.

Request Parameters

NameValueDescription
userName requiredStringIBKR user ID of the individual intiating the request.The user ID must have access rights to ‘Pre Trade Compliance’.
requestId requiredNon-negative integer value.Unique identifier associated with the request. requestId will need to be unique for each requestId . If requestId was previously processed, error will be thrown.
payload requiredStringCSV file encoded in base64.
JSON Request const body = { "userName": pm.environment.get('userName'), "requestId": Date.now(), "payload": "UkVTVFJfQURELCBBUElBVVRILTcyOCwgUlVMRV9CRUdJTiwgcnVsZV90eXBlPUNMT1NJTkdPTkxZLCB0aWY9R1RDLCBSVUxFX0VORA==" } pm.collectionVariables.set('signedRequest', utils.signRequest(body));

Response Parameters

NameValueDescription
successBooleanIndicate whether the content of the file is valid or not. true: Indicates the file is valid. false: Indicates the file is not valid and cannot be processed.
requestIdNon-Negative integer valuereqId that was processed.
messageStringIf success=false, the message will have some information about the error.

JSON Response

{ "success": "<true|false>", "requestId":"<String>", "message":"<string>" } }

Sample

Success {"success":true,"requestId":20211635375984312,"message":"OK"}