openapi: 3.1.0
info:
  title: Net Liquidating Value History
  version: v0
  description: tastytrade Net Liquidating Value History API.
  contact:
    name: tastytrade API support
    email: api.support@tastytrade.com
    url: https://developer.tastytrade.com
servers:
  - url: https://api.cert.tastyworks.com
    description: Sandbox
  - url: https://api.tastyworks.com
    description: Production
paths:
  /accounts/{accountNumber}/net-liq/history:
    get:
      tags:
        - net-liq-controller
      summary: Get Net-Liq History For Account
      operationId: getNetLiqHistory
      parameters:
        - name: accountNumber
          in: path
          required: true
          schema:
            type: string
        - name: time-back
          in: query
          description: A request of data relative to the current time
          required: false
          schema:
            type: string
            enum:
              - 1d
              - 1w
              - 1m
              - 3m
              - 6m
              - 1y
              - all
          example: 1d
        - name: start-time
          in: query
          description: The start-time of a windowed request in format
            '2011-12-03T10:15:30+01:00[Europe/Paris]'
          required: false
          schema:
            type: string
        - name: end-time
          in: query
          description: The end-time of a windowed request in format
            '2011-12-03T10:15:30+01:00[Europe/Paris]'
          required: false
          schema:
            type: string
        - name: interval
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Net-liq history for the account over the requested window, as
            open/high/low/close data.
          content:
            "*/*":
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/NetLiqOhlc"
                  context:
                    type: string
                    example: /accounts/{accountNumber}/net-liq/history
                required:
                  - data
                  - context
        "401":
          description: "Missing or invalid authentication. Send a valid `Authorization:
            Bearer <token>` (access tokens last 15 minutes) and always include a
            `User-Agent` header in the form `<product>/<version>`."
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: Authenticated, but the token's scope or the account's authority
            level does not permit reading this account's net-liq history.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No account matches the supplied `accountNumber`, or the request was
            sent to the wrong environment (sandbox `api.cert.tastyworks.com` vs
            production `api.tastyworks.com`).
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded reasonable thresholds. Back off exponentially
            and reduce your request rate before retrying.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      description: Returns the account's net liquidating value history (the total
        current value of the account — roughly the cash you would end up with if
        you closed every position) as open/high/low/close data. Use the
        `time-back` parameter for a window relative to now (`1d`, `1w`, `1m`,
        `3m`, `6m`, `1y`, `all`), or supply `start-time`/`end-time` for an
        explicit window. This is a read-only endpoint and moves no money.
components:
  schemas:
    NetLiqOhlc:
      type: object
      properties:
        open:
          type: number
          format: double
          description: Net liquidating value at the start of the interval.
          example: 32100.5
        high:
          type: number
          format: double
          description: Highest net liquidating value observed during the interval.
          example: 32650.75
        low:
          type: number
          format: double
          description: Lowest net liquidating value observed during the interval.
          example: 31980.25
        close:
          type: number
          format: double
          description: Net liquidating value at the end of the interval.
          example: 32520.734
        totalOpen:
          type: number
          format: double
          description: Total net liquidating value at the start of the interval.
          example: 32100.5
        totalHigh:
          type: number
          format: double
          description: Highest total net liquidating value observed during the interval.
          example: 32650.75
        totalLow:
          type: number
          format: double
          description: Lowest total net liquidating value observed during the interval.
          example: 31980.25
        totalClose:
          type: number
          format: double
          description: Total net liquidating value at the end of the interval.
          example: 32520.734
        pendingCashOpen:
          type: number
          format: double
          description: Pending cash (cash mid-transfer that has not cleared) at the start
            of the interval. Usually 0.
          example: 0
        pendingCashHigh:
          type: number
          format: double
          description: Highest pending cash observed during the interval. Usually 0.
          example: 0
        pendingCashLow:
          type: number
          format: double
          description: Lowest pending cash observed during the interval. Usually 0.
          example: 0
        pendingCashClose:
          type: number
          format: double
          description: Pending cash at the end of the interval. Usually 0.
          example: 0
        time:
          type: string
          description: Timestamp marking the record within the requested window.
      description: A single open/high/low/close record of an account's net liquidating
        value over an interval. The `open`/`high`/`low`/`close` fields track the
        account's net liquidating value, and the `pendingCash*` fields track
        cash that is temporarily in a holding period while a cash transfer is
        processed.
x-tastytrade-service:
  serviceName: net-liq-server
  group: net-liquidating-value-history
  title: Net Liquidating Value History
tags:
  - name: net-liq-controller
