NAV Navbar
shell
  • Introduction
  • API Response Format
  • Pagination
  • Authentication
  • Quick Start
  • Instrument
  • Client
  • Account
  • Payment
  • Order
  • Cash
  • Portfolio
  • Errors
  • Message
  • Introduction

    API endpoint

    https://pfolio-api-staging.seccl.tech
    

    Welcome to the Seccl API! You can use our REST API to access the Digital Custody service. This will allow client and account management, creating payments and orders, viewing portfolio details and listing available instruments.

    API Response Format

    API response

    {
      "data": "{} or []",
      "meta": {
        "count": 1000,
        "page": 1,
        "pageSize": 50
      },
      "error": {
        "errorMessage": "Error message",
        "type": "Error type",
        "fieldErrors": [
          {
            "fieldName": "Field name in error",
            "type": "fieldErrorType",
            "errorMessage": "Field error message"
          }
        ]
      }
    }
    

    Our API will return data in a specific format.

    An API response will return an object with data and error properties.

    A search response will return a slightly different object: data will be an array.
    There will also be an additional meta field. This will be useful for pagination etc.

    Response Data

    This returns the following data

    Field Description
    data Returned data - will be an object or array (search only)
    meta Meta information including pagination for API search requests only
    error An error object as described in the errors section

    Meta information

    Field Description
    page The current page of results returned
    pageSize The size of the dataset in a single page
    count The total number of items in the current search

    Pagination

    Search requests are any requests which return an array of data. They are paginated by default.

    These are the pagination options.

    HTTP Request example

    GET https://pfolio-api-staging.seccl.tech/account/<firmId>?page=1&pageSize=50

    Query Description
    page The current page of results to return
    pageSize The size of the dataset to return in a single page

    Authentication

    Acquire an access token

    This allows the user to login to the service and obtain an API token. The token returned must be used on all subsequent calls to the API in the api-token header field.

    To authorize, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/authenticate \
      -H "Content-Type: application/json" \
      -d '{
            "firmId": "<FIRM Id provided>",
            "id": "<User id provided>",
            "password": "<Passcode provided>"
          }'
    

    This command returns JSON structured as follows:

    {
        "data": {
            "token": "exampletoken",
            "userName": "User Name"
        }
    }
    

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/authenticate

    Body Data

    All fields listed below are required.

    Field Data Type Description
    firmId String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id String The user Id we have created for you
    password String The password we have created for you

    Response Data

    This returns the following data

    Field Description
    token The authenticated token to be used in the header of all subsequent requests
    userName Your username

    Quick Start

    If you're in a hurry, use this code:

    Step 1

    curl -X POST https://pfolio-api-staging.seccl.tech/client \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "firmId": "FIRM1",
            "nodeId": ["0"],
            "clientType": "Individual",
            "title": "Miss",
            "firstName": "Selene",
            "surname": "Love",
            "gender": "Female",
            "currency": "GBP",
            "addressDetail": {
                "address1": "160 Manchester Road",
                "address2": "Doncaster",
                "country": "GB",
                "postCode": "DN11 6RJ"
            },
            "nationality": "GB",
            "language": "en",
            "email": "Selene.Love107@email.com",
            "mobile": {
              "number": "07777000000",
              "locale": "en-GB",
              "isMobile": true
            }
            "currency": "GBP",
            "nationalInsuranceNo": "XB952013A",
            "dateOfBirth": "1972-10-01T23:00:00.000Z",
            "taxDomicile": "GB",
            "amlStatus": "Approved",
            "termsAccepted": true
          }'
    

    Step 2

    curl -X POST https://pfolio-api-staging.seccl.tech/account \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "firmId": "FIRM1",
            "nodeId": "0",
            "accountType": "Wrapper",
            "name": "My trading account",
            "status": "Active",
            "currency": "GBP",
            "clientId": "<client Id returned above>",
            "wrapperDetail": {
              "wrapperType": "GIA"
            }
          }'
    

    Step 3

    curl -X POST https://pfolio-api-staging.seccl.tech/portfoliotransactiongroup \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "firmId": "FIRM1",
            "accountId": "<account Id returned above>",
            "transactions": [{
              "firmId": "FIRM1",
              "accountId": "<account Id returned above>",
              "transactionType": "Payment",
              "transactionSubType": "Deposit",
              "movementType": "In",
              "currency": "GBP",
              "amount": 1000,
              "method": "Bank Transfer"
            },{
              "firmId": "FIRM1",
              "accountId": "<account Id returned above>",
              "transactionType": "Order",
              "transactionSubType": "At Best",
              "movementType": "Invest",
              "currency": "GBP",
              "amount": 1000,
              "assetId": "286Q5"
            }]
          }'
    

    Step 4

    curl -X GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?accountId=<accountId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    Step 5

    curl -X GET https://pfolio-api-staging.seccl.tech/portfolioaccount/<firmId>/<accountId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    Ok. So you want to crack on with things straight away? That's no problem. Once you've authenticated, follow the quick start examples.

    There are just four steps to it.

    Step 1 - Create a client

    The example shows the minimum information required to do this. Make sure you store the client Id returned in the response data. Full details of how to create a client can be found here.

    Step 2 - Create an account

    Now create an account for the client you've just created. The example is the minimum required, but you must make sure the clientId field is populated with the Id returned in the response to step 1. Full details of how to create an account can be found here.

    Step 3 - Create some transactions

    The example shows how to create a payment to deposit cash on the account and then subsequently create an order to buy some shares. We call this a transaction group. Make sure the accountId field is populated with the Id returned in the response to step 2.

    Step 4 - List your transactions

    The example shows how to query any transactions for a given account. Make sure the accountId field is populated with the Id returned in the response to 2. Your response will be the details of the payment and order created in step 3.

    Step 5 - Retrieve your account summary

    The example shows how to query the latest position for a given account. Make sure the accountId URL paramater is populated with the Id returned in the response to 2. Your response will be the details of the overall account value and growth, and the latest cash and stock positions.

    As ever, if you get stuck, drop us a line in the Seccl Slack community.

    Instrument

    Seccl will hold data for instruments that are available to your firm. We provide this as part of the service and will maintain the data daily which includes price updates. The instrument asset classes include equities, ETFs and Funds. APIs are provided to query this data.

    List instruments

    To list instruments, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/asset/<firmId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": [
            {
                "id": "286D7",
                "type": "Asset",
                "firmId": "FIRM1",
                "isin": "GB00B2PDGW16",
                "shortName": "WH SMITH PLC",
                "longName": "WH Smith PLC",
                "instrumentType": "Equity",
                "currency": "GBP",
                "status": "Active",
                "primaryMarket": true,
                "quoteUnit": 1,
                "ticker": "SMWH",
                "mic": "XLON",
                "classifications": [
                    {
                        "classificationType": "LSE Sector",
                        "value": "F25F"
                    },
                    {
                        "classificationType": "LSE Segment",
                        "value": "STMM"
                    }
                ],
                "priceDate": "2018-01-18T00:00:00.000Z",
                "bid": 23.07,
                "ask": 23.05,
                "mid": 23.06,
                "minimumTransferUnit": 1
            }
        ]
    }
    

    Instruments available in your firm can be obtained from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/asset/<firmId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the instrument. This should be used on any subsequent data where it is required
    type The type of instrument, e.g. Asset
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    isin The ISIN of the instrument
    shortName The short name of the instrument
    longName The long name of the instrument
    instrumentType The instrument type, e.g. Equity, ETF, Fund
    currency The listed currency of the instrument
    status The status of the instrument, e.g. Active, Suspended, Delisted
    primaryMarket Flag to state whether this listing is the primary market of the instrument
    quoteUnit The unit for which the instrument is priced.
    ticker The Ticker of the instrument
    mic The MIC code of the instrument to identify the market it is traded on
    classifications An array of instrument classifications
    classificationType - The classification type, such as LSE Sector, LSE Segment, IMA
    value - The classification value
    priceDate The latest price date
    bid The latest close of business bid price
    ask The latest close of business ask price
    mid The latest close of business mid price
    minimumTransferUnit The minimum unit that the instrument can be transfered in. Typically equities will be 1 for whole shares. Funds could be fractions of shares such as 0.0001

    List instruments with filter

    To list instruments with an Id or Name filter, use this code:

    curl -X GET \
      https://pfolio-api-staging.seccl.tech/asset/<firmId>?idOrName=<filter> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    It is also possible to filter the instruments available by search on various Id types or a name.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/asset/<firmId>?parameter=<value>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Query Parameters

    Parameter Description
    idOrName Text to filter the search of an instrument. This can be all or part of an ISIN, Ticker, Instrument Name, MexId or the Seccl Id

    Response Data

    The response data is as described in the List instruments section

    Client

    Looking after clients, their data and their hard-earned assets, is what Seccl's Digital Custody service is all about. This section details how to create, retrieve, list and make updates to your clients data on our service.

    Create client

    To create a client, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/client \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "firmId": "FIRM1",
            "nodeId": ["0"],
            "clientType": "Individual",
            "title": "Miss",
            "firstName": "Selene",
            "surname": "Love",
            "gender": "Female",
            "currency": "GBP",
            "addressDetail": {
                "address1": "160 Manchester Road",
                "address2": "Doncaster",
                "country": "GB",
                "postCode": "DN11 6RJ"
            },
            "nationality": "GB",
            "language": "en",
            "email": "Selene.Love107@email.com",
            "mobile": {
              "number": "07777000000",
              "locale": "en-GB",
              "isMobile": true
            }
            "currency": "GBP",
            "nationalInsuranceNo": "XB952013A",
            "dateOfBirth": "1972-10-01",
            "bankDetails": {
                "sortCode": "999999",
                "accountNumber": "99999999"
            },
            "taxDomicile": "GB",
            "termsAccepted": true
          }'
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00000001"
        }
    }
    

    You can create clients in your firm via the API.

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/client

    Body Data

    Field Data Type Description
    firmId
    REQUIRED
    String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    nodeId
    REQUIRED
    String Array The array of nodeIds the client is linked to
    clientType
    REQUIRED
    String The type of client. This can be an individual or corporate
    title
    REQUIRED
    String Title of the client, for instance, Miss, Mr, Dr, Mrs
    firstName
    REQUIRED
    String First name of the client
    middleName String Middle name of the client (if set)
    surname
    REQUIRED
    String Surname of the client
    gender
    REQUIRED
    String Gender of the client
    addressDetail
    REQUIRED
    Object The address of the client
    address1 - Address line 1
    address2 - Address line 2
    address3 - Address line 3 (if set)
    address4 - Address line 4 (if set)
    address5 - Address line 5 (if set)
    country - Country of residence
    postCode - Postal code
    nationality
    REQUIRED
    String Nationality of the client
    language
    REQUIRED
    String Language of the client
    email
    REQUIRED
    String Email address of the client
    mobile
    REQUIRED
    Object Mobile number of the client
    number - The mobile number
    locale - Locale of the number, e.g. en-GB
    isMobile - Set to true
    phone Object Phone number of the client (if set)
    number - The phone number
    locale - Locale of the number, e.g. en-GB
    isMobile - Set to false
    currency
    REQUIRED
    String The main currency of the client. All portfolio level values will be shown in this currency
    nationalInsuranceNo
    REQUIRED
    String National insurance number of the client
    dateOfBirth
    REQUIRED
    DateString Client date of birth
    taxDomicile
    REQUIRED
    String Tax domicile of the client
    bankDetails Object The bank details associated to the client
    sortCode - The sort code
    accountNumber - The account number
    termsAccepted Boolean Flag showing whether the client has accepted terms and conditions
    termsAcceptedDate Date The date the client accepted terms and conditions
    status String Status of the client, can be Active, Suspended or Pending

    Verify client email address

    To verify a client email address, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/FIRM1/adsliug342564blubdlfrew2347
    

    This command returns JSON structured as follows:

    {
        "data": {
            "emailVerified": true
        }
    }
    

    The VerifyEmail endpoint receives the put token, verifies the relevant client's details and updates the client where relevant

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/verifyemail/<firmId>/<token>

    Retrieve client

    To return a client, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/client/<firmId>/<id> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": {
              "id": "00D8555",
              "firmId": "FIRM1",
              "nodeId": [
                  "0"
              ],
              "clientType": "Individual",
              "title": "Miss",
              "firstName": "Selene",
              "surname": "Love",
              "gender": "Female",
              "addressDetail": {
                  "address1": "160 Manchester Road",
                  "address2": "Harworth",
                  "address3": "Doncaster",
                  "country": "GB",
                  "postCode": "DN11 6RJ"
              },
              "nationality": "GB",
              "language": "en",
              "email": "Selene.Love107@email.com",
              "emailVerified": false,
              "mobile": {
                "number": "07777000000",
                "locale": "en-GB",
                "isMobile": true
              },
              "currency": "GBP",
              "nationalInsuranceNo": "XB952013A",
              "dateOfBirth": "1972-10-01",
              "taxDomicile": "GB",
              "termsAccepted": true,
              "status": "Pending",
              "nodeName": [
                  "Firm 1"
              ],
              "updateId": "5a38d230773b790001e2a5bc",
              "amlData": {
                  "checkDate": "2017-01-01T00:00:00.000Z",
                  "checkNode": [
                      "0"
                  ],
                  "checkResult": "clear",
                  "checks": [
                      "identity"
                  ]
              }
        }
    }
    

    Clients in your firm can be obtained from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the client. This should be used on any subsequent data where it is required
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    nodeId The array of nodeIds the client is linked to
    clientType The type of client. This can be an individual or corporate
    title Title of the client, for instance, Miss, Mr, Dr, Mrs
    firstName First name of the client
    middleName Middle name of the client (if set)
    surname Surname of the client
    gender Gender of the client
    addressDetail The address of the client
    address1 - Address line 1
    address2 - Address line 2
    address3 - Address line 3 (if set)
    address4 - Address line 4 (if set)
    address5 - Address line 5 (if set)
    country - Country of residence
    postCode - Postal code
    nationality Nationality of the client
    language Language of the client
    email Email address of the client
    emailVerified This will be true if the client has verified their email address with the correct token
    mobile Mobile number of the client
    number - The mobile number
    locale - Locale of the number, e.g. en-GB
    isMobile - Flag to show if it is a mobile number
    phone Phone number of the client (if set)
    number - The phone number
    locale - Locale of the number, e.g. en-GB
    isMobile - Flag to show if it is a mobile number
    currency The main currency of the client. All portfolio level values will be shown in this currency
    nationalInsuranceNo National insurance number of the client
    dateOfBirth Client date of birth
    taxDomicile Tax domicile of the client
    bankDetails The bank details associated to the client (if set)
    sortCode - The sort code
    accountNumber - The account number
    termsAccepted Flag showing whether the client has accepted terms and conditions
    status Status of the client, can be Active, Suspended or Pending
    nodeName An array of names of the nodes the client belongs to
    updateId An Id assigned to the record when it was last updated. This value should be sent with any update requests to the record
    amlData The result of the AML check on the client data
    checkDate - the date the check was triggered
    checkNode - the node under which the client is registered at the time of the AML check
    checkResult - the response from the check, can be clear, consider or undefined
    checks - The type of the check executed on the client

    List clients

    To list clients, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/client/<firmId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    Clients in your firm can be returned in bulk from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/client/<firmId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Response Data

    The response data is an array of items described in the Retrieve Client section

    List clients with filter

    To list clients with various parameters, use this code:

    curl -X GET \
      https://pfolio-api-staging.seccl.tech/client/<firmId>?surname=<surname>&postCode=<postCode> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/client/<firmId>?parameter=<value>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Query Parameters

    One or many of the following parameters can be used.

    Parameter Description
    firstName The first name of the client. All or part of the first name can be used
    surname The surname of the client. All or part of the surname can be used
    nationalInsuranceNo The national insurance number of the client
    postCode The post code of the client. All or part of the code can be used.

    Response Data

    The response data is an array of items described in the Retrieve client section

    Update client

    You can update clients in your firm via the API. Updates are made on specific elements of the client data, for instance their address or bank details. This allows the ability to trigger different actions depending on the which part of the client data is changed.

    Update client address

    You can update a client's address in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update address - Body Data

    To update a client's address, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendAddress",
              "updateReason": "This client address has been updated",
              "updateData": {
                    "addressDetail": {
                        "address1": "165 Manchester Road",
                        "address2": "Harworth",
                        "address3": "Doncaster",
                        "country": "GB",
                        "postCode": "DN11 6RJ"
                    },
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendAddress
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    addressDetail
    REQUIRED
    Object The address of the client
    address1 - Address line 1
    REQUIRED
    address2 - Address line 2
    REQUIRED
    address3 - Address line 3
    address4 - Address line 4
    address5 - Address line 5
    country - Country of residence
    REQUIRED
    postCode - Postal code
    REQUIRED

    Update client bank details

    You can update a client's bank details in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update bank details - Body Data

    To update a client's bank details, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendBank",
              "updateReason": "This client bank details have been updated",
              "updateData": {
                    "bankDetails": {
                        "sortCode": "012345",
                        "accountNumber": "01234567"
                    },
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendBank
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    bankDetails
    REQUIRED
    Object The bank details associated to the client
    sortCode - The sort code
    REQUIRED
    accountNumber - The account number
    REQUIRED

    Update client email address

    You can update a client's email address in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update email - Body Data

    To update a client's email address, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendEmailAddress",
              "updateReason": "This client email has been updated",
              "updateData": {
                    "email": "Selene.Love888@email.com"
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendEmailAddress
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    email
    REQUIRED
    String Email address of the client

    Update client name

    You can update a client's name in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update name - Body Data

    To update a client's name, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendName",
              "updateReason": "This client name has been updated",
              "updateData": {
                    "name": {
                      "firstName": "Selene",
                      "surname": "Jones"
                    }
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendName
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    name
    REQUIRED
    Object The name details of the client
    title - The title of the client
    firstName - The first name of the client
    REQUIRED
    middleName - The middle names of the client
    surname - The surname of the client
    REQUIRED

    Update client mobile phone details

    You can update a client's mobile phone details in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update mobile number - Body Data

    To update a client's mobile number, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendMobileNumber",
              "updateReason": "This client mobile number has been updated",
              "updateData": {
                    "mobile": {
                      "number": "07777 777666",
                      "locale": "en-GB",
                      "isMobile": "true"
                    }
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendMobileNumber
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    mobile
    REQUIRED
    Object The mobile details of the client
    number - The new phone number
    REQUIRED
    locale - The phone locale
    REQUIRED
    isMobile - The new flag
    REQUIRED

    Update client date of death

    You can update a client's date of death in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update date of death - Body Data

    To set a client's date of death, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "SetDateOfDeath",
              "updateReason": "The Client passed away",
              "updateData": {
                    "dateOfDeath": "2020-10-10"
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to SetDateOfDeath
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    dateOfDeath
    REQUIRED
    DateString The date of the client's death
    dateOfDeathConfirmation
    DateString The date when the client's death is confirmed

    Update client date of death confirmation

    You can update the confirmation of the client's death in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Update confirm a client's date of death - Body Data

    To confirm a client's date of death, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "SetDateOfDeathConfirmation",
              "updateReason": "The Client passed away confirmed",
              "updateData": {
                    "dateOfDeathConfirmation": "2020-10-11"
              }
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to SetDateOfDeathConfirmation
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made
    updateData
    REQUIRED
    Object The new data. See below for details

    The updateData field will be populated as follows

    Field Data Type Description
    dateOfDeathConfirmation
    REQUIRED
    Date The date when the client's death is confirmed

    Resend email address verification

    Email and sms validation and verification is also handled by client updates.
    Email address verification tokens expire after 24 hours. If the token has expired, this client update will send a new one.
    This will reset the client's status to pending until the token is verified.

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Resend an email address verification message - Body Data

    To send a new message to verify a client's email address, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendResendEmailVerification",
              "updateReason": "This client requested a new verification email"
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendResendEmailVerification
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made

    The updateData field is not required for this type of request.

    Resend mobile phone verification message

    Email and sms validation and verification is also handled by client updates.
    Mobile phone number verification tokens expire after 10 minutes. If the token has expired, this client update will send a new one.
    This will reset the client's status to pending until the token is verified.

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Resend a mobile phone verification message - Body Data

    To send a new message to verify a client's mobile phone number, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendMobileVerification",
              "updateReason": "This client requested a new verification message"
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendMobileVerification
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made

    The updateData field is not required for this type of request.

    Resend sms verification token (2FA)

    Email and sms validation and verification is also handled by client updates.
    SMS verification tokens expire after 10 minutes. If the token has expired, this client update will send a new one.

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Resend a verification token by sms - Body Data

    To send a new message to verify a client's mobile phone number, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "updateAction": "AmendResendSmsVerification",
              "updateReason": "This client requested a new verification message"
          }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendResendSmsVerification
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made

    The updateData field is not required for this type of request.

    Reset client password

    A client can request a password reset link to be sent to them. This is how to do it:

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/reset/

    Reset client password - Body Data

    To send an email to reset a client's password, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/client/<firmId>/<clientId> \
      -H 'Content-Type: application/json'  \
      -d '{
              "id": "<email address or client id>",
              "surname": "McTesterson",
              "dateOfBirth": "1980-01-11",
              "firmId": "ExampleFirmId"
          }'
    
    Field Data Type Description
    id
    REQUIRED
    String The client's email address or id. For verification purposes.
    surname
    REQUIRED
    String The client's surname. For verification purposes.
    dateOfBirth
    REQUIRED
    DateString The client's date of birth. For verification purposes.
    firmId
    REQUIRED
    String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Account

    Clients can have one or more accounts. These can be linked to various product types that we support, such as ISAs, Pensions or just normal trading accounts.

    Create account

    To create an account, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/account \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "firmId": "FIRM1",
            "nodeId": "0",
            "accountType": "Wrapper",
            "name": "My trading account",
            "status": "Active",
            "currency": "GBP",
            "clientId": "<client Id>",
            "wrapperDetail": {
              "wrapperType": "GIA"
            }
          }'
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00000001"
        }
    }
    

    To create an account with a regular investment, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/account \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "firmId": "FIRM1",
            "nodeId": "0",
            "accountType": "Wrapper",
            "name": "My trading account",
            "status": "Active",
            "currency": "GBP",
            "clientId": "<client Id>",
            "wrapperDetail": {
              "wrapperType": "GIA"
            }
            "bankDetails": {
                "sortCode": "999999",
                "accountNumber": "99999999"
            },
            "recurringPayment": {
                "movementType": "In",
                "amount": 1000,
                "paymentDay": 7,
                "method": "Direct Debit"
            },
            "recurringOrders": {
                "movementType": "Invest",
                "investmentType": "99999999",
                "orderDay": 7,
                "details": [{
                    "assetId": "",
                    "amount": 500
                }]
            },
          }'
    

    You can create accounts for your clients via the API.

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/account

    Body Data

    Field Data Type Description
    firmId
    REQUIRED
    String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    nodeId
    REQUIRED
    String The nodeId the account is linked to. The client the account belongs to must also be linked to this node.
    accountType
    REQUIRED
    String The type of account. Use the value Wrapper here.
    name
    REQUIRED
    String The name of this account
    status String Status of the client, can be Active, Suspended or Pending
    currency
    REQUIRED
    String The currency of the account
    clientId
    REQUIRED
    String The Seccl Id of the client that the account belongs to
    wrapperDetail Object The wrapper details of the account
    wrapperType - The product type of the wrapper account, for instance GIA or ISA
    bankDetails Object The bank details associated to the account. These details will override client level bank account details for payments for this account
    sortCode - The sort code
    accountNumber - The account number
    recurringPayment Object Details of a recurring payment set up for this account
    movementType - Direction of the payment, either In or Out
    amount - The recurring payment amount
    paymentDay - The day of the month the payment is taken
    method - The method of payment. This can be Direct Debit or Bank Transfer
    recurringOrders Object The bank details associated to the client
    movementType - Set to Invest
    investmentType - Set to Bespoke
    orderDay - The day of the month the orders are created
    details - Array of data showing which instruments the investments will be made into. See below for details

    The recurringOrders.details field is populated with the following data:

    Field Data Type Description
    assetId
    REQUIRED
    String The SecclId of the instrument to be traded. These can be retrieved from the instrument list
    amount String The amount to be invested
    percentage String The percentage of available cash to be invested

    Retrieve account

    To return an account, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/account/<firmId>/<id> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00D8516",
            "firmId": "FIRM1",
            "nodeId": "1",
            "accountType": "Wrapper",
            "name": "Selene Love Trading Account",
            "currency": "GBP",
            "status": "Active",
            "wrapperDetail": {
                "wrapperType": "GIA"
            },
            "clientId": "00D8555",
            "bankDetails": {
                "sortCode": "998978",
                "accountNumber": "60279696"
            },
            "recurringPayment": {
                "movementType": "In",
                "amount": 1440,
                "paymentDay": 7,
                "method": "Direct Debit"
            },
            "nodeName": "Strawberry",
            "clientName": "Selene Love",
            "updateId": "5a38d230773b790001e2a5be"
        }
    }
    

    Accounts in your firm can be obtained from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/account/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the account.

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the account. This should be used on any subsequent data where it is required
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    nodeId The array of nodeIds the account is linked to
    accountType The type of account. Use the value Wrapper here.
    name The name of this account
    status Status of the client, can be Active, Suspended or Pending
    currency The currency of the account
    clientId The Seccl Id of the client that the account belongs to
    wrapperDetail The wrapper details of the account
    wrapperType - The product type of the wrapper account, for instance GIA or ISA
    bankDetails The bank details associated to the account. These details will override client level bank account details for payments for this account
    sortCode - The sort code
    accountNumber - The account number
    recurringPayment Details of a recurring payment set up for this account
    movementType - Direction of the payment, either In or Out
    amount - The recurring payment amount
    paymentDay - The day of the month the payment is taken
    method - The method of payment. This can be Direct Debit or Bank Transfer
    recurringOrders The bank details associated to the client
    movementType - Set to Invest
    investmentType - Set to Bespoke
    orderDay - The day of the month the orders are created
    details - Array of data showing which instruments the investments will be made into. Includes AssetId and Amount or Percentage
    nodeName The name of the nodes the account belongs to
    clientId The name of the client that the account belongs to
    updateId An Id assigned to the record when it was last updated. This value should be sent with any update requests to the record

    List accounts

    To list accounts, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/account/<firmId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    Accounts in your firm can be returned in bulk from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/account/<firmId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Response Data

    The response data is an array of items described in the Retrieve account section

    List accounts with filter

    To list clients with various parameters, use this code:

    curl -X GET \
      https://pfolio-api-staging.seccl.tech/account/<firmId>?clientId=<clientId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/account/<firmId>?parameter=<value>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Query Parameters

    One or many of the following parameters can be used.

    Parameter Description
    name The name of the account. All or part of the name can be used
    clientId The clientId that an account belongs to

    Response Data

    The response data is an array of items described in the Retrieve account section

    Update account

    You can update accounts in your firm via the API. Updates are made on specific elements of the account data, for instance their nodeId or recurring payments. This allows the ability to trigger different actions depending on the which part of the account data is changed.

    Update account node

    An account's node can be updated in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the account.

    Update node - Body Data

    To update the node of an account, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<accountId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "updateAction": "AmendNode",
            "updateReason": "Account node updated",
            "updateData": {
                "nodeId": "0"
          }
        }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendNode
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made

    The updateData field will be populated as follows

    Field Data Type Description
    nodeId
    REQUIRED
    String Number of the new account node

    Update account recurring payment

    An account's recurring payment can be updated in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the account.

    Update recurring payment - Body Data

    To update the recurring payment of an account, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<accountId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "updateAction": "AmendRecurringPayments",
            "updateReason": "Account payment updated",
            "updateData": {
                "recurringPayment": {
                    "movementType": "In",
                    "amount": 500.12,
                    "paymentDay": 25,
                    "method": "Direct Debit"
                }
          }
        }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to AmendRecurringPayments
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made

    The updateData field will be populated as follows

    Field Data Type Description
    recurringPayment
    REQUIRED
    Object The new recurring payment details of the account
    movementType - The current payment movement type
    DEFAULT
    amount - The new payment amount
    REQUIRED
    paymentDay - The new day of the month that payments should be made
    REQUIRED
    method - The current payment method
    DEFAULT

    Cancel account recurring payment

    An account's recurring payment can be cancelled in your firm via the API. Here's how:

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the account.

    Cancel recurring payment - Body Data

    To cancel the recurring payment of an account, use this code:

    curl -X PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<accountId> \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
            "updateAction": "CancelRecurringPayment",
            "updateReason": "Account payment cancelled",
            "updateData": {
                "cancelledRecurringPayment": {
                    "movementType": "In",
                    "amount": 500.12,
                    "paymentDay": 25,
                    "method": "Direct Debit"
                }
          }
        }'
    
    Field Data Type Description
    updateAction
    REQUIRED
    String The update type. Set to CancelRecurringPayment
    updateReason
    REQUIRED
    String Free format narrative for the reason the update is made

    The updateData field will be populated as follows

    Field Data Type Description
    cancelledRecurringPayment
    REQUIRED
    Object The new recurring payment details of the account
    movementType - The current payment movement type
    DEFAULT
    amount - The new payment amount
    REQUIRED
    paymentDay - The new day of the month that payments should be made
    REQUIRED
    method - The current payment method
    DEFAULT

    Retrieve Account Summary

    To return a client's account summary, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/account/summary/<firmId>/<id> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
      "data": {
        "id": "00D8516",
        "firmId": "FIRM1",
        "name": "Selene Love Trading Account",
        "currency": "GBP",
        "accountType": "Wrapper",
        "wrapperType": "GIA",
        "positions": [
          {
            "id": "00D8516|C|GBP",
            "positionType": "Cash",
            "currency": "GBP",
            "currentValue": 9502.40,
            "openingValue": 0,
            "growth": 0,
            "growthPercent": 0,
            "allocation": 0.9498
          },
          {
            "id": "00D8516|S|GB00B019KW72",
            "positionType": "Stock",
            "isin": "GB00B019KW72",
            "assetId": "284JP",
            "assetName": "J Sainsbury PLC",
            "quantity": 200,
            "bookValue": 497.60,
            "openingValue": 0,
            "currentValue": 501.80,
            "growth": 4.20,
            "currency": "GBP",
            "growthPercent": 0.0084,
            "currentPrice": 2.509,
            "currentPriceDate": "2018-02-16T00:00:00.000Z",
            "minimumTransferUnit": 1,
            "allocation": 0.0502
          }
        ],
        "bookValue": 10000.00,
        "openingValue": 0,
        "currentValue": 10004.20,
        "uninvestedCash": 9502.40,
        "growth": 4.20,
        "growthPercent": 0.0004
      }
    }
    

    The summary of an account's assets for a client in your firm can be obtained from the API.

    HTTP Request

    PUT https://pfolio-api-staging.seccl.tech/account/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the account.

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the account
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    name The name of the account
    currency The main currency of the account. All account level values will be in this currency
    accountType The type of account. This will be Wrapper or Client Cash
    wrapperType For accounts that have a type of Wrapper this will be the tax wrapper type, for instance GIA or ISA
    positions An array of cash and stock positions held in the account (see below)
    bookValue The overall book value of the account
    openingValue The opening value of the account
    currentValue The current value of the account at the latest prices
    uninvestedCash The total amount of uninvested cash in the account. This can be used for further trading
    growth The monetary growth of the account
    growthPercent The percentage growth of the account

    Cash Position

    Field Description
    id The Seccl Id of the position
    positionType The type of the position. This will be set to Cash
    currency The currency of the position
    openingValue The opening value of the position
    currentValue The currency value of the position
    growth The monetary growth of the position
    growthPercent The percentage growth of the position
    allocation The value of the position as a percentage of the total value of all positions

    Stock Position

    Field Description
    id The Seccl Id of the position
    positionType The type of the position. This will be set to Stock
    isin The ISIN of the instrument of the position
    assetId The Seccl Id of the instrument of the position
    assetName The name of the instrument of the position
    currency The currency of the position
    quantity The quantity or units held
    bookValue The book value of the position
    openingValue The opening value of the position
    currentValue The currency value of the position
    growth The monetary growth of the position
    growthPercent The percentage growth of the position
    currentPrice The current price of the position. This will use the sell price if available, otherwise the mid price
    currentPriceDate The date of the latest price
    minimumTransferUnit The minimum unit that the instrument can be traded in
    allocation The value of the position as a percentage of the total value of all positions

    Retrieve Account Report

    To return a client's account report, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/account/report/<firmId>/<accountId>?type=Report&fromdate=2000-01-01T00:00:00Z&todate=2000-01-02T00:00:00Z \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00D854B",
            "name": "GIA",
            "firmId": "FIRM1",
            "currency": "GBP",
            "accountType": "Wrapper",
            "wrapperType": "GIA",
            "payments": {
                "transactionsIn": [{
                    "transactionId": "0000003B4",
                    "transactionCode": "CPIN",
                    "narrative": "Client Payment",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "transactionsOut": [{
                    "transactionId": "0000003B5",
                    "transactionCode": "CPOU",
                    "narrative": "Client Payment",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "totalIn": 0,
                "totalOut": 0
            },
            "charges": {
                "transactions": [{
                    "transactionId": "0000003B6",
                    "transactionCode": "PFOF",
                    "narrative": "Platform fee",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "total": 0
            },
            "income": {
                "transactions": [{
                    "transactionId": "0000003B7",
                    "transactionCode": "CDIV",
                    "narrative": "Dividend",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "total": 0
            },
            "performance": {
                "transactionsRealised": [
                  {
                    "transactionId": "0000003B8",
                    "transactionCode": "SELL",
                    "narrative": "Sell of 100 units",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "quantity": 100
                  }
                ],
                "positionsRetained": [
                    {
                        "isin": "GB00B019KW72",
                        "assetName": "J Sainsbury PLC",
                        "quantity": 20,
                        "bookValue": 49.76,
                        "currentValue": 50.18,
                        "growth": 0.42
                    },
                    {
                        "isin": "GB00B2PDGW16",
                        "assetName": "WH Smith PLC",
                        "quantity": -789,
                        "bookValue": -18487.19,
                        "currentValue": -18186.45,
                        "growth": 300.74
                    },
                    {
                        "isin": "LU0292097747",
                        "assetName": "db x-trackers FTSE All-Share UCITS ETF DR",
                        "quantity": -1447,
                        "bookValue": -5669.45,
                        "currentValue": -6024.58,
                        "growth": -355.13
                    },
                    {
                        "isin": "GB00B1VZ0M25",
                        "assetName": "Hargreaves Lansdown PLC",
                        "quantity": -1244,
                        "bookValue": -25048.44,
                        "currentValue": -25048.44,
                        "growth": 0
                    },
                    {
                        "isin": "IE00B0M63730",
                        "assetName": "iShares MSCI AC Far East ex-Japan UCITS ETF",
                        "quantity": -5,
                        "bookValue": -219.04,
                        "currentValue": -212.8,
                        "growth": 6.24
                    },
                    {
                        "isin": "IE00B14X4M10",
                        "assetName": "iShares MSCI North America UCITS ETF",
                        "quantity": 20,
                        "bookValue": -747.28,
                        "currentValue": 734.4,
                        "growth": 1481.68
                    },
                    {
                        "isin": "LU0292107645",
                        "assetName": "db x-trackers MSCI Emerging Markets Index UCITS ETF",
                        "quantity": 104,
                        "bookValue": 3927.46,
                        "currentValue": 3406,
                        "growth": -521.46
                    },
                    {
                        "isin": "IE00B42WWV65",
                        "assetName": "Vanguard UK Government Bond UCITS ETF",
                        "quantity": 21,
                        "bookValue": 494.97,
                        "currentValue": 469.56,
                        "growth": -25.41
                    },
                    {
                        "isin": "GB00B5YKQK23",
                        "assetName": "BlackRock UK D Acc",
                        "quantity": 25.0281,
                        "bookValue": 100,
                        "currentValue": 104.19,
                        "growth": 4.19
                    }
                ],
                "totalRealised": 100,
                "totalRetained": 891.27
            },
            "openingValue": 0,
            "closingValue": 155068.91
        }
    }
    

    The account report shows activity on the specified account within a particular time period.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/account/report/<firmId>/<accountId>?type=Report&fromdate=2000-01-01T00:00:00Z&todate=2000-01-02T00:00:00Z

    URL Query Options

    Query Description
    type=Report Return a full report
    fromdate ISO formatted datetime from which to calculate the report data
    todate ISO formatted datetime to calculate the data before and not including

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    accountId The Seccl Id of the account.

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the client
    firmId The firm Id we have created for you. It is used to segregate your data in a differ
    name The name of the client
    currency The main currency of the client. All portfolio level values will be in this currency
    accountType The type of account. This will be Wrapper or Client Cash
    wrapperType For accounts that have a type of Wrapper this will be the tax wrapper type, for instance GIA or ISA
    openingValue The opening value of the account
    closingValue The opening value of the account
    payments Cash transactions received or paid out for the account during the period
    charges Charges paid out from the account during the period
    income Transactions showing income received during the period
    performance Realised and unrealised transactions for the account during the period
    Field Data Type Description
    cancelledRecurringPayment
    REQUIRED
    Object The new recurring payment details of the account
    movementType - The payment movement type
    REQUIRED
    amount - The payment amount
    REQUIRED
    paymentDay - The day of the month that payments should be made
    REQUIRED
    method - The payment method
    REQUIRED

    Payment

    Payments are made to and from accounts in Seccl.

    Bank transfer in

    To create a payment to an account, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/portfoliotransaction \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "firmId": "FIRM1",
              "accountId": "<account Id>",
              "transactionType": "Payment",
              "transactionSubType": "Deposit",
              "movementType": "In",
              "currency": "GBP",
              "amount": 1000,
              "method": "Bank Transfer"
          }'
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00000001"
        }
    }
    

    Bank transfer out

    To create a withdrawal from an account, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/portfoliotransaction \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "firmId": "FIRM1",
              "accountId": "<account Id>",
              "transactionType": "Payment",
              "transactionSubType": "Withdrawal",
              "movementType": "Out",
              "currency": "GBP",
              "amount": 1000,
              "method": "Bank Transfer"
          }'
    

    You can create payments via the API.

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/portfoliotransaction

    Body Data

    Field Data Type Description
    firmId
    REQUIRED
    String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    accountId
    REQUIRED
    String The Seccl Id of the account the payment is made on
    transactionType
    REQUIRED
    String Set to Payment
    transactionSubType
    REQUIRED
    String The type of payment. This can be Deposit or Withdrawal
    movementType
    REQUIRED
    String The direction of the payment. This can be In or Out
    currency
    REQUIRED
    String The currency of the payment
    amount
    REQUIRED
    Number The payment amount
    method
    REQUIRED
    String The method of the payment. This can be Direct Debit (payments in only) or Bank Transfer
    transactionDate Date The date of the transaction

    List payments

    To list payments, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?transactionType=Payment \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": [
            {
                "id": "0000003B4",
                "firmId": "FIRM1",
                "transactionType": "Payment",
                "transactionSubType": "Deposit",
                "movementType": "In",
                "accountId": "00D8516",
                "currency": "GBP",
                "amount": 100000,
                "method": "Bank Transfer",
                "accountName": "Selene Love Trading Account",
                "accountType": "Wrapper",
                "transactionDate": "2018-01-16T00:00:00.000Z",
                "status": "Completed",
                "nodeId": "1",
                "statusChanges": [
                    {
                        "status": "Pending",
                        "statusDate": "2018-01-16T11:52:31.959Z",
                        "description": "Payment request created"
                    },
                    {
                        "status": "Completed",
                        "statusDate": "2018-01-16T11:53:19.858Z",
                        "description": "Payment received"
                    }
                ],
                "updateId": "5a5de7b0c8c064000149e92e"
            }
        ]
    }
    

    Payments can be returned in bulk from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?transactionType=Payment

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Query Parameters

    One or many of the following parameters can be used.

    Parameter Description
    transactionType This must be set to Payment
    accountId The accountId that the payments are made on
    transactionDate The transaction date of the payments
    currency The currency of the payments
    amount The amount of the payment
    incomplete Flag to return incomplete payments, that is, those that have not cleared. Set to true if required

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the transaction.
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    transactionType The transaction type. This will be set to Payment
    transactionSubType The type of payment. This can be Deposit or Withdrawal
    movementType The direction of the payment. This will be In or Out
    accountId The Seccl account Id the payment is made for
    currency The currency of the account
    amount The amount of the payment
    method The method of the payment. This will be Direct Debit or Bank Transfer
    accountName The name of the account the payment is made for
    accountType The type of the account the payment is made for
    transactionDate The transaction date of the payment
    status The current status of the payment
    nodeId The nodeId the transaction is linked to. The account it belongs to must also be linked to this node.
    statusChanges An array of status changes the payment has had. Each record will include the following fields
    status - The status of payment
    statusDate - The date of the status change
    description - The description of the change
    updateId An Id assigned to the record when it was last updated. This value should be sent with any update requests to the record

    Order

    Orders are made for accounts in Seccl. This allows the purchase and withdrawal of different assets on the account.

    Create order

    To create an invest order for an account, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/portfoliotransaction \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "firmId": "FIRM1",
              "accountId": "<account Id>",
              "transactionType": "Order",
              "transactionSubType": "At Best",
              "movementType": "Invest",
              "currency": "GBP",
              "amount": 1000,
              "assetId": "286Q5"
          }'
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00000001"
        }
    }
    

    To create a sell order for an account, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/portfoliotransaction \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "firmId": "FIRM1",
              "accountId": "<account Id>",
              "transactionType": "Order",
              "transactionSubType": "At Best",
              "movementType": "Sell",
              "currency": "GBP",
              "quantity": 234,
              "assetId": "286Q5"
          }'
    

    You can create orders via the API.

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/portfoliotransaction

    Body Data

    Field Data Type Description
    firmId
    REQUIRED
    String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    accountId
    REQUIRED
    String The Seccl Id of the account the order is made for
    transactionType
    REQUIRED
    String Set to Order
    transactionSubType
    REQUIRED
    String The execution type of the order. This can be At Best or Limit
    movementType
    REQUIRED
    String The direction of the order. This can be Invest or Sell
    currency
    REQUIRED
    String The currency of the order amount
    amount Number The investment amount
    quantity Number The sell quantity
    transactionDate Date The date of the transaction
    assetId
    REQUIRED
    String The Seccl Id of the instrument to be invested into or sold. This Id can be found by listing the available instruments.
    limitPrice Number The limit price. To be set for Limit orders only
    limitExpiryType String The limit price expiry type.

    List orders

    To list orders, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?transactionType=Order \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": [
            {
                "id": "0000003DC",
                "firmId": "FIRM1",
                "transactionType": "Order",
                "transactionSubType": "At Best",
                "movementType": "Invest",
                "accountId": "00D8516",
                "currency": "GBP",
                "amount": 250,
                "assetId": "286BB",
                "accountName": "Selene Love Trading Account",
                "accountType": "Wrapper",
                "transactionDate": "2018-02-21T00:00:00.000Z",
                "status": "Completed",
                "nodeId": "1",
                "statusChanges": [
                    {
                        "status": "Pending",
                        "statusDate": "2018-02-21T13:13:30.204Z",
                        "description": "Order request created"
                    },
                    {
                        "status": "Completed",
                        "statusDate": "2018-02-21T13:13:44.599Z",
                        "description": "Order executed"
                    }
                ],
                "assetName": "iShares MSCI AC Far East ex-Japan UCITS ETF",
                "isin": "IE00B0M63730",
                "ticker": "IFFF",
                "mic": "XLON",
                "instrumentType": "ETF",
                "intendedSettlementDate": "2018-02-23T00:00:00.000Z",
                "updateId": "5a8d70888bf1640001726e4b"
            }
        ]
    }
    

    Orders can be returned in bulk from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?transactionType=Order

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Query Parameters

    One or many of the following parameters can be used.

    Parameter Description
    transactionType This must be set to Order
    accountId The accountId that the orders are made for
    transactionDate The transaction date of the orders
    incomplete Flag to return incomplete orders, that is, those that have not been executed in the market. Set to true if required

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the transaction.
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    transactionType The transaction type. This will be set to Order
    transactionSubType The type of order. This can be At Best or Limit
    movementType The direction of the order. This will be Invest or Sell
    accountId The Seccl account Id the order is made for
    currency The currency of the account
    amount The investment amount of the order
    quantity The quantity of the order
    assetId The Seccl Id of the instrument to be invested into or sold. This Id can be found by listing the available instruments.
    accountName The name of the account the order is made for
    accountType The type of the account the order is made for
    transactionDate The transaction date of the order
    status The current status of the order
    nodeId The nodeId the transaction is linked to. The account it belongs to must also be linked to this node.
    statusChanges An array of status changes the order has had. Each record will include the following fields
    status - The status of order
    statusDate - The date of the status change
    description - The description of the change
    assetName The name of the instrument to be invested into or sold
    isin The ISIN of the instrument to be invested into or sold
    ticker The Ticker of the instrument to be invested into or sold
    mic The MIC of the instrument to be invested into or sold
    instrumentType The type of the instrument to be invested into or sold. This can be Equity, ETF or Fund
    intendedSettlementDate The intended settlement date of the order
    updateId An Id assigned to the record when it was last updated. This value should be sent with any update requests to the record

    Cash

    Cash movements are made to and from accounts in Seccl.

    Create cash transaction

    To create an internal transaction, use this code:

    curl -X POST https://pfolio-api-staging.seccl.tech/portfoliotransaction \
      -H 'Content-Type: application/json'  \
      -H 'api-token: yourtoken' \
      -d '{
              "firmId": "FIRM1",
              "accountId": "<account Id>",
              "transactionType": "Cash",
              "transactionSubType": "Platform Fee",
              "movementType": "Out",
              "currency": "GBP",
              "amount": 500.00
          }'
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00000001"
        }
    }
    

    You can create cash transactions via the API.

    HTTP Request

    POST https://pfolio-api-staging.seccl.tech/portfoliotransaction

    Body Data

    Field Data Type Description
    firmId
    REQUIRED
    String The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    accountId
    REQUIRED
    String The Seccl Id of the account the transaction is made on
    transactionType
    REQUIRED
    String Set to Cash
    transactionSubType
    REQUIRED
    String The type of transaction. This can be Ex Gratia Payment, Platform Fee, Interest, Dividend, Equalisation, Fractional Payment or Redemption
    movementType
    REQUIRED
    String The direction of the transaction. This can be In or Out
    currency
    REQUIRED
    String The currency of the transaction
    amount
    REQUIRED
    Number The transaction amount

    List cash transactions

    To list cash transactions, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?transactionType=Cash \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": [
            {
                "id": "0000003B4",
                "firmId": "FIRM1",
                "transactionType": "Cash",
                "transactionSubType": "Platform Fee",
                "movementType": "Out",
                "accountId": "00D8516",
                "currency": "GBP",
                "amount": 500,
                "accountName": "Selene Love Trading Account",
                "accountType": "Wrapper",
                "transactionDate": "2018-01-16T00:00:00.000Z",
                "status": "Completed",
                "nodeId": "1",
                "externalCounterpartyAccountId": "Firm-1",
                "externalCounterpartyFirmId": "Firm",
                "statusChanges": [
                    {
                        "status": "Completed",
                        "statusDate": "2018-01-16T11:52:31.959Z",
                        "description": "Cash request created"
                    }
                ],
                "updateId": "5a5de7b0c8c064000149e92e"
            }
        ]
    }
    

    Cash transactions can be returned in bulk from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/portfoliotransaction/<firmId>?transactionType=Cash

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Query Parameters

    One or many of the following parameters can be used.

    Parameter Description
    transactionType This must be set to Cash
    accountId The accountId that the transactions are made on
    transactionDate The transaction date of the transactions
    currency The currency of the transactions
    amount The amount of the transactions
    incomplete Flag to return incomplete transactions, that is, those that have not cleared. Set to true if required

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the transaction.
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    transactionType The transaction type. This will be set to Cash
    transactionSubType The type of transaction. This can be Ex Gratia Payment, Platform Fee, Interest, Dividend, Equalisation, Fractional Payment or Redemption
    movementType The direction of the transaction. This will be In or Out
    accountId The Seccl account Id the transaction is made for
    currency The currency of the account
    amount The amount of the transaction
    transactionDate The transaction date
    status The current status of the transaction. this will be Completed for Cash transactions
    accountName The name of the account the transaction is made for
    accountType The type of the account the transaction is made for
    nodeId The nodeId the transaction is linked to. The account it belongs to must also be linked to this node.
    externalCounterpartyAccountId The counter party's firm id - node id
    externalCounterpartyFirmId The counter party's node id

    statusChanges | An array of status changes the transaction has had. Each record will include the following fields | status - The status of transaction | statusDate - The date of the status change | description - The description of the change updateId | An Id assigned to the record when it was last updated. This value should be sent with any update requests to the record

    Portfolio

    This is the important bit! What assets your clients hold, and how are they performing. This section details how to analyse the portfolio of clients at various different levels.

    Retrieve Portfolio Summary

    To return a client's portfolio, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/portfolio/summary/<firmId>/<id> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
      "data": {
        "firmId": "FIRM1",
        "id": "00D8555",
        "name": "Miss Selene Love",
        "currency": "GBP",
        "accounts": [
          {
            "id": "00D8516",
            "name": "Selene Love Trading Account",
            "accountType": "Wrapper",
            "currency": "GBP",
            "wrapperType": "GIA",
            "bookValue": 10000,
            "openingValue": 0,
            "currentValue": 10004.20,
            "uninvestedCash": 9502.40,
            "growth": 4.20,
            "growthPercent": 0.0004,
            "allocation": 1
          }
        ],
        "positions": [
          {
            "positionType": "Cash",
            "currency": "GBP",
            "currentValue": 9502.40,
            "openingValue": 0,
            "growth": 0,
            "growthPercent": 0,
            "allocation": 0.9498
          },
          {
            "positionType": "Stock",
            "isin": "GB00B019KW72",
            "assetId": "284JP",
            "assetName": "J Sainsbury PLC",
            "quantity": 200,
            "bookValue": 497.60,
            "openingValue": 0,
            "currentValue": 501.80,
            "growth": 4.20,
            "currency": "GBP",
            "growthPercent": 0.0084,
            "currentPrice": 2.509,
            "currentPriceDate": "2018-02-16T00:00:00.000Z",
            "minimumTransferUnit": 1,
            "allocation": 0.0502
          }
        ],
        "bookValue": 10000.00,
        "openingValue": 0,
        "currentValue": 10004.20,
        "uninvestedCash": 9502.40,
        "growth": 4.20,
        "growthPercent": 0.0004
      }
    }
    

    The portfolio summary for clients in your firm can be obtained from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/portfolio/summary/<firmId>/<id>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    id The Seccl Id of the client.

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the client
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    name The name of the client
    currency The main currency of the client. All portfolio level values will be in this currency
    accounts An array of accounts that the client owns
    id - The Seccl Id of the account
    name - The name of the account
    accountType - The type of account. This will be Wrapper or Client Cash
    currency - The currency of the account.
    wrapperType - For accounts that have a type of Wrapper this will be the tax wrapper type, for instance GIA or ISA
    bookValue - The overall book value of the account
    openingValue - The opening value of the account
    currentValue - The current value of the account at the latest prices
    uninvestedCash - The total amount of uninvested cash in the account. This can be used for further trading
    growth - The monetary growth of the account
    growthPercent - The percentage growth of the account
    allocation - The value of the account as a percentage of the total value of all accounts
    positions An array of cash and stock positions held by the client, aggregated across all accounts (see below)
    bookValue The overall book value of the portfolio
    openingValue The opening value of the portfolio
    currentValue The current value of the portfolio at the latest prices
    uninvestedCash The total amount of uninvested cash in the portfolio. This can be used for further trading
    growth The monetary growth of the portfolio
    growthPercent The percentage growth of the portfolio

    Cash Position

    Field Description
    positionType The type of the position. This will be set to Cash
    currency The currency of the position
    openingValue The opening value of the position
    currentValue The currency value of the position
    growth The monetary growth of the position
    growthPercent The percentage growth of the position
    allocation The value of the position as a percentage of the total value of all positions

    Stock Position

    Field Description
    positionType The type of the position. This will be set to Stock
    isin The ISIN of the instrument of the position
    assetId The Seccl Id of the instrument of the position
    assetName The name of the instrument of the position
    currency The currency of the position
    quantity The quantity or units held
    bookValue The book value of the position
    openingValue The opening value of the position
    currentValue The currency value of the position
    growth The monetary growth of the position
    growthPercent The percentage growth of the position
    currentPrice The current price of the position. This will use the sell price if available, otherwise the mid price
    currentPriceDate The date of the latest price
    minimumTransferUnit The minimum unit that the instrument can be traded in
    allocation The value of the position as a percentage of the total value of all positions

    Retrieve Cash Position

    To return a cash position summary, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/position/<firmId>/<positionId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
      "data": {
        "id": "00D8516|C|GBP",
        "firmId": "FIRM1",
        "accountId": "00D8516",
        "accountType": "Wrapper",
        "positionType": "Cash",
        "currency": "GBP",
        "accountName": "Selene Love Trading Account",
        "transactions": [
          {
            "transactionId": "0000003B4",
            "transactionCode": "CPIN",
            "narrative": "Client Payment",
            "postDate": "2018-01-16T11:53:26.556Z",
            "valueDate": "2018-01-16T11:53:13.461Z",
            "amount": 10000
          },
          {
            "transactionId": "0000003B5",
            "transactionCode": "BUY",
            "narrative": "Buy 200 J Sainsbury PLC",
            "postDate": "2018-01-16T11:56:36.839Z",
            "valueDate": "2018-01-18T00:00:00.000Z",
            "amount": -497.60
          }
        ],
        "currentValue": 9502.4,
        "growth": 0,
        "growthPercent": 0,
        "openingValue": 0
      }
    }
    

    The summary of cash position can be obtained from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/position/<firmId>/<positionId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    positionId The Seccl Id of the position. This can be obtained by retrieving the account summary

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the position
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    accountId The Seccl Id of the account that holds the position
    accountName The name of the account that holds the position
    currency The currency of the positon.
    accountType The type of account. This will be Wrapper or Client Cash
    wrapperType For accounts that have a type of Wrapper this will be the tax wrapper type, for instance GIA or ISA
    positionType The type of the position. This will be set to Cash
    transactions An array of cash transactions that make up the position (see below)
    currency The currency of the position
    openingValue The opening value of the position
    currentValue The currency value of the position
    growth The monetary growth of the position
    growthPercent The percentage growth of the position

    The cash transaction data is as follows:

    Field Description
    transactionId The Seccl Id of the transaction
    transactionCode The transaction code
    narrative The narrative of the transaction
    postDate The date the transaction was posted
    valueDate The date the transaction has value, that is, when money moved between physical bank accounts
    amount The amount of the transaction

    Retrieve Stock Position

    To return a stock position summary, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/position/<firmId>/<positionId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
      "data": {
        "id": "00D8516|S|GB00B019KW72",
        "firmId": "FIRM1",
        "accountId": "00D8516",
        "accountType": "Wrapper",
        "positionType": "Stock",
        "currency": "GBP",
        "isin": "GB00B019KW72",
        "accountName": "Selene Love Trading Account",
        "assetName": "J Sainsbury PLC",
        "assetId": "284JP",
        "transactions": [
          {
            "transactionId": "0000003B5",
            "transactionCode": "BUY",
            "narrative": "Buy 200 J Sainsbury PLC",
            "postDate": "2018-01-16T11:56:32.277Z",
            "valueDate": "2018-01-18T00:00:00.000Z",
            "quantity": 200,
            "value": 497.60,
            "bookValue": 497.60,
            "profitLoss": 0
          }
        ],
        "quantity": 200,
        "bookValue": 497.60,
        "growth": 4.20,
        "currentPrice": 2.509,
        "minimumTransferUnit": 1,
        "currentPriceDate": "2018-02-16T00:00:00.000Z",
        "currentValue": 501.80,
        "openingValue": 0,
        "growthPercent": 0.0084
      }
    }
    

    The summary of stock position can be obtained from the API.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/position/<firmId>/<positionId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    positionId The Seccl Id of the position. This can be obtained by retrieving the account summary

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the position
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    accountId The Seccl Id of the account that holds the position
    accountName The name of the account that holds the position
    currency The currency of the positon.
    accountType The type of account. This will be Wrapper for stock positions
    wrapperType For accounts that have a type of Wrapper this will be the tax wrapper type, for instance GIA or ISA
    positionType The type of the position. This will be set to Stock
    isin The ISIN of the instrument of the position
    assetId The Seccl Id of the instrument of the position
    assetName The name of the instrument of the position
    transactions An array of stock transactions that make up the position (see below)
    quantity The quantity or units held
    bookValue The book value of the position
    openingValue The opening value of the position
    currentValue The currency value of the position
    growth The monetary growth of the position
    growthPercent The percentage growth of the position
    currentPrice The current price of the position. This will use the sell price if available, otherwise the mid price
    currentPriceDate The date of the latest price
    minimumTransferUnit The minimum unit that the instrument can be traded in

    The stock transaction data is as follows:

    Field Description
    transactionId The Seccl Id of the transaction
    transactionCode The transaction code
    narrative The narrative of the transaction
    postDate The date the transaction was posted
    valueDate The date the transaction has value, that is, when stock changed ownership
    quantity The quantity of the transaction
    value The amount of money paid for the transaction
    bookValue The book value of the transaction
    profitLoss The realised profit or loss of the transaction. This will only be populated on sell or outward transactions

    Retrieve Portfolio Report

    To return a client's portfolio report, use this code:

    curl -X GET https://pfolio-api-staging.seccl.tech/portfolio/report/<firmId>/<clientId>?type=Report&fromdate=2000-01-01T00:00:00Z&todate=2000-01-02T00:00:00Z \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "00D8555",
            "name": "Miss Selene Love",
            "firmId": "FIRM1",
            "currency": "GBP",
            "payments": {
                "transactionsIn": [{
                    "transactionId": "0000003B4",
                    "transactionCode": "CPIN",
                    "narrative": "Client Payment",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "transactionsOut": [{
                    "transactionId": "0000003B5",
                    "transactionCode": "CPOU",
                    "narrative": "Client Payment",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "totalIn": 0,
                "totalOut": 0
            },
            "charges": {
                "transactions": [{
                    "transactionId": "0000003B6",
                    "transactionCode": "PFOF",
                    "narrative": "Platform fee",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "total": 0
            },
            "income": {
                "transactions": [{
                    "transactionId": "0000003B7",
                    "transactionCode": "CDIV",
                    "narrative": "Dividend",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "amount": 10000
                }],
                "total": 0
            },
            "performance": {
                "transactionsRealised": [
                  {
                    "transactionId": "0000003B8",
                    "transactionCode": "SELL",
                    "narrative": "Sell of 100 units",
                    "postDate": "2018-01-16T11:53:26.556Z",
                    "valueDate": "2018-01-16T11:53:13.461Z",
                    "quantity": 100
                  }
                ],
                "positionsRetained": [
                    {
                        "isin": "GB00B019KW72",
                        "assetName": "J Sainsbury PLC",
                        "quantity": 20,
                        "bookValue": 49.76,
                        "currentValue": 50.18,
                        "growth": 0.42
                    },
                    {
                        "isin": "GB00B2PDGW16",
                        "assetName": "WH Smith PLC",
                        "quantity": -789,
                        "bookValue": -18487.19,
                        "currentValue": -18186.45,
                        "growth": 300.74
                    },
                    {
                        "isin": "LU0292097747",
                        "assetName": "db x-trackers FTSE All-Share UCITS ETF DR",
                        "quantity": -1447,
                        "bookValue": -5669.45,
                        "currentValue": -6024.58,
                        "growth": -355.13
                    },
                    {
                        "isin": "GB00B1VZ0M25",
                        "assetName": "Hargreaves Lansdown PLC",
                        "quantity": -1244,
                        "bookValue": -25048.44,
                        "currentValue": -25048.44,
                        "growth": 0
                    },
                    {
                        "isin": "IE00B0M63730",
                        "assetName": "iShares MSCI AC Far East ex-Japan UCITS ETF",
                        "quantity": -5,
                        "bookValue": -219.04,
                        "currentValue": -212.8,
                        "growth": 6.24
                    },
                    {
                        "isin": "IE00B14X4M10",
                        "assetName": "iShares MSCI North America UCITS ETF",
                        "quantity": 20,
                        "bookValue": -747.28,
                        "currentValue": 734.4,
                        "growth": 1481.68
                    },
                    {
                        "isin": "LU0292107645",
                        "assetName": "db x-trackers MSCI Emerging Markets Index UCITS ETF",
                        "quantity": 104,
                        "bookValue": 3927.46,
                        "currentValue": 3406,
                        "growth": -521.46
                    },
                    {
                        "isin": "IE00B42WWV65",
                        "assetName": "Vanguard UK Government Bond UCITS ETF",
                        "quantity": 21,
                        "bookValue": 494.97,
                        "currentValue": 469.56,
                        "growth": -25.41
                    },
                    {
                        "isin": "GB00B5YKQK23",
                        "assetName": "BlackRock UK D Acc",
                        "quantity": 25.0281,
                        "bookValue": 100,
                        "currentValue": 104.19,
                        "growth": 4.19
                    }
                ],
                "totalRealised": 100,
                "totalRetained": 891.27
            },
            "openingValue": 0,
            "closingValue": 155068.91
        }
    }
    

    The portfolio report shows activity for the specified client within a particular time period.

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/portfolio/report/<firmId>/<clientId>?type=Report&fromdate=2000-01-01T00:00:00Z&todate=2000-01-02T00:00:00Z

    URL Query Options

    Query Description
    type=Report Return a full report
    fromdate ISO formatted datetime from which to calculate the report data
    todate ISO formatted datetime to calculate the data before and not including

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    clientId The Seccl Id of the client.

    Response Data

    This returns the following data

    Field Description
    id The Seccl Id of the client
    firmId The firm Id we have created for you. It is used to segregate your data in a differ
    name The name of the client
    currency The main currency of the client. All portfolio level values will be in this currency
    openingValue The opening value of the portfolio
    closingValue The opening value of the portfolio
    payments Cash transactions received or paid out for any account the client has during the period
    charges Charges paid out from any client account during the period
    income Transactions showing income received during the period
    performance Realised and unrealised transactions for all client accounts during the period

    Errors

    An error structure will look like the following.

    {
      "error": {
        "errorMessage": "Something went wrong",
        "type": "DataValidation",
        "fieldErrors": [
          {
            "fieldName": "name",
            "errorMessage": "This must be at least 1",
            "type": "numericality"
          },
          {
            // Nested properties will be dot separated
            "fieldName": "address.postCode",
            "errorMessage": "This is not a valid postcode",
            "type": "format"
          },
          {
            // Properties within an array should be dot separated
            // and use [] brackets to point to index
            "fieldName": "orders[0].assetId",
            "errorMessage": "This asset does not exist",
            "type": "inclusion"
          }
        ]
      }
    }
    

    The Seccl API uses HTTP response codes to highlight errors. Detailed information describing the exact nature of the error will be returned in the response.

    Error Codes

    Code Meaning
    400 Bad Request -- Your request is invalid.
    403 Forbidden -- You are not allowed to access this route or data.
    404 Not Found -- The specified data record could not be found.
    412 Pre Condition Failed -- Your update request was for data that had been updated
    419 Authentication Timeout -- Your API token has expiered
    500 Internal Server Error -- We had a problem with our server. Try again later.

    Error Response Data

    Field Description
    type The type of error, for instance DataNotFound, DataValidationError
    errorMessage The specific error message
    fieldErrors An array of field level errors
    type - The type of the field level error, for instance numericality, format
    fieldName - The field name that has the error. This will be dot separated for nested errors and will have the following syntax for arrays arrayProperty[index].property
    errorMessage - The specific field error message

    Message

    Manage client messages, their data and their status.

    Get a count of unread messages

    To get a count of the messages unread from the client, use this code:

    curl -X GET \
      https://pfolio-api-staging.seccl.tech/message/stats/<firmId> \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/message/stats/<firmId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service

    Response Data

    The response data is an object that contains a unreadMessageCount field with the number of unread messages

    Get a client's messages

    To get all messages for the client, use this code:

    curl -X GET \
      https://pfolio-api-staging.seccl.tech/message/<firmId>?clientId=00A1234 \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": [
            {
                "id": "0000000002",
                "firmId": "P1IMX",
                "clientId": "00A1234",
                "messageType": "NEW_ACCOUNT",
                "read": false,
                "archived": false,
                "subject": "New Account",
                "payload": {
                    "body": "Congratulations, you have set up a new account!"
                },
                "created": "Tue May 08 2018 20:29:02 GMT+0000 (UTC)",
                "auditDetails": {
                    "updateDate": "2018-05-08T20:29:02.874Z",
                    "userFirmId": "P1IMX",
                    "userId": "Background",
                    "version": 1,
                    "application": "CommunicationsProcessor"
                },
                "updateId": "5af2088e8e0db3df4c2ed1fd"
            },
            {
                "id": "0000000003",
                "firmId": "P1IMX",
                "clientId": "00A1234",
                "messageType": "NEW_ACCOUNT",
                "read": false,
                "archived": false,
                "subject": "New Account",
                "payload": {
                    "body": "Congratulations, you have set up a new account!"
                },
                "created": "Tue May 08 2018 20:38:39 GMT+0000 (UTC)",
                "updateId": "5af20acf94b5923d11d6fe10"
            },
            {
                "id": "0000000KQH",
                "firmId": "P1IMX",
                "clientId": "00A1234",
                "messageType": "CLIENT_UPDATE",
                "read": false,
                "archived": false,
                "subject": "Profile Update",
                "payload": {
                    "body": "Your bank details have changed. Please check your profile to see more details of the change"
                },
                "created": "Tue May 29 2018 14:02:19 GMT+0000 (UTC)",
                "updateId": "5b0d5d6b83c16d771dac57f5"
            },
            {
                "id": "0000000KQJ",
                "firmId": "P1IMX",
                "clientId": "00A1234",
                "messageType": "ACCOUNT_UPDATE",
                "read": false,
                "archived": false,
                "subject": "Account Update",
                "payload": {
                    "body": "Your regular payments have changed. Please check your profile to see more details of the change"
                },
                "created": "Tue May 29 2018 14:13:16 GMT+0000 (UTC)",
                "updateId": "5b0d5ffc83c16d75d7ac57f6"
            },
            {
                "id": "0000000KQK",
                "firmId": "P1IMX",
                "clientId": "00A1234",
                "messageType": "ACCOUNT_UPDATE",
                "read": false,
                "archived": false,
                "subject": "Account Update",
                "payload": {
                    "body": "Your account node has changed. Please check your profile to see more details of the change"
                },
                "created": "Tue May 29 2018 15:00:49 GMT+0000 (UTC)",
                "updateId": "5b0d6b2180956886b936045c"
            }
        ],
        "meta": {
            "count": 5
        }
    }
    

    HTTP Request

    `GET https://pfolio-api-staging.seccl.tech/message/?clientId=?fromdate=2000-01-01T00:00:00Z&todate=2000-01-02T00:00:00Z'

    URL Query Options

    Query Description
    'fromdate' ISO formatted datetime from which to calculate the message data
    'todate' ISO formatted datetime to calculate the data before and not including

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    clientId The Seccl Id of the client

    Response Data

    The response data is an object that contains a data and a meta field

    Get a single message

    To get a single message by Id, use this code:

    curl -X GET \
      https://pfolio-api-staging.seccl.tech/message/P1IMX/0000000002 \
      -H "Content-Type: application/json"  \
      -H "api-token: yourtoken"
    

    This command returns JSON structured as follows:

    {
        "data": {
            "id": "0000000002",
            "firmId": "P1IMX",
            "clientId": "00A1234",
            "messageType": "NEW_ACCOUNT",
            "read": false,
            "archived": false,
            "subject": "New Account",
            "payload": {
                "body": "Congratulations, you have set up a new account!"
            },
            "created": "Tue May 08 2018 20:29:02 GMT+0000 (UTC)",
            "updateId": "5af2088e8e0db3df4c2ed1fd"
        }
    }
    

    HTTP Request

    GET https://pfolio-api-staging.seccl.tech/message/<firmId>/<messageId>

    URL Parameters

    Parameter Description
    firmId The firm Id we have created for you. It is used to segregate your data in a different database to other users of the service
    messageId The Id of the message

    Response Data

    The response data is an object that contains a data field