Spiko Yields API

The Yields API from Spiko — 3 operation(s) for yields.

OpenAPI Specification

spiko-yields-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Spiko Distributor Account transactions Yields 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: Yields
paths:
  /v0/yields/history:
    get:
      tags:
      - Yields
      operationId: yields.getYieldHistory
      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: 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 formatted as "yyyy-MM-dd"
        required: false
        description: a day formatted as "yyyy-MM-dd"
      - name: to
        in: query
        schema:
          type: string
          title: Day
          description: a day formatted as "yyyy-MM-dd"
        required: false
        description: a day formatted as "yyyy-MM-dd"
      security:
      - basicAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                  - day
                  - shareClassId
                  - investorId
                  - accountId
                  - yield
                  - navId
                  - navUpdateDate
                  properties:
                    day:
                      type: string
                      title: Day
                      description: a day formatted as "yyyy-MM-dd"
                    shareClassId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    investorId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    accountId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    yield:
                      $ref: '#/components/schemas/Amount'
                    navId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    navUpdateDate:
                      type: string
                      title: valid range date
                      description: A valid date within the range 2020-2100
                  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/DistributorAuthenticationError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
        '422':
          description: Investor is not ready for order creation yet
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvestorNotReadyError'
      description: "\n**Return a chronological list of daily yields for an investor in a specific share class.**\n\n> ⚠️ **For displaying an account's activity, prefer the [account transaction history endpoint](#tag/Account-transactions/operation/accountTransactions.getAccountTransactions).** It returns deposits, withdrawals, transfers and yield accruals as a single time-ordered stream, with cursor pagination, so you don't need to call multiple per-order-type endpoints and reconcile their results.\n\n- `from` and `to` parameters are optional\n          "
      summary: Get yields
  /v0/yields/{accountingPositionId}:
    get:
      tags:
      - Yields
      operationId: yields.getYield
      parameters:
      - name: accountingPositionId
        in: path
        schema:
          type: string
          description: a Universally Unique Identifier
          format: uuid
        required: true
        description: a Universally Unique Identifier
      security:
      - basicAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - day
                - shareClassId
                - investorId
                - accountId
                - yield
                - navId
                - navUpdateDate
                properties:
                  day:
                    type: string
                    title: Day
                    description: a day formatted as "yyyy-MM-dd"
                  shareClassId:
                    type: string
                    description: a Universally Unique Identifier
                    format: uuid
                  investorId:
                    type: string
                    description: a Universally Unique Identifier
                    format: uuid
                  accountId:
                    type: string
                    description: a Universally Unique Identifier
                    format: uuid
                  yield:
                    $ref: '#/components/schemas/Amount'
                  navId:
                    type: string
                    description: a Universally Unique Identifier
                    format: uuid
                  navUpdateDate:
                    type: string
                    title: valid range date
                    description: A valid date within the range 2020-2100
                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**Return a single daily yield by its identifier.**\n\nThe identifier is the `id` delivered in the `yield.credited` webhook payload.\n          "
      summary: Get a yield
  /yields/history:
    get:
      tags:
      - Yields
      operationId: yields.getYieldHistory
      parameters:
      - name: shareClassId
        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: 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
                  - shareClassId
                  - investorId
                  - accountId
                  - yield
                  - navId
                  - navUpdateDate
                  properties:
                    day:
                      type: string
                      title: Day
                      description: a day formatted as "yyyy-MM-dd"
                    shareClassId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    investorId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    accountId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    yield:
                      $ref: '#/components/schemas/Amount'
                    navId:
                      type: string
                      description: a Universally Unique Identifier
                      format: uuid
                    navUpdateDate:
                      type: string
                      title: valid range date
                      description: A valid date within the range 2020-2100
                  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 daily yields for a given account and share class between two dates
      summary: Get daily yields of an account
components:
  schemas:
    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
    DistributorAuthenticationError:
      type: object
      required:
      - reason
      - _tag
      properties:
        reason:
          type: string
        _tag:
          type: string
          enum:
          - DistributorAuthenticationError
      additionalProperties: false
      description: Authentication Error
    Unauthorized:
      $id: /schemas/void
      title: Unauthorized
    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
    InvestorNotReadyError:
      type: object
      required:
      - reason
      - _tag
      properties:
        reason:
          type: string
        _tag:
          type: string
          enum:
          - InvestorNotReadyError
      additionalProperties: false
      description: Investor is not ready for order creation yet
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your API client_id as username and client_secret as password.