A Portfolio encapsulates a set of assets and aggregates their performance over time. This document will guide you on how to create, update and get ortfolio details.

Creating an Portfolio

To create an account:

Make a POST request to /portfolio

  curl --request POST \
    --url https://api.pipevest.com/v1/portfolio\
    --header 'Authorization: Bearer 123456' \
    --header 'Content-Digest: sha-512=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=:' \
    --header 'Content-Length: 18' \
    --header 'Content-Type: application/json' \
    --header 'Signature: sig1=:OTEyMjY4...A5NTNDMEQ=:' \
    --header 'Signature-Input: sig1=("Authorization" "Content-Digest" "Content-Length" "Content-Type" "X-Client-Id" "X-Idempotency-Key" "@method" "@target-uri" "@path" "@query");keyid="staging-pipevest-ed25519";created=1732893484;expires=1732893584' \
    --header 'X-Client-Id: 123456' \
    --header 'X-Idempotency-Key: 123456' \
    ...
    --data '{"customerId": 123456, "currency": "ZMW"}'

Updating Portfolios

If you need to change an portfolio’s details:

Make a PUT request to /portfolio

  curl --request PUT \
    --url https://api.pipevest.com/v1/portfolio\
    ...
    --data '{"portfolioId": 123456, "currency": "USD", "status": "ACTIVE"}'

Adding an asset to a Portfolio

Refer to Assets documentation to learn how to add an asset to a portfolio.

Retrieving Portfolios

Portfolios with an accountId were automatically created by the Pipevest system. Wherein there is no accountId, the Portfolio was manually created via the API and does not have an associated Account.

When requesting portfolio details you can do so either by getting:

  • A list of portfolio
  • An portfolio by a given Id

List of Portfolios

Make a GET request to /portfolio.

  curl --request GET \
    --url https://api.pipevest.com/v1/portfolio?customerId=123456\
    --header 'Authorization: Bearer 123456' \
    --header 'Signature: sig1=:OTEyMjY4...A5NTNDMEQ=:' \
    --header 'Signature-Input: sig1=("Authorization" "Content-Digest" "Content-Length" "Content-Type" "X-Client-Id" "X-Idempotency-Key" "@method" "@target-uri" "@path" "@query");keyid="staging-pipevest-ed25519";created=1732893484;expires=1732893584' \
    --header 'X-Client-Id: 123456' \
This endpoint can be paginated and sorted.

Portfolio by Id

Make a GET request to /portfolio/{portfolioId}

  curl --request GET \
    --url https://api.pipevest.com/v1/portfolio/123456\
    ...

Entity Reference

PropertyDefinition
portfolioIdUnique portfolio identifier
customerIdUnique customer identifier
currencyAssociated currency
investmentAmountThe total amount invested into an asset or group of assets
marketValueThe current market value of an asset or group of assets
performanceThe performance of all the assets under the portfolio
statusCurrent status of the portfolio
investmentTypeInvestment type associated with the account
createdAtCreated at unix timestamp
updatedAtUpdated at unix timestamp

Pipevest created Portfolios

Includes the additional properties:
PropertyDefinition
accountIdUnique account identifier

Status

NameDefinition
ACTIVEPortfolio is currently active and able to trade
SUSPENDEDPortfolio has been temporarily suspended, and is unable to trade.
CLOSEDPortfolio has been permanently prevented from trading

Webhook Subscriptions

SubscriptionDefinitionDomain
PORTFOLIOOnly events that deal with portfolioPortfolios
PORTFOLIO.CREATEDTriggered when a portfolio is createdPortfolios
PORTFOLIO.UPDATEDTriggered when a portfolio is updatedPortfolios