tastytrade margin-requirements API

allows a client to fetch margin-requirements for positions and orders

OpenAPI Specification

tastytrade-margin-requirements-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: Account Status accounts margin-requirements API
  version: 7.1.0
  description: Operations about accounts
host: api.tastyworks.com
produces:
- application/json
tags:
- name: margin-requirements
  description: allows a client to fetch margin-requirements for positions and orders
paths:
  /margin/accounts/{account_number}/requirements:
    get:
      description: Fetch current margin/captial requirements report for an account
      produces:
      - application/json
      parameters:
      - in: path
        name: account_number
        type: string
        required: true
      responses:
        '200':
          description: Retrieve account margin/capital requirements report
      tags:
      - margin-requirements
      operationId: getMarginAccountsAccountNumberRequirements
  /margin/accounts/{account_number}/dry-run:
    post:
      description: Estimate margin requirements for an order given an account
      produces:
      - application/json
      consumes:
      - application/json
      parameters:
      - in: path
        name: account_number
        type: string
        required: true
      - in: body
        name: order
        description: the order to evaluate for margin requirements
        schema:
          type: object
          required:
          - order-type
          - time-in-force
          - account-number
          - underlying-symbol
          properties:
            account-number:
              type: string
            underlying-symbol:
              type: string
            order-type:
              type: string
            time-in-force:
              type: string
            gtc-date:
              type: string
              format: date
            price:
              type: string
              format: numeric
            price-effect:
              type: string
              enum:
              - Credit
              - Debit
            stop-trigger:
              type: string
              format: numeric
            replaces-order-id:
              type: string
              format: numeric
            legs:
              type: array
              minItems: 1
              maxItems: 4
              uniqueItems: true
              items:
                type: object
                required:
                - symbol
                - instrument-type
                - action
                properties:
                  symbol:
                    type: string
                  instrument-type:
                    type: string
                  quantity:
                    type: string
                    format: numeric
                  action:
                    type: string
                  remaining-quantity:
                    type: string
                    format: numeric
      responses:
        '200':
          description: Retrieve account margin/capital requirements report
      tags:
      - margin-requirements
      operationId: createMarginAccountsAccountNumberDryRun