Development Guides

Restricted Plans

Restricted Plans allow you to create a list of securities that are available to be purchased in an account. For example, you may use this for clients with a 401(k) that are unable to vary from a set of securities. A Restricted Plan limits the securities that are purchased in that account while allowing other accounts in the portfolio to purchase any security targeted in the model.

Get Restricted Plans List

This endpoint returns a list of active Restricted Plans in the database.

GET https://baseurl/v1/restrictedPlans

Sample Response

[
     {
          "id": 1,
          "name": "NorthStar Employee 401k Plan",
          "useInTradeFile": 1,
          "accountCount": 2,
          "createdBy": "Riley.Lambert",
          "editedBy": "Seth.Kong",
          "createdOn": "2018-02-06T04:39:30.000Z",
          "editedOn": "2023-10-17T18:43:34.000Z",
          "externalPlanId": "RP_401_EXTERNAL_01"
     },
     {
          "id": 2,
          "name": "RP",
          "useInTradeFile": 0,
          "accountCount": 1,
          "createdBy": "Riley.Lambert",
          "editedBy": "Riley.Lambert",
          "createdOn": "2018-02-21T22:03:18.000Z",
          "editedOn": "2018-02-21T22:03:18.000Z",
          "externalPlanId": "RP_401_EXTERNAL_02"
     },
     {
          "id": 3,
          "name": "Test Restricted Plans",
          "useInTradeFile": 1,
          "accountCount": 0,
          "createdBy": "Dibya.Shakya",
          "editedBy": "Dibya.Shakya",
          "createdOn": "2023-11-24T15:05:23.000Z",
          "editedOn": "2023-11-24T15:05:23.000Z",
          "externalPlanId": null
     }
]

Search Restricted Plans

GET https://baseurl/v1/restrictedPlans?search=<searchTerm>
propertydescriptionrequireddatatype
searchTermspecifies search term which is used to filter restricted plans whose name containing search term.YesString

Sample Request

GET https://baseurl/v1/restrictedPlans?search=employee

Sample Response

[
     {
          "id": 1,
          "name": "NorthStar Employee 401k Plan",
          "useInTradeFile": 1,
          "externalPlanId": "RP_401_EXTERNAL_01",
          "accountCount": 2,
          "createdBy": "Riley.Lambert",
          "editedBy": "Seth.Kong",
          "createdOn": "2018-02-06T04:39:30.000Z",
          "editedOn": "2023-10-17T18:43:34.000Z"
     }
]

Get Restricted Plan Details

Using Id

GET https://baseurl/v1/restrictedPlans?id=<id>
propertydescriptionrequireddatatype
idrestricted plan idYesInteger

Sample Request

GET https://baseurl/v1/restrictedPlans?id=5


Sample Response

{
     "id": 5,
     "name": "Test Restricted Plans",
     "useInTradeFile": 0,
     "externalPlanId": "RP_TEST_EXTERNAL_05",
     "securities": [
     {
          "securityId": 45902,
          "securityName": "TestMF15.4",
          "securitySymbol": "TestMF15.4",
          "type": "Mutual Fund",
          "doNotBuyGroupEquivalency": 0,
          "class": "Uncategorized",
          "category": "Equity",
          "subClass": "Security",
          "createdBy": "Dibya.Shakya",
          "editedBy": "Dibya.Shakya",
          "createdOn": "2023-11-28T20:47:34.000Z",
          "editedOn": "2023-11-28T20:49:07.000Z",
          "sellPriorityId": 4,
          "sellPriority": "Can Sell",
          "buyPriorityId": null,
          "buyPriority": null
     }
     ]
}

Using External Plan Id

GET https://baseurl/v1/restrictedPlans?externalPlanId=<externalPlanId>
propertydescriptionrequireddatatype
externalPlanIdExternal Plan IdYesString

Sample Request

GET https://baseurl/v1/restrictedPlans?externalPlanId=RP_TEST_EXTERNAL_05

Sample Response

{
     "id": 5,
     "name": "Test Restricted Plans",
     "useInTradeFile": 0,
     "externalPlanId": "RP_TEST_EXTERNAL_05",
     "securities": [
     {
          "securityId": 45902,
          "securityName": "TestMF15.4",
          "securitySymbol": "TestMF15.4",
          "type": "Mutual Fund",
          "doNotBuyGroupEquivalency": 0,
          "class": "Uncategorized",
          "category": "Equity",
          "subClass": "Security",
          "createdBy": "Dibya.Shakya",
          "editedBy": "Dibya.Shakya",
          "createdOn": "2023-11-28T20:47:34.000Z",
          "editedOn": "2023-11-28T20:49:07.000Z",
          "sellPriorityId": 4,
          "sellPriority": "Can Sell",
          "buyPriorityId": null,
          "buyPriority": null
     }
     ]
}

Delete Restricted Plan

DELETE https://baseurl/v1/restrictedPlans?id=<id>
propertydescriptionrequireddatatype
idRestricted Plan IdYesInteger

Sample Request

DELETE https://baseurl/v1/restrictedPlans?id=3

Sample Response

{
     "id": "3",
     "message": "Restricted plan deleted successfully"
}

Add Restricted Plan

POST https://baseurl/v1/restrictedPlans

BODY

propertydescriptionrequireddatatype
namename of restricted planYesString
useInTradeFileIf set to true the trade file goes to a restricted plan file, rather than the custodian trade fileNoBoolean
securitieslist of securitiesYesObject
securityIdsecurity idYesInteger
doNotBuyGroupEquivalencyIf set to true this makes sure the security doesn’t get purchased in a non-restricted plan accountNoBoolean
buyPriorityIdBuy Priority IdNoInteger
buyPriorityBuy Priority Description
If you are setting a Buy Priority, both the buyPriorityId and buyPriority are required
NoString
sellPriorityIdSell Priority IdNoInteger
sellPrioritySell Priority Description
If you are setting a Sell Priority, both the sellPriorityId and sellPriority are required
NoString
externalPlanIdExternal Plan IdNoString

Sample Request

{
     "securities": {
          "securities": [
          {
               "securityId": 37818,
               "securityName": "TestEQ13.5",
               "securitySymbol": "TestEQ13.5",
               "buyPriority": null,
               "sellPriority": null,
               "doNotBuyGroupEquivalency": true,
               "buyPriorityId": 0,
               "sellPriorityId": 0
          },
          {
               "securityId": 45902,
               "securityName": "TestMF15.4",
               "securitySymbol": "TestMF15.4",
               "buyPriority": null,
               "sellPriority": null,
               "doNotBuyGroupEquivalency": true,
               "buyPriorityId": 0,
               "sellPriorityId": 0
          }
          ]
     },
     "name": "Test Restricted Plans",
     "externalPlanId": "Test_RP_001",
     "useInTradeFile": true,
     "id": null
}

Sample Response

{
     "id": 5,
     "name": "Test Restricted Plans",
     "useInTradeFile": 0,     
     "securities": [
          {
               "securityId": 45902,
               "securityName": "TestMF15.4",
               "securitySymbol": "TestMF15.4",
               "type": "Mutual Fund",
               "class": "Security",
               "category": "Equity",
               "buyPriority": 0,
               "sellPriority": 0,
               "createdBy": "Dibya.Shakya",
               "editedBy": "Dibya.Shakya",
               "createdOn": "2023-11-28T17:35:38.000Z",
               "editedOn": "2023-11-28T17:35:38.000Z",
               "doNotBuyGroupEquivalency": 1
          },
          {
               "securityId": 37818,
               "securityName": "TestEQ13.5",
               "securitySymbol": "TestEQ13.5",
               "type": "Equity",
               "class": "Security",
               "category": "Equity",
               "buyPriority": 0,
               "sellPriority": 0,
               "createdBy": "Dibya.Shakya",
               "editedBy": "Dibya.Shakya",
               "createdOn": "2023-11-28T17:35:38.000Z",
               "editedOn": "2023-11-28T17:35:38.000Z",
               "doNotBuyGroupEquivalency": 1
          }
     ]
}

Edit Restricted Plan

PUT https://baseurl/v1/restrictedPlans?id=<id>

BODY

propertydescriptionrequireddatatype
idRestricted Plan IdYesInteger
externalPlanIdExternal Plan IdNoString
namename of restricted planYesString
useInTradeFileIf set to true the trade file goes to a restricted plan file, rather than the custodian trade fileNoBoolean
securitieslist of securitiesYesObject
deletedSecuritieslist of security ids. It can be empty list.YesList
securityIdsecurity idYesInteger
doNotBuyGroupEquivalencyIf set to true this makes sure the security doesn’t get purchased in a non-restricted plan accountNoBoolean
buyPriorityIdBuy Priority IdNoInteger
buyPriorityBuy Priority Description
If you are setting a Buy Priority, both the buyPriorityId and buyPriority are required
NoString
sellPriorityIdSell Priority IdNoInteger
sellPriority

Sell Priority Description
If you are setting a Sell Priority, both the sellPriorityId and sellPriority are required
NoString

Sample Request

PUT https://baseurl/v1/restrictedPlans?id=5
{
     "id": 5,
     "name": "Test Restricted Plans",
     "externalPlanId": "Test_RP_005",
     "useInTradeFile": 1,
     "securities": {
          "securities": [
               {
                    "securityId": 45902,
                    "securityName": "TestMF15.4",
                    "securitySymbol": "TestMF15.4",
                    "doNotBuyGroupEquivalency": true,
                    "sellPriorityId": 0,
                    "sellPriority": null,
                    "buyPriorityId": 0,
                    "buyPriority": null
               }
          ],
          "deletedSecurities": [
               37818
          ]
     }
}

Sample Response

{
     "id": 5,
     "name": "Test Restricted Plans",
     "externalPlanId": "Test_RP_005",
     "useInTradeFile": 1,
     "securities": [
          {
               "securityId": 45902,
               "securityName": "TestMF15.4",
               "securitySymbol": "TestMF15.4",
               "type": "Mutual Fund",
               "doNotBuyGroupEquivalency": 1,
               "class": "Uncategorized",
               "category": "Equity",
               "subClass": "Security",
               "createdBy": "Dibya.Shakya",
               "editedBy": "Dibya.Shakya",
               "createdOn": "2023-11-28T20:47:34.000Z",
               "editedOn": "2023-12-01T20:31:19.000Z",
               "sellPriorityId": null,
               "sellPriority": null,
               "buyPriorityId": null,
               "buyPriority": null
          }    
     ]
}

Sell Priority Possible Values

GET https://baseurl/v1/security/securityset/sellpriority
Sell Priority IdSell Priority Description
1Do Not Sell
2Hard To Sell
3Sell If No Gain
4Can Sell
5Sell To Target
6Priority Sell

Buy Priority Possible Values

GET https://baseurl/v1/security/securityset/buypriority
Buy Priority IdBuy Priority Description
1Do Not Buy
2Hard To Buy
3Can Buy
4Buy To Target
5Priority Buy
6Preferred if held