Ledgy’s GraphQL API Reference 👩‍💻👨‍💻

👋 Welcome to our API docs!

Contact

API Support

support@ledgy.com

API Endpoints
https://app.ledgy.com/graphql

Authentication

To get started with our API you’ll first need to retrieve your apiKey from the Ledgy app. To do that, head over to your company’s general settings page and click on "Reveal API key" in the danger zone card. Once you have that, you are ready to get started querying some data. Here’s a CLI example on how to do so:

curl --request POST \
--header 'content-type: application/json' \
--header 'Authorization: Bearer <apiKey>' \
--url 'https://app.ledgy.com/graphql' \
--data '{"query":"{ yourQuery }"}'

Rate limits

Our API has a rate limit of 20 requests every 5 seconds per company.

Queries

auth

Description

The auth operation is a basic interface designed for authentication purposes. The operation user can authenticate their credentials and obtain basic company information.

Response

Returns an Auth!

Example

Query
query auth {
  auth {
    companyId
    companyName
  }
}
Response
{
  "data": {
    "auth": {
      "companyId": 4,
      "companyName": "xyz789"
    }
  }
}

companyCaptable

Description

The companyCaptable operation is a Ledgy interface for one specific company. The operation user can retrieve cap table data about the queried company.

Response

Returns a CompanyCaptableResult!

Arguments
Name Description
groupBy - [CaptableGroupBy] Group the captable by one or multiple fields
date - Date Only transactions before this date will be retrieved. Defaults to today if none is provided

Example

Query
query companyCaptable(
  $groupBy: [CaptableGroupBy],
  $date: Date
) {
  companyCaptable(
    groupBy: $groupBy,
    date: $date
  ) {
    rows {
      ...CaptableRowFragment
    }
  }
}
Variables
{
  "groupBy": ["stakeholderName"],
  "date": "2007-12-03"
}
Response
{"data": {"companyCaptable": {"rows": [CaptableRow]}}}

companyTransactions

Description

The companyTransactions operation is a Ledgy interface for one specific company. The operation will retrieve transaction data about the queried company.

Response

Returns a CompanyTransactionsResult!

Arguments
Name Description
types - [TransactionType!] Types of transaction to be retrieved
date - Date Only transactions before this date will be retrieved. Defaults to today if none is provided

Example

Query
query companyTransactions(
  $types: [TransactionType!],
  $date: Date
) {
  companyTransactions(
    types: $types,
    date: $date
  ) {
    rows {
      ... on Convertible {
        ...ConvertibleFragment
      }
      ... on Grant {
        ...GrantFragment
      }
      ... on Transfer {
        ...TransferFragment
      }
    }
  }
}
Variables
{
  "types": ["convertible"],
  "date": "2007-12-03"
}
Response
{"data": {"companyTransactions": {"rows": [Convertible]}}}

portfolioCaptable

Description

The portfolioCaptable operation is a Ledgy portfolio-based interface for one specific portfolio company. The operation user can retrieve cap table data about the queried company.

Response

Returns a PortfolioCaptableResult!

Arguments
Name Description
companyId - String! Ledgy company ID for the queried cap table
groupBy - [CaptableGroupBy] Group the captable by one or multiple fields
date - Date Only transactions before this date will be retrieved. Defaults to today if none is provided

Example

Query
query portfolioCaptable(
  $companyId: String!,
  $groupBy: [CaptableGroupBy],
  $date: Date
) {
  portfolioCaptable(
    companyId: $companyId,
    groupBy: $groupBy,
    date: $date
  ) {
    rows {
      ...CaptableRowFragment
    }
  }
}
Variables
{
  "companyId": "xyz789",
  "groupBy": ["stakeholderName"],
  "date": "2007-12-03"
}
Response
{"data": {"portfolioCaptable": {"rows": [CaptableRow]}}}

portfolioPerformance

Description

The portfolioPerformance operation is a Ledgy portfolio-based interface. The operation user can retrieve data about the portfolio companies linked to an investment firm.

Response

Returns a PortfolioPerformanceResult!

Arguments
Name Description
date - Date Only investments before this date will be retrieved. Defaults to today if none is provided

Example

Query
query portfolioPerformance($date: Date) {
  portfolioPerformance(date: $date) {
    rows {
      ...PortfolioPerformanceRowFragment
    }
  }
}
Variables
{"date": "2007-12-03"}
Response
{
  "data": {
    "portfolioPerformance": {
      "rows": [PortfolioPerformanceRow]
    }
  }
}

portfolioTransactions

Description

The portfolioTransactions operation is a Ledgy portfolio-based interface for one specific portfolio company. The operation will retrieve transaction data about the queried company.

Response

Returns a PortfolioTransactionsResult!

Arguments
Name Description
companyId - String! Ledgy company ID for the queried cap table
types - [TransactionType!] Types of transaction to be retrieved
date - Date Only transactions before this date will be retrieved. Defaults to today if none is provided

Example

Query
query portfolioTransactions(
  $companyId: String!,
  $types: [TransactionType!],
  $date: Date
) {
  portfolioTransactions(
    companyId: $companyId,
    types: $types,
    date: $date
  ) {
    rows {
      ... on Convertible {
        ...ConvertibleFragment
      }
      ... on Grant {
        ...GrantFragment
      }
      ... on Transfer {
        ...TransferFragment
      }
    }
  }
}
Variables
{
  "companyId": "xyz789",
  "types": ["convertible"],
  "date": "2007-12-03"
}
Response
{
  "data": {
    "portfolioTransactions": {"rows": [Convertible]}
  }
}

Types

Address

Description

Address Object

Fields
Field Name Description
line1 - String First address line
line2 - String Second address line
postcode - String Postcode
city - String City
country - String Country
Example
{
  "line1": "Forchstrasse 60",
  "line2": "Attic",
  "postcode": "8008",
  "city": "Zurich",
  "country": "CH"
}

Auth

Description

Auth Object

Fields
Field Name Description
companyId - ID! Internal Ledgy company ID
companyName - String! Name of the company
Example
{
  "companyId": "4",
  "companyName": "xyz789"
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

CaptableGroupBy

Values
Enum Value Description

stakeholderName

Group by stakeholder

shareClassName

Group by share class

captableGroup

Group by Ledgy group

grantName

Group by grant
Example
"stakeholderName"

CaptableRow

Description

The cap table row is an aggregation of company transaction values and metadata. Each CaptableRow is an aggregation of transactions per CaptableGroupBy value. If no grouping parameter is provided it will default to stakeholderName.

Fields
Field Name Description
category - String A Ledgy classification of different transaction types, including transactions on different share classes, granted and grantable equity plans transactions, and convertible loans
group - String A Ledgy-custom grouping, including all assigned stakeholder groups, grantable equity plans transactions, and company transactions
stakeholderId - String A unique ID for the stakeholder
stakeholderName - String Full name of the stakeholder
stakeholderEmail - String Email of stakeholder
stakeholderType - String Type of stakeholder (i.e. natural vs legal)
stakeholderHrisIdentifier - String Unique identifier provided by an external HRIS (Human Resources Information System) and imported to Ledgy. Often used to sync data between Ledgy and the HR system
beneficiaryId - String A unique ID for the beneficiary
beneficiaryName - String Full name of the beneficiary
shareClassName - String Share class name
grantName - String Name of the grant
grantType - String Type of the grant
equityPlanName - String Name of the equity plan
ownershipPercentage - Float Percentage of ownership in the company (non-diluted)
dilutedPercentage - Float Percentage of ownership in the company (diluted)
issuedShares - Int Amount of issued shares
dilutedShares - Int Amount of diluted shares
dilutedGrantedShares - Int Amount of granted shares (shares equivalent)
grantedShares - Int Amount of granted shares
dilutedExercisedShares - Int Amount of exercised shares (shares equivalent)
exercisedShares - Int Amount of exercised shares
dilutedTerminatedShares - Int Amount of terminated shares (shares equivalent)
terminatedShares - Int Amount of terminated shares
vesting - Vesting Vesting object
currency - String Currency for monetary values in cap table (company currency)
strikePrice - Float Strike price
investment - Float Investment amount (monetary)
documentCount - Int Number of documents attached to transactions in the row
Example
{
  "category": "Preferred shares",
  "group": "Investors",
  "stakeholderId": "B34RtoyMrR6pvxTmo",
  "stakeholderName": "Peleton Capital",
  "stakeholderEmail": "abc123",
  "stakeholderType": "Legal",
  "stakeholderHrisIdentifier": "xyz789",
  "beneficiaryId": "xyz789",
  "beneficiaryName": "xyz789",
  "shareClassName": "xyz789",
  "grantName": "xyz789",
  "grantType": "abc123",
  "equityPlanName": "abc123",
  "ownershipPercentage": 27.4,
  "dilutedPercentage": 20.05,
  "issuedShares": 31415,
  "dilutedShares": 31415,
  "dilutedGrantedShares": 987,
  "grantedShares": 123,
  "dilutedExercisedShares": 987,
  "exercisedShares": 123,
  "dilutedTerminatedShares": 987,
  "terminatedShares": 987,
  "vesting": Vesting,
  "currency": "EUR",
  "strikePrice": 123.45,
  "investment": 42000000,
  "documentCount": 4
}

CompanyCaptableResult

Fields
Field Name Description
rows - [CaptableRow!]! An array of cap table rows
Example
{"rows": [CaptableRow]}

CompanyTransactionsResult

Description

Returns { rows: [Transaction!]! } (Transaction)

Fields
Field Name Description
rows - [Transaction!]!
Example
{"rows": [Convertible]}

Convertible

Fields
Field Name Description
transactionId - String A unique ID for the transaction
transactionNumber - Int A human readable number identifying each transaction in the UI
transactionType - TransactionType Type of transaction
date - Date Date of the transaction
lastUpdatedAt - Date Last time the transaction was modified
stakeholderId - String A unique ID for the stakeholder
stakeholderName - String Name of the stakeholder
stakeholderEmail - String Email of stakeholder
stakeholderType - String Type of stakeholder (i.e. natural vs legal)
stakeholderHrisIdentifier - String Unique identifier string provided by an external HRIS (Human Resources Information System) and imported to Ledgy. Often used to sync data between Ledgy and the HR system
currency - String Currency used in the transaction
investment - Float Amount invested (monetary)
interestRate - Float Interest rate
interestAccumulated - Float Interest accumulated since start date or issuance date
interestStartDate - Date Date at which interest starts being taken into account
dayBasis - Int Number of days per year for calculating daily interest (360 vs 365)
maturityDate - Date Date of maturity
cap - Float Valuation cap (monetary)
discount - Float Percent discount
payback - Boolean Whether the convertible will be paid back when triggered
Example
{
  "transactionId": "Z7RNoe68NjQdykibC",
  "transactionNumber": 987,
  "transactionType": "convertible",
  "date": "2020-07-08T00:00:00.000Z",
  "lastUpdatedAt": "2021-14-12T00:00:00.000Z",
  "stakeholderId": "B34RtoyMrR6pvxTmo",
  "stakeholderName": "Passionate Capital",
  "stakeholderEmail": "abc123",
  "stakeholderType": "legal",
  "stakeholderHrisIdentifier": "xyz789",
  "currency": "GBP",
  "investment": 1700000,
  "interestRate": 2.12,
  "interestAccumulated": 50299.18,
  "interestStartDate": "2020-09-08T00:00:00.000Z",
  "dayBasis": 365,
  "maturityDate": "2022-04-07T00:00:00.000Z",
  "cap": 42500000,
  "discount": 5,
  "payback": false
}

CurrencyTransaction

Fields
Field Name Description
currency - String Currency used in the transaction
Possible Types
CurrencyTransaction Types

Convertible

Grant

Transfer

Example
{"currency": "xyz789"}

Date

Description

The Date scalar type is a custom scalar. In the JSON response it does not appear as a Javascript Date Object, but a String representing an ISO 8601-formatted date (i.e. yyyy-MM-ddThh:mm:ss.msZ).

Example
"2007-12-03"

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45

Grant

Fields
Field Name Description
transactionId - String A unique ID for the transaction
transactionNumber - Int A human readable number identifying each transaction in the UI
transactionType - TransactionType Type of transaction
date - Date Date of the transaction
lastUpdatedAt - Date Last time the transaction was modified
grantType - String Type of grant (option/phantom/warrant/stock from pool)
stakeholderId - String A unique ID for the stakeholder
stakeholderName - String Name of the stakeholder
stakeholderEmail - String Email of stakeholder
beneficiaryId - String A unique ID for the beneficiary stakeholder
beneficiaryName - String Name of the beneficiary stakeholder
stakeholderType - String Type of stakeholder (i.e. natural vs legal)
stakeholderHrisIdentifier - String Unique identifier string provided by an external HRIS (Human Resources Information System) and imported to Ledgy. Often used to sync data between Ledgy and the HR system
currency - String Currency used in the transaction
granted - Int Granted amount
dilutedGranted - Int Granted amount (shares equivalent)
diluted - Int Diluted shares
grantVested - Int Grant vested
dilutedGrantVested - Int Grant vested (shares equivalent)
strikePrice - Float Strike price
sharePrice - Float Purchase price
expiryDate - Date Expiry date
vesting - Vesting Vesting object
equityPlanName - String Name of the equity plan the grant is from
valueAtTransactionDate - Float Value of the grant at the time of granting
grantValue - Float Value of the grant at the latest valuation of the company
Example
{
  "transactionId": "u3YW7J6sXStnjpt5C",
  "transactionNumber": 987,
  "transactionType": "grant",
  "date": "2018-02-25T00:00:00.000Z",
  "lastUpdatedAt": "2021-14-12T00:00:00.000Z",
  "grantType": "warrant",
  "stakeholderId": "B34RtoyMrR6pvxTmo",
  "stakeholderName": "Marie Curious",
  "stakeholderEmail": "xyz789",
  "beneficiaryId": "J42RtyyLxR3pyhAca",
  "beneficiaryName": "Alan Turning",
  "stakeholderType": "natural",
  "stakeholderHrisIdentifier": "xyz789",
  "currency": "EUR",
  "granted": 3142,
  "dilutedGranted": 123,
  "diluted": 123,
  "grantVested": 123,
  "dilutedGrantVested": 123,
  "strikePrice": 0.1,
  "sharePrice": 0.05,
  "expiryDate": "2031-05-15T08:55:40.320Z",
  "vesting": Vesting,
  "equityPlanName": "Option Plan",
  "valueAtTransactionDate": 25000,
  "grantValue": 1500000
}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
"4"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
123

PortfolioCaptableResult

Fields
Field Name Description
rows - [CaptableRow!]! An array of cap table rows
Example
{"rows": [CaptableRow]}

PortfolioPerformanceResult

Fields
Field Name Description
rows - [PortfolioPerformanceRow!]! An array of investment performance table rows
Example
{"rows": [PortfolioPerformanceRow]}

PortfolioPerformanceRow

Description

The investment performance row is an aggregation of performance values and company metadata. Each PortfolioPerformanceRow takes into account values for all of the transactions in which the portfolio stakeholder is involved. Please note: all monetary values 💰 in this type are converted to portfolio currency.

Fields
Field Name Description
address - Address Address Object
companyName - String Name of the company
companyId - ID Internal Ledgy company ID
country - String Country of incorporation
currency - String Currency for all monetary values in investments performance
description - String Description of the company
industry - String Main industry of the company
irr - Float Internal Rate of Return (%)
investment - Float Investment in the company (monetary)
lastUpdatedAt - Date Last time a transaction was published by the company
multiple - Float Proceeds plus value, divided by invested
proceeds - Float Earnings from selling some or all shares, repayments of convertible loans, or other payments by the company (monetary)
value - Float Value of all currently owned shares at their latest share price, including outstanding convertible loans (monetary)
website - String Company website
Example
{
  "address": Address,
  "companyName": "Ledgy AG",
  "companyId": "4xyvEG8wR5qMYXnyy",
  "country": "US",
  "currency": "USD",
  "description": "The coolest company out there",
  "industry": "Fintech",
  "irr": 42,
  "investment": 5000000,
  "lastUpdatedAt": "2007-12-03",
  "multiple": 8.6,
  "proceeds": 1000000,
  "value": 42000000,
  "website": "https://ledgy.com"
}

PortfolioTransactionsResult

Description

Returns { rows: [Transaction!]! } (Transaction)

Fields
Field Name Description
rows - [Transaction!]!
Example
{"rows": [Convertible]}

StakeholderTransaction

Fields
Field Name Description
stakeholderId - String A unique ID for the stakeholder
stakeholderName - String Name of the stakeholder
stakeholderEmail - String Email of stakeholder
stakeholderType - String Type of stakeholder (i.e. natural vs legal)
stakeholderHrisIdentifier - String Unique identifier string provided by an external HRIS (Human Resources Information System) and imported to Ledgy. Often used to sync data between Ledgy and the HR system
Possible Types
StakeholderTransaction Types

Convertible

Grant

Transfer

Example
{
  "stakeholderId": "xyz789",
  "stakeholderName": "abc123",
  "stakeholderEmail": "abc123",
  "stakeholderType": "abc123",
  "stakeholderHrisIdentifier": "abc123"
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

Transaction

Types
Union Types

Convertible

Grant

Transfer

Example
Convertible

TransactionBase

Fields
Field Name Description
transactionId - String A unique ID for the transaction
transactionNumber - Int A human readable number identifying each transaction in the UI
transactionType - TransactionType Type of transaction
date - Date Date of the transaction
lastUpdatedAt - Date Last time the transaction was modified
Possible Types
TransactionBase Types

Convertible

Grant

Transfer

Example
{
  "transactionId": "xyz789",
  "transactionNumber": 123,
  "transactionType": "convertible",
  "date": "2007-12-03",
  "lastUpdatedAt": "2007-12-03"
}

TransactionType

Values
Enum Value Description

convertible

Convertible loan

grant

Equity plan grant

transfer

Transfer
Example
"convertible"

Transfer

Fields
Field Name Description
transactionId - String A unique ID for the transaction
transactionNumber - Int A human readable number identifying each transaction in the UI
transactionType - TransactionType Type of transaction
date - Date Date of the transaction
lastUpdatedAt - Date Last time the transaction was modified
stakeholderId - String A unique ID for the stakeholder receiving equity
stakeholderName - String Name of the stakeholder receiving equity
stakeholderEmail - String Email of stakeholder
stakeholderType - String Type of stakeholder (i.e. natural vs legal)
stakeholderHrisIdentifier - String Unique identifier string provided by an external HRIS (Human Resources Information System) and imported to Ledgy. Often used to sync data between Ledgy and the HR system
fromStakeholderId - String A unique ID for the stakeholder transferring equity
fromStakeholderName - String Name of the stakeholder transferring equity
currency - String Currency used in the transaction
proceeds - Float Proceeds
sharePrice - Float Transfer price
diluted - Int Diluted shares
issued - Int Issued shares
Example
{
  "transactionId": "abc123",
  "transactionNumber": 123,
  "transactionType": "convertible",
  "date": "2007-12-03",
  "lastUpdatedAt": "2007-12-03",
  "stakeholderId": "xyz789",
  "stakeholderName": "abc123",
  "stakeholderEmail": "abc123",
  "stakeholderType": "abc123",
  "stakeholderHrisIdentifier": "abc123",
  "fromStakeholderId": "abc123",
  "fromStakeholderName": "xyz789",
  "currency": "xyz789",
  "proceeds": 123.45,
  "sharePrice": 987.65,
  "diluted": 123,
  "issued": 123
}

Vesting

Fields
Field Name Description
type - String Vesting type (simple, custom, performance)
startDate - Date Vesting start date
duration - Int Full duration of vesting, in months
interval - Int Vesting interval, in months
cliff - Int Vesting cliff, in months
rounding - String How vesting is rounded at each interval (down, up, nearest)
vestingOn - VestingOnType Select the day of the month on which the grant should vest. This only affects dates after the cliff
Example
{
  "type": "simple",
  "startDate": "2021-03-02T00:00:00.000Z",
  "duration": 48,
  "interval": 1,
  "cliff": 6,
  "rounding": "nearest",
  "vestingOn": "grantDate"
}

VestingOnType

Description

Vesting Object

Values
Enum Value Description

grantDate

Grant date

startDate

Start date

firstOfMonth

First day of the month

lastOfMonth

Last day of the month
Example
"grantDate"