Portfolios API

Use the Portfolio API to create and manage your Portfolios.

Create a Portfolio

POST /v1/organizations/{{id}}/ledgers/{{id}}/portfolio

Use this endpoint to create a Portfolio.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Request body
{
  "entityId": "1b8037e8-459d-4bf4-a1f9-0d075b500910",
  "name": "My portfolio",
  "status": {
    "code": "available",
    "description": null
  },
  "metadata": {
    "anyKey": "anyValue"
  }
}

Response codes

{
  "id": "298c1e79-00b8-4f4b-a045-dd7300213b7a",
  "entityId": "1b8037e8-459d-4bf4-a1f9-0d075b500910",
  "ledgetId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "name": "My portfolio",
  "status": {
    "code": "available",
    "description": null
  },
  "metadata": {
    "anyKey": "anyValue"
  },
  "createdAt": "2024-02-08T16:59:31+0300",
  "updatedAt": "2024-02-08T16:59:31+0300",
  "deletedAt": null
}

Retrieve all Portfolios

GET /v1/organizations/{{id}}/ledgers/{{id}}/portfolios

Use this endpoint to retrieve the information about all Portfolios in the Ledger.

Headers

NameValue

Authorization

Bearer <token>

Query parameters

NameTypeDescription

status

Array

An object containing information about the portfolio status.

entityId

String (UUID)

The unique identifier of the Entity.

Response codes

[
  {
    "id": "298c1e79-00b8-4f4b-a045-dd7300213b7a",
    "entityId": "1b8037e8-459d-4bf4-a1f9-0d075b500910",
    "ledgerId": "c3a89e04-b1cd-4df8-a5f9-0bb077e07e6d",
    "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
    "name": "The new name of the portfolio",
    "status": {
      "code": "ACTIVE",
      "description": null
    },
    "metadata": {
      "cfo": "Nick Szabo"
    },
    "createdAt": "2024-02-08T16:59:31+0300",
    "updatedAt": "2024-02-08T16:59:31+0300",
    "deletedAt": null
  },
  {
    "id": "6e796ab8-d18d-44f5-943c-2bcdacb4c61a",
    "entityId": "a8079c89-ce45-4a39-9b8b-6bc95439be1f",
    "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
    "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
    "name": "Thomas Shelby's pocket",
    "status": {
      "code": "ACTIVE",
      "description": null
    },
    "allowSending": true,
    "allowReceiving": true,
    "metadata": null,
    "createdAt": "2024-01-21T09:23:04+0300",
    "updatedAt": "2024-01-21T09:23:04+0300",
    "deletedAt": null
  }
]

Retrieve Portfolio by id

GET /v1/organizations/{{id}}/ledgers/{{id}}/portfolios/{{id}}

Use this endpoint to retrieve the information of a specific Portfolio.

Headers

NameValue

Authorization

Bearer <token>

Response codes

{
  "id": "298c1e79-00b8-4f4b-a045-dd7300213b7a",
  "entityId": "1b8037e8-459d-4bf4-a1f9-0d075b500910",
  "ledgerId": "c3a89e04-b1cd-4df8-a5f9-0bb077e07e6d",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "name": "The new name of the portfolio",
  "status": {
    "code": "ACTIVE",
    "description": null
  },
  "metadata": {
    "cfo": "Nick Szabo"
  },
  "createdAt": "2024-02-08T16:59:31+0300",
  "updatedAt": "2024-02-08T16:59:31+0300",
  "deletedAt": null
}

Update a Portfolio

PATCH /v1/organizations/{{id}}/ledgers/{{id}}/portfolios/{{id}}

Use this endpoint to edit and update the information of a specific Portfolio. When you update a Portfolio, the following fields can be edited:

  • name

  • status

  • productId

  • metadata

When updating the metadata object, all previous key-value pairs must be included in the update, or they will be removed.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Request body
{
  "name": "The new name of the portfolio",
  "status": {
    "code": "BLOCKED",
    "description": "AML"
  },
  "metadata": {
    "cfo": "Nick Szabo"
  }
}

Response codes

{
  "id": "298c1e79-00b8-4f4b-a045-dd7300213b7a",
  "entityId": "1b8037e8-459d-4bf4-a1f9-0d075b500910",
  "ledgerId": "c3a89e04-b1cd-4df8-a5f9-0bb077e07e6d",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "name": "The new name of the portfolio",
  "status": {
    "code": "BLOCKED",
    "description": "AML"
  },
  "metadata": {
    "cfo": "Nick Szabo"
  },
  "createdAt": "2024-02-08T16:59:31+0300",
  "updatedAt": "2024-02-08T16:59:31+0300",
  "deletedAt": null
}

Delete a Portfolio

DELETE /v1/organizations/{{id}}/ledgers/{{id}}/portfolios/{{id}}

Use this endpoint to deactivate a specific Portfolio.

Headers

NameValue

Authorization

Bearer <token>

Response codes

Last updated