Skip to content

Instantly share code, notes, and snippets.

@kosmakoff
Last active November 4, 2019 11:56
Show Gist options
  • Save kosmakoff/f833181e487008b13f9f092a11527a97 to your computer and use it in GitHub Desktop.
Save kosmakoff/f833181e487008b13f9f092a11527a97 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Holdings API
version: 1.0.0
description: Holdings API
contact:
name: Oleg Kosmakov
email: oleg.kosmakov@dataart.com
paths:
"/v1/holdings/{id}":
get:
parameters:
- example: INV-123456
name: id
schema:
type: string
in: path
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetHoldingResponse"
description: Holding details.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
"404":
description: No holding with such ID.
security:
- BearerAuth: []
operationId: getHolding
summary: Get Holding details.
parameters:
- examples:
Generic Investment ID:
value: INV-123456
name: id
description: Investment ID
schema:
type: string
in: path
required: true
/v1/holdings:
get:
parameters:
- name: page.index
description: >-
The index of the requested page. If this parameter is not specified the default value
is used (0).
schema:
type: integer
in: query
- name: page.size
description: >-
The size of the requested page. If this parameter is not specified the default value
is used (10).
schema:
type: integer
in: query
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetHoldingsResponse"
description: List of holdings.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Malformed request.
security:
- BearerAuth: []
operationId: getHoldings
summary: Returns a subset of Holdings related to a specified Client.
/v1/assets:
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PostAssetRequest"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/PostAssetResponse"
description: New Asset was created.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
security:
- BearerAuth: []
operationId: postAsset
summary: Creates new Asset.
"/v1/assets/{id}":
get:
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetAssetResponse"
description: Asset corresponding to given ID.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/Empty"
description: Asset with given ID was not found.
security:
- BearerAuth: []
operationId: getAsset
summary: Get Asset by ID.
patch:
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JsonPatch"
examples:
Change Assets Sponsor:
value:
- op: replace
path: /sponsor
value: FFR
required: true
responses:
"204":
description: Asset was successfully updated.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/Empty"
description: Asset with given ID was not found.
security:
- BearerAuth: []
operationId: patchAsset
summary: Updates Asset's properties.
parameters:
- examples:
Asset ID:
value: AST-123456
name: id
description: Asset ID.
schema:
type: string
in: path
required: true
/v1/investments:
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PostInvestmentRequest"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/PostInvestmentResponse"
description: New Investment was created.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
security:
- BearerAuth: []
operationId: postInvestment
summary: Creates new Investment.
"/v1/investments/{id}":
get:
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetInvestmentResponse"
description: Investment corresponding to given ID.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
"404":
description: Investment with given ID was not found.
security:
- BearerAuth: []
operationId: getInvestment
summary: Get Investment by ID.
patch:
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JsonPatch"
examples:
Change Asset ID:
value:
- op: replace
path: /asset_id
value: AST-987654
required: true
responses:
"204":
description: Investment was successfully updated.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request validation failed
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/Empty"
description: Investment with given ID was not found.
security:
- BearerAuth: []
operationId: patchInvestment
summary: Updates Investment's properties.
parameters:
- examples:
Generic Investment ID:
value: INV-123456
name: id
schema:
type: string
in: path
required: true
"/v1/liquidity_requests/{id}":
get:
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetLiquidityRequestResponseBody"
description: Liquidity Request exist with given ID.
"404":
description: Liquidity Request with given ID not found.
operationId: getLiquidityRequest
summary: Get Liquidity Request by its ID
patch:
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JsonPatch"
required: true
responses:
"204":
content:
application/json:
schema:
$ref: "#/components/schemas/Empty"
description: Update succeeded.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request body is malformed.
"404":
description: Liquidity Request with given ID not found.
operationId: updateLiquidityRequest
summary: Update Liquidity Request properties
parameters:
- examples:
Generic Liquidity Request ID:
value: LIQ-123456
name: id
description: Liquidity Request ID.
schema:
type: string
in: path
required: true
/v1/liquidity_requests:
get:
parameters:
- name: asdf
description: ""
schema: {}
in: query
- name: "page[index]"
description: >-
The index of the requested page. If this parameter is not specified the default value
is used (0).
schema:
type: integer
in: query
- name: "page[size]"
description: >-
The size of the requested page. If this parameter is not specified the default value
is used (10).
schema:
type: integer
in: query
- name: "sort[field]"
description: Specifies the field for sorting.
schema:
enum:
- investment_id
- status
- is_active
- bottom_up_pricing
- barq_pricing
- top_down_pricing
type: string
in: query
- name: "sort[direction]"
description: >-
Specifies the order of sorting. If this parameter is not specified the default value
is used (asc).
schema:
enum:
- asc
- desc
type: string
in: query
- name: "filter[0][field]"
description: Specifies the field for filtering.
schema:
enum:
- investment_id
- status
- is_active
- bottom_up_pricing
- barq_pricing
- top_down_pricing
type: string
in: query
- name: "filter[0][operator]"
schema:
description: Specifies the operator for filtering.
enum:
- equal
- not_equal
- greater_than
- greater_than_or_equal
- less_than
- less_than_or_equal
- starts_with
type: string
in: query
- name: "filter[0][value]"
description: Specifies the value for filtering.
schema:
type: string
in: query
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetLiquidityRequestsResponseBody"
examples:
Typical response:
value:
total: 83
page:
index: 4
size: 2
items:
- id: LIQ-000237
investment_id: INV-897654
status: commitment
is_active: true
account-id: ACC-854952
created_at: "2019-09-17T13:45:00"
- id: LIQ-000222
investment_id: INV-456789
status: proposal
is_active: false
account-id: ACC-285639
created_at: "2019-09-27T11:15:00"
description: List of Liquidity Requests matching the query conditions.
operationId: getLiquidityRequests
summary: List Liquidity Requests
description: Common filtering is supported.
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PostLiquidityRequestRequestBody"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/PostLiquidityRequestResponseBody"
description: Liquidity Request successfully created.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Request body is malformed.
operationId: createLiquidityRequest
summary: Create new Liquidity Request
/v1/liquidity_request_counts:
get:
parameters:
- examples:
Account IDs list:
value: "ACC-014824,ACC-876120"
name: accounts
description: List coma separated list of account IDs
schema: {}
in: query
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GetLiquidityRequestCountsResponse"
description: Liquidity Requests counts mapped to account IDs
operationId: getLiquidityRequestCounts
summary: Get count of Liquidity Requests for given accounts
components:
schemas:
PostLiquidityRequestResponseBody:
title: Root Type for PostLiquidityRequestResponseBody
description: ""
type: object
properties:
id:
type: string
example:
id: LIQ-123456
Error:
type: object
properties:
code:
type: string
example: VALIDATION_CODE
message:
type: string
example: Validation message
fields:
minProperties: 1
type: object
additionalProperties: {}
example:
field1: Error in field 1
field2: Error in Field 2
GetLiquidityRequestsItem:
description: ""
required:
- id
- is_active
- investment_id
- status
- client_id
- created_at
type: object
properties:
id:
type: string
investment_id:
type: string
status:
enum:
- verification
- valuation
- commitment
- proposal
- funded
type: string
is_active:
type: boolean
client_id:
description: ""
type: string
created_at:
format: date-time
description: ""
type: string
example:
id: LIQ-001987
investment_id: INV-000123
client_id: 9c4b91b9-15fe-45f9-a0d9-232350f01687
status: verification
is_active: true
GetLiquidityRequestsResponseBody:
description: ""
required:
- total
- page
- items
type: object
properties:
total:
description: ""
type: integer
page:
$ref: "#/components/schemas/Page"
description: ""
items:
description: ""
type: array
items:
$ref: "#/components/schemas/GetLiquidityRequestsItem"
GetHoldingResponse:
title: Existing holding details.
required:
- asset
- investment
type: object
properties:
asset:
$ref: "#/components/schemas/HoldingAssetProjection"
investment:
$ref: "#/components/schemas/HoldingInvestmentProjection"
Page:
title: Page Info
type: object
properties:
index:
type: integer
size:
type: integer
GetHoldingsResponse:
title: GetHoldingsResponse
required:
- page
- total
- items
type: object
properties:
total:
type: integer
page:
$ref: "#/components/schemas/Page"
items:
type: array
items:
$ref: "#/components/schemas/HoldingGridProjection"
HoldingGridProjection:
title: A high-level description of the holding.
required:
- account_id
type: object
properties:
investment_id:
description: "Format: INV-XXXXXX."
type: string
example: INV-123456
asset_id:
description: "Format: AST-XXXXXX."
type: string
example: AST-123456
sponsor:
type: string
example: KKR
fund_name:
type: string
example: KKR8
status:
enum:
- in_portfolio
- in_trust
- prior_investment
type: string
account_id:
description: ""
type: string
example:
investment_id: INV-049857
asset_id: AST-852147
account_id: ACC-753951
sponsor: Sponsor Name
fund_name: Fund Name
status: prior_investment
PostAssetRequest:
description: ""
required:
- sponsor
- fund_name
type: object
properties:
parent_type:
description: ""
enum:
- private_equity
- venture_capital
- leveraged_buyouts
- mezzanine
- special_situations_and_distressed
- hedge_funds
- private_real_estate
- not_tradable_bdc
- natural_resources
- life_settlements
type: string
sub_type:
description: ""
enum:
- fund
- fund_of_funds
- not_tradable_reit
- private_fund
type: string
sponsor:
description: ""
type: string
fund_name:
description: ""
type: string
vintage:
description: "A year, 4 digit string."
type: string
fund_size:
format: double
description: ""
type: number
currency:
description: ""
type: string
stated_fund_life:
description: ""
type: integer
PostAssetResponse:
title: Root Type for PostAssetResponseBody
description: ""
type: object
properties:
id:
description: Asset ID
type: string
example:
id: AST-123456
PostInvestmentRequest:
description: ""
required:
- client_id
- asset_id
- status
- is_active
type: object
properties:
client_id:
description: ""
type: string
asset_id:
description: ""
type: string
commitment_investment_amount:
format: double
description: ""
type: number
investment_share_amount:
description: ""
type: integer
nav_available:
format: double
description: ""
type: number
as_of_date:
format: date-time
description: ""
type: string
capital_calls_to_date:
format: double
description: ""
type: number
distributions_received_to_date:
format: double
description: ""
type: number
status:
description: ""
enum:
- in_portfolio
- in_trust
- prior_investment
type: string
is_active:
description: ""
type: boolean
PostInvestmentResponse:
title: Root Type for PostInvestmentResponseBody
description: ""
type: object
properties:
id:
description: Investment ID
type: string
example:
id: INV-123456
GetAssetResponse:
description: ""
required:
- sponsor
- fund_name
- id
type: object
properties:
parent_type:
description: ""
enum:
- private_equity
- venture_capital
- leveraged_buyouts
- mezzanine
- special_situations_and_distressed
- hedge_funds
- private_real_estate
- not_tradable_bdc
- natural_resources
- life_settlements
type: string
sub_type:
description: ""
enum:
- fund
- fund_of_funds
- not_tradable_reit
- private_fund
type: string
sponsor:
description: ""
type: string
fund_name:
description: ""
type: string
vintage:
description: "A year, 4 digit string."
type: string
fund_size:
format: double
description: ""
type: number
currency:
description: ""
type: string
stated_fund_life:
description: ""
type: integer
id:
description: Asset ID
type: integer
Empty:
title: Root Type for Ampty
description: ""
type: object
example: {}
JsonPatch:
title: Root Type for JsonPatch
description: ""
required:
- op
- path
type: object
properties:
op:
enum:
- replace
- add
- remove
type: string
path:
type: string
value:
type: string
example:
op: replace
path: /name
value: New Title
GetInvestmentResponse:
description: ""
required:
- account_id
- asset_id
- status
- is_active
- id
type: object
properties:
asset_id:
description: ""
type: string
example: AST-123456
commitment_investment_amount:
format: double
description: ""
type: number
investment_share_amount:
description: ""
type: integer
nav_available:
format: double
description: ""
type: number
as_of_date:
format: date-time
description: ""
type: string
capital_calls_to_date:
format: double
description: ""
type: number
distributions_received_to_date:
format: double
description: ""
type: number
status:
description: ""
enum:
- in_portfolio
- in_trust
- prior_investment
type: string
is_active:
description: ""
type: boolean
id:
description: Investment ID.
type: string
account_id:
description: ""
type: string
example:
id: INV-012874
asset_id: AST-001234
commitment_investment_amount: 9.73
investment_share_amount: 96
nav_available: 26.11
as_of_date: "2018-02-10T09:30Z"
capital_calls_to_date: 58.81
distributions_received_to_date: 50.23
status: prior_investment
is_active: true
account_id: ACC-000321
HoldingAssetProjection:
title: Asset details
required:
- name
- id
type: object
properties:
id:
description: Asset ID with prefix.
type: string
parent_type:
enum:
- private_equity
- venture_capital
- leveraged_buyouts
- mezzanine
- special_situations_and_distressed
- hedge_funds
- private_real_estate
- ntbdc
- natural_resources
- life_settlements
type: string
sub_type:
enum:
- fund
- fund_of_funds
- nt_reit
- private_fund
type: string
sponsor:
type: string
example: KKR
fund_name:
type: string
example: KKR8
vintage:
type: string
example: "2014"
fund_size:
format: double
type: number
example: "1234567890123.00"
currency:
type: string
example: USD
stated_fund_life:
type: integer
example: 10
HoldingInvestmentProjection:
title: Investment details
type: object
properties:
id:
description: Investment ID with prefix.
type: string
example: INV-123456
client_id:
format: uuid
description: Id of the Client that owns the Investment
type: string
example: 388b1e6e-ba3e-4bf5-b165-0a6354dfe271
commitment_investment_amount:
format: double
type: number
example: "1234567890123.00"
investment_share_amount:
type: integer
example: 20
nav_available:
format: double
type: number
example: "3000.21"
as_of_date:
format: date
type: string
example: "2006-07-24T00:00:00.000Z"
capital_calls_to_date:
format: double
type: number
example: "1234567890123.00"
distributions_received_to_date:
format: double
type: number
example: "1234567890123.00"
distributions_received_total:
format: double
type: number
example: "1234567890123.00"
status:
enum:
- in_portfolio
- in_trust
- prior_investment
type: string
is_active:
type: boolean
GetLiquidityRequestResponseBody:
description: ""
required:
- id
- is_active
- status
- created_at
- holdings
type: object
properties:
id:
type: string
status:
enum:
- verification
- valuation
- commitment
- proposal
- funded
type: string
is_active:
type: boolean
created_at:
format: date-time
description: ""
type: string
bottom_up_pricing:
format: double
description: ""
type: number
barq_pricing:
format: double
description: ""
type: number
top_down_pricing:
format: double
description: ""
type: number
final_advance_rate:
format: double
description: ""
type: number
holdings:
description: ""
type: array
items:
$ref: "#/components/schemas/HoldingGridProjection"
example:
id: LIQ-001987
created_at: "2019-10-10T16:53:46"
status: verification
is_active: true
bottom_up_pricing: 123.45
barq_pricing: 100500
top_down_pricing: 42.99
final_advance_rate: 45
holdings:
- investment_id: INV-049857
asset_id: AST-852147
account_id: ACC-753951
sponsor: Sponsor Name
fund_name: Fund Name
status: prior_investment
PostLiquidityRequestRequestBody:
title: Root Type for PostLiquidityRequestBody
description: ""
required:
- is_active
- investment_ids
- status
type: object
properties:
status:
enum:
- verification
- valuation
- commitment
- proposal
- funded
type: string
is_active:
type: boolean
bottom_up_pricing:
format: double
type: number
barq_pricing:
format: double
type: number
top_down_pricing:
format: double
type: number
final_advance_rate:
format: double
type: number
investment_ids:
description: List of investment IDs.
type: array
items:
type: string
example:
investment_ids:
- INV-000123
- INV-000125
status: verification
is_active: true
bottom_up_pricing: 123.45
barq_pricing: 100500
top_down_pricing: 42.99
final_advance_rate: 45
GetLiquidityRequestCountsResponse:
title: Root Type for GetLiquidityRequestCountsResponse
description: ""
type: object
properties:
counts:
type: object
properties:
ACC-012345:
format: int32
type: integer
ACC-948528:
format: int32
type: integer
example:
counts:
ACC-012345: 4
ACC-948528: 21
securitySchemes:
BearerAuth:
scheme: bearer
type: http
security:
- BearerAuth: []
tags:
- name: Requirements documents
externalDocs:
description: Find relevant requirement documents here
url: "https://conf.dataart.com/display/BEN/FG02+Client+Portal+-+Portfolio+Management"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment