Spiko Accounting positions API

The Accounting positions API from Spiko — 5 operation(s) for accounting positions.

OpenAPI Specification

spiko-accounting-positions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Spiko Distributor Account transactions Accounting positions API
  version: v0
  description: The Distributor API allows third parties like SaaS providers, fintechs or Web3 companies to distribute the Spiko Funds to their customers. With this API, you can programmatically manage investors, send subscription and redemption orders, and access real-time portfolio information.
servers:
- url: https://distributor-api.spiko.io
  description: Production Server
- url: https://distributor-api.preprod.spiko.io
  description: Pre-production Server
security: []
tags:
- name: Accounting positions
paths:
  /v0/accounting-positions/history:
    get:
      tags:
      - Accounting positions
      operationId: accountingPositions.getAccountingPositionsHistory
      parameters:
      - name: investorId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: shareClassId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: from
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: to
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      security:
      - basicAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                  - day
                  - status
                  - investorId
                  - shareClassId
                  - accountIds
                  - sharesHoldings
                  - holdings
                  - subscriptions
                  - redemptions
                  - transfers
                  - yield
                  - realizedGain
                  - transferredGain
                  - totalUnrealizedGain
                  properties:
                    day:
                      type: string
                      title: Day
                      description: a day in ISO format "YYYY-MM-DD"
                    status:
                      type: string
                      enum:
                      - nav
                      - noNav
                    investorId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    shareClassId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    accountIds:
                      type: array
                      minItems: 1
                      items:
                        type: string
                        description: a Universally Unique Identifier
                        format: uuid
                    sharesHoldings:
                      $ref: '#/components/schemas/NonNegativeBigint'
                    holdings:
                      $ref: '#/components/schemas/NonNegativeAmount'
                    subscriptions:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/NonNegativeAmount'
                        total:
                          $ref: '#/components/schemas/NonNegativeAmount'
                      additionalProperties: false
                    redemptions:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/NonNegativeAmount'
                        total:
                          $ref: '#/components/schemas/NonNegativeAmount'
                      additionalProperties: false
                    transfers:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    yield:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    realizedGain:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    transferredGain:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    totalUnrealizedGain:
                      $ref: '#/components/schemas/Amount'
                  additionalProperties: false
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpApiDecodeError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/Unauthorized'
                - $ref: '#/components/schemas/DistributorAuthenticationError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
      description: "\n**Retrieve detailed accounting positions (midnight to midnight UTC) for an investor in a specific share class.**\n\nReturns a chronological list of positions within the specified date range, including:\n- Holdings (in shares and in currency);\n- Daily and total subscriptions, redemptions, and transfers;\n- Realized and unrealized gains;\n- Daily and total yields.\n        "
      summary: Get accounting positions
  /v0/accounting-positions/account-statement:
    get:
      tags:
      - Accounting positions
      operationId: accountingPositions.downloadAccountStatement
      parameters:
      - name: investorId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: shareClassId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: from
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: to
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: locale
        in: query
        schema:
          $ref: '#/components/schemas/LocaleLanguage'
        required: true
      security:
      - basicAuth: []
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/HttpApiDecodeError'
                - $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/Unauthorized'
                - $ref: '#/components/schemas/DistributorAuthenticationError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
      description: "\n  **Download an account statement related to an investor and a share class between two dates.**\n\n  - The account statement will be a pdf file.\n            "
      summary: Download account statement
  /accounting-positions/history:
    get:
      tags:
      - Accounting positions
      operationId: accountingPositions.getInvestorAccountingPositionsHistory
      parameters:
      - name: investorId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: shareClassId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: from
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: to
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      security:
      - basicAuth: []
      - oauth2: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                  - day
                  - status
                  - investorId
                  - shareClassId
                  - accountIds
                  - sharesHoldings
                  - holdings
                  - subscriptions
                  - redemptions
                  - transfers
                  - yield
                  - realizedGain
                  - transferredGain
                  - totalUnrealizedGain
                  properties:
                    day:
                      type: string
                      title: Day
                      description: a day in ISO format "YYYY-MM-DD"
                    status:
                      type: string
                      enum:
                      - nav
                      - noNav
                    investorId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    shareClassId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    accountIds:
                      type: array
                      minItems: 1
                      items:
                        type: string
                        description: a Universally Unique Identifier
                        format: uuid
                    sharesHoldings:
                      $ref: '#/components/schemas/NonNegativeBigint'
                    holdings:
                      $ref: '#/components/schemas/NonNegativeAmount'
                    subscriptions:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/NonNegativeAmount'
                        total:
                          $ref: '#/components/schemas/NonNegativeAmount'
                      additionalProperties: false
                    redemptions:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/NonNegativeAmount'
                        total:
                          $ref: '#/components/schemas/NonNegativeAmount'
                      additionalProperties: false
                    transfers:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    yield:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    realizedGain:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    transferredGain:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    totalUnrealizedGain:
                      $ref: '#/components/schemas/Amount'
                  additionalProperties: false
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpApiDecodeError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/Unauthorized'
                - $ref: '#/components/schemas/InvestorAuthenticationError'
        '403':
          description: Forbidden
        '404':
          description: NotFound
      description: Get all accounting positions (midnight to midnight UTC) for a given investor and share class between two dates
      summary: Get accounting positions (midnight to midnight UTC) of an investor
  /accounting-positions/account-history:
    get:
      tags:
      - Accounting positions
      operationId: accountingPositions.getAccountingPositionsHistory
      parameters:
      - name: accountId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: shareClassId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: from
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: to
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      security:
      - basicAuth: []
      - oauth2: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                  - id
                  - day
                  - status
                  - investorId
                  - shareClassId
                  - accountId
                  - navId
                  - timestampGte
                  - timestampLt
                  - sharesHoldings
                  - holdings
                  - subscriptions
                  - redemptions
                  - transfers
                  - yield
                  - realizedGain
                  - transferredGain
                  - totalUnrealizedGain
                  properties:
                    id:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    day:
                      type: string
                      title: Day
                      description: a day in ISO format "YYYY-MM-DD"
                    status:
                      type: string
                      enum:
                      - nav
                      - noNav
                    investorId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    shareClassId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    accountId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    navId:
                      anyOf:
                      - type: string
                        description: a Universally Unique Identifier
                        format: uuid
                      - type: 'null'
                    timestampGte:
                      type: string
                      title: Timestamp
                      description: A timestamp in seconds since the Unix epoch (1970-01-01T00:00:00Z), e.g. "1753347047"
                    timestampLt:
                      type: string
                      title: Timestamp
                      description: A timestamp in seconds since the Unix epoch (1970-01-01T00:00:00Z), e.g. "1753347047"
                    sharesHoldings:
                      $ref: '#/components/schemas/NonNegativeBigint'
                    holdings:
                      $ref: '#/components/schemas/NonNegativeAmount'
                    subscriptions:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/NonNegativeAmount'
                        total:
                          $ref: '#/components/schemas/NonNegativeAmount'
                      additionalProperties: false
                    redemptions:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/NonNegativeAmount'
                        total:
                          $ref: '#/components/schemas/NonNegativeAmount'
                      additionalProperties: false
                    transfers:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    yield:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    realizedGain:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    transferredGain:
                      type: object
                      required:
                      - ofDay
                      - total
                      properties:
                        ofDay:
                          $ref: '#/components/schemas/Amount'
                        total:
                          $ref: '#/components/schemas/Amount'
                      additionalProperties: false
                    totalUnrealizedGain:
                      $ref: '#/components/schemas/Amount'
                  additionalProperties: false
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/HttpApiDecodeError'
                - $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/Unauthorized'
                - $ref: '#/components/schemas/InvestorAuthenticationError'
        '403':
          description: Forbidden
        '404':
          description: NotFound
      description: Get all accounting positions (midnight to midnight UTC) for a given account and share class between two dates
      summary: Get accounting positions (midnight to midnight UTC) of an account
  /accounting-positions/account-statement:
    get:
      tags:
      - Accounting positions
      operationId: accountingPositions.downloadAccountStatement
      parameters:
      - name: investorId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      - name: accountId
        in: query
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: false
        description: a Universally Unique Identifier
      - name: shareClassSymbol
        in: query
        schema:
          $ref: '#/components/schemas/ShareClassSymbol'
        required: true
      - name: from
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: to
        in: query
        schema:
          type: string
          title: Day
          description: a day in ISO format "YYYY-MM-DD"
        required: true
        description: a day in ISO format "YYYY-MM-DD"
      - name: locale
        in: query
        schema:
          $ref: '#/components/schemas/LocaleLanguage'
        required: false
      - name: showNumberOfShares
        in: query
        schema:
          $ref: '#/components/schemas/BooleanFromString'
        required: false
      security:
      - basicAuth: []
      - oauth2: []
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/HttpApiDecodeError'
                - $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/Unauthorized'
                - $ref: '#/components/schemas/InvestorAuthenticationError'
        '403':
          description: Forbidden
        '404':
          description: NotFound
      description: "\n  **Download an account statement related to a share class between two dates.**\n\n  - The account statement will be a pdf file.\n  - If no accountId is provided, the account statement will be for the sum of all archived and active accounts of the investor.\n            "
      summary: Download account statement
components:
  schemas:
    LocaleLanguage:
      type: string
      enum:
      - en
      - es
      - fr
      - it
      - de
      description: The language of the user
      title: LocaleLanguage
    Amount:
      type: object
      required:
      - value
      - currency
      properties:
        value:
          type: string
          title: decimal number as a string
          description: a string representation of a decimal number e.g. "10000", "0.00" or "-7432092.04"
        currency:
          type: string
          enum:
          - EUR
          - USD
          - GBP
          - CHF
          - JPY
          - SGD
          title: Currency code
          identifier: CurrencyCode
          description: a currency code among "EUR", "USD", "GBP", "CHF", "JPY", "SGD"
      additionalProperties: false
    ForbiddenError:
      type: object
      required:
      - reason
      - _tag
      properties:
        reason:
          type: string
        customErrorCode:
          type: string
          enum:
          - AccountDoesNotBelongToInvestor
          - SessionIsNot2FA
          - InvestorDocumentLinkedToActiveBankAccount
          - AtLeastTwoAdminUsersRequired
          - InvestorNotPendingOnboarding
          - ShareClassNotAvailableForDistributor
        _tag:
          type: string
          enum:
          - ForbiddenError
      additionalProperties: false
      description: Forbidden
    InvestorAuthenticationError:
      type: object
      required:
      - reason
      - _tag
      properties:
        reason:
          type: string
        _tag:
          type: string
          enum:
          - InvestorAuthenticationError
      additionalProperties: false
      description: Authentication Error
    BadRequest:
      $id: /schemas/void
      title: BadRequest
    HttpApiDecodeError:
      type: object
      required:
      - issues
      - message
      - _tag
      properties:
        issues:
          type: array
          items:
            $ref: '#/components/schemas/Issue'
        message:
          type: string
        _tag:
          type: string
          enum:
          - HttpApiDecodeError
      additionalProperties: false
      description: The request did not match the expected schema
    Issue:
      type: object
      required:
      - _tag
      - path
      - message
      properties:
        _tag:
          type: string
          enum:
          - Pointer
          - Unexpected
          - Missing
          - Composite
          - Refinement
          - Transformation
          - Type
          - Forbidden
          description: The tag identifying the type of parse issue
        path:
          type: array
          items:
            $ref: '#/components/schemas/PropertyKey'
          description: The path to the property where the issue occurred
        message:
          type: string
          description: A descriptive message explaining the issue
      additionalProperties: false
      description: Represents an error encountered while parsing a value to match the schema
    BooleanFromString:
      type: string
      enum:
      - 'true'
      - 'false'
      description: a string to be decoded into a boolean
    NonNegativeBigint:
      type: string
      description: a string to be decoded into a bigint
    DistributorAuthenticationError:
      type: object
      required:
      - reason
      - _tag
      properties:
        reason:
          type: string
        _tag:
          type: string
          enum:
          - DistributorAuthenticationError
      additionalProperties: false
      description: Authentication Error
    NonNegativeAmount:
      type: object
      required:
      - value
      - currency
      properties:
        value:
          type: string
          title: non-negative decimal number as a string
          description: a string representation of a non-negative decimal number e.g. "10000", "0.00" or "3420.92"
        currency:
          type: string
          enum:
          - EUR
          - USD
          - GBP
          - CHF
          - JPY
          - SGD
          title: Currency code
          identifier: CurrencyCode
          description: a currency code among "EUR", "USD", "GBP", "CHF", "JPY", "SGD"
      additionalProperties: false
      title: Non-Negative Amount
    Unauthorized:
      $id: /schemas/void
      title: Unauthorized
    ShareClassSymbol:
      type: string
      enum:
      - EUTBL
      - USTBL
      - eurUSTBL
      - SPKCC
      - eurSPKCC
      - UKTBL
      - eurUKTBL
      - SAFO
      - SAFOd
      - eurSAFO
      - eurSAFOd
      - gbpSAFO
      - chfSAFO
      title: ShareClassSymbol
    PropertyKey:
      anyOf:
      - type: string
      - type: number
      - type: object
        required:
        - _tag
        - key
        properties:
          _tag:
            type: string
            enum:
            - symbol
          key:
            type: string
        additionalProperties: false
        description: an object to be decoded into a globally shared symbol
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your API client_id as username and client_secret as password.