openapi: 3.0.3
info:
  title: Arc API
  version: 1.0.0
  description: >-
    Read-only REST access to your Arc financial data. Every request
    authenticates with an Arc API key (arc_sk_…) as a bearer token.
servers:
  - url: https://api.arc.tech/v1
security:
  - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: An Arc API key (arc_sk_…) presented as a bearer token.
  schemas:
    Me:
      type: object
      properties:
        company:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
              nullable: true
          required:
            - id
            - name
        key:
          type: object
          properties:
            keyId:
              type: string
            name:
              type: string
            secretLast4:
              type: string
            lastUsedAt:
              type: string
              nullable: true
              description: ISO 8601, or null if the key has never been used.
          required:
            - keyId
            - name
            - secretLast4
            - lastUsedAt
        owner:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
              nullable: true
          required:
            - id
            - name
      required:
        - company
        - key
        - owner
    Organization:
      type: object
      properties:
        legalName:
          type: string
          nullable: true
        doingBusinessAs:
          type: string
          nullable: true
        federalEinLast4:
          type: string
          nullable: true
        phoneNumber:
          type: object
          nullable: true
          properties:
            countryCode:
              type: string
            number:
              type: string
          required:
            - countryCode
            - number
        companyLegalAddress:
          type: string
          nullable: true
          description: >-
            The legal address rendered exactly as the dashboard shows it: line1,
            optional line2, then "city, state postalCode" (newline-separated).
            null when the company has none.
        investmentPreferences:
          type: object
          nullable: true
          properties:
            investmentPreference:
              type: string
              enum:
                - PROTECTION
                - YIELD
                - GOVERNMENT_SECURITIES
            timeHorizon:
              type: string
              enum:
                - SHORT_TERM
                - MEDIUM_TERM
                - LONG_TERM
            investmentAmount:
              $ref: '#/components/schemas/Money'
            createdAt:
              type: string
              description: ISO 8601 timestamp, UTC.
          required:
            - investmentPreference
            - timeHorizon
            - investmentAmount
            - createdAt
          description: >-
            Omitted unless the caller opts in; null when opted in but the
            company has none set.
      required:
        - legalName
        - doingBusinessAs
        - federalEinLast4
        - phoneNumber
        - companyLegalAddress
    Money:
      type: object
      properties:
        minorUnits:
          type: integer
          description: Integer minor units (e.g. cents for USD); never a float.
        currency:
          type: string
          description: ISO 4217 currency code, e.g. "USD".
      required:
        - minorUnits
        - currency
      description: An amount as integer minor units plus its currency.
    Profile:
      type: object
      properties:
        legalName:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: object
          nullable: true
          properties:
            countryCode:
              type: string
            number:
              type: string
          required:
            - countryCode
            - number
        address:
          type: string
          nullable: true
          description: >-
            Rendered as the dashboard shows it: line1, optional line2, "city,
            state postalCode", then country (newline-separated). null without a
            KYC profile.
        dateOfBirth:
          type: string
          nullable: true
          description: yyyy-MM-dd (UTC); null without a KYC profile.
        jobTitle:
          type: string
          nullable: true
        ownershipPercentage:
          type: number
          nullable: true
        citizenship:
          type: string
          nullable: true
          description: Country code, e.g. "US"; null without a KYC profile.
        identificationCollected:
          type: boolean
      required:
        - legalName
        - email
        - phone
        - address
        - dateOfBirth
        - jobTitle
        - ownershipPercentage
        - citizenship
        - identificationCollected
    User:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        role:
          type: string
          nullable: true
          enum:
            - admin
            - member
            - manager
            - bookkeeper
            - card_only
            - lender
            - null
        status:
          type: string
          enum:
            - active
            - pending
        createdAt:
          type: string
          description: ISO 8601 timestamp.
      required:
        - id
        - name
        - email
        - role
        - status
        - createdAt
    Account:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: Nickname when set, else the product label.
        type:
          type: string
          enum:
            - treasury
            - operating
        status:
          type: string
          enum:
            - ACTIVE
            - ACCOUNT_RESTRICTED
            - PENDING_APPROVAL
            - ACCOUNT_CLOSED
        createdAt:
          type: string
          description: ISO 8601 timestamp.
        availableBalance:
          $ref: '#/components/schemas/Money'
        pendingBalance:
          $ref: '#/components/schemas/Money'
        postedBalance:
          $ref: '#/components/schemas/Money'
      required:
        - id
        - name
        - type
        - status
        - createdAt
        - availableBalance
        - pendingBalance
        - postedBalance
    Card:
      type: object
      properties:
        last4:
          type: string
        type:
          type: string
          enum:
            - debit
        format:
          type: string
          enum:
            - physical
            - virtual
        cardholder:
          type: string
        status:
          type: string
          enum:
            - active
            - inactive
            - canceled
        limit:
          allOf:
            - $ref: '#/components/schemas/Money'
            - nullable: true
        createdAt:
          type: string
          description: ISO 8601 timestamp, UTC.
      required:
        - last4
        - type
        - format
        - cardholder
        - status
        - limit
        - createdAt
    ExternalAccount:
      type: object
      properties:
        id:
          type: string
        institution:
          type: string
          description: The linked bank/institution name the app displays.
        accountMask:
          type: string
          nullable: true
          description: Last four digits of the account number (••••1234), or null.
        type:
          type: string
          enum:
            - checking
            - savings
        status:
          type: string
          enum:
            - active
            - inactive
        createdAt:
          type: string
          description: ISO 8601 timestamp, UTC.
      required:
        - id
        - institution
        - accountMask
        - type
        - status
        - createdAt
    Transaction:
      type: object
      properties:
        id:
          type: string
        accountArn:
          type: string
        amount:
          $ref: '#/components/schemas/Money'
        direction:
          type: string
          enum:
            - debit
            - credit
        description:
          type: string
        status:
          type: string
        isInternalTransfer:
          type: boolean
          description: True when money moved between this company's own Arc accounts.
        date:
          type: string
          description: ISO 8601 timestamp, UTC.
      required:
        - id
        - accountArn
        - amount
        - direction
        - description
        - status
        - isInternalTransfer
        - date
    TransactionDetail:
      type: object
      properties:
        id:
          type: string
        accountArn:
          type: string
        name:
          type: string
        amount:
          $ref: '#/components/schemas/Money'
        direction:
          type: string
          enum:
            - debit
            - credit
        status:
          type: string
        isInternalTransfer:
          type: boolean
          description: True when money moved between this company's own Arc accounts.
        initiatedDate:
          type: string
          description: ISO 8601 timestamp, UTC — "Initiated Date".
        clearedDate:
          type: string
          nullable: true
          description: >-
            ISO 8601 timestamp, UTC — "Cleared"/"Failed Date"; null while
            pending.
        method:
          type: string
          description: The drawer's "Transaction Method".
        category:
          type: string
          description: Human label, e.g. "General Operating Expense".
        description:
          type: string
          description: The drawer's "Memo" (transfers) / "Description".
        createdBy:
          type: string
        note:
          type: string
        bankDetails:
          type: object
          properties:
            bankName:
              type: string
            routingNumber:
              type: string
            accountNumber:
              type: string
              description: >-
                Counterparty account number, masked to the last 4 (••••1234);
                the full number is never returned.
          required:
            - bankName
            - routingNumber
      required:
        - id
        - accountArn
        - name
        - amount
        - direction
        - status
        - isInternalTransfer
        - initiatedDate
        - clearedDate
        - method
        - category
        - description
    Payment:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - paid
            - scheduled
            - draft
            - pending-approval
            - canceled
            - declined
        counterparty:
          type: string
        amount:
          allOf:
            - $ref: '#/components/schemas/Money'
            - nullable: true
        method:
          type: string
          nullable: true
          enum:
            - ACH
            - Wire
            - Intra transfer
            - International wire fee
            - International wire
            - null
        frequency:
          type: string
          nullable: true
        invoiceNumber:
          type: string
          nullable: true
        invoiceDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        dueDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        scheduledDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        sentDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        createdAt:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        createdBy:
          type: string
          nullable: true
      required:
        - id
        - status
        - counterparty
        - amount
        - method
        - frequency
        - invoiceNumber
        - invoiceDate
        - dueDate
        - scheduledDate
        - sentDate
        - createdAt
        - createdBy
    PaymentDetail:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - paid
            - scheduled
            - draft
            - pending-approval
            - canceled
            - declined
        counterparty:
          type: string
        amount:
          allOf:
            - $ref: '#/components/schemas/Money'
            - nullable: true
        method:
          type: string
          nullable: true
          enum:
            - ACH
            - Wire
            - Intra transfer
            - International wire fee
            - International wire
            - null
        frequency:
          type: string
          nullable: true
        invoiceNumber:
          type: string
          nullable: true
        invoiceDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        dueDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        scheduledDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        sentDate:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        createdAt:
          type: string
          nullable: true
          description: ISO 8601 timestamp.
        createdBy:
          type: string
          nullable: true
        memo:
          type: string
          nullable: true
        sourceAccount:
          $ref: '#/components/schemas/PaymentAccount'
        destinationAccount:
          $ref: '#/components/schemas/PaymentAccount'
        fee:
          allOf:
            - $ref: '#/components/schemas/Money'
            - nullable: true
        recipientAmount:
          allOf:
            - $ref: '#/components/schemas/Money'
            - nullable: true
        upcomingDates:
          type: array
          nullable: true
          items:
            type: string
        reviewedBy:
          type: string
          nullable: true
      required:
        - id
        - status
        - counterparty
        - amount
        - method
        - frequency
        - invoiceNumber
        - invoiceDate
        - dueDate
        - scheduledDate
        - sentDate
        - createdAt
        - createdBy
        - memo
        - sourceAccount
        - destinationAccount
        - fee
        - recipientAmount
        - upcomingDates
        - reviewedBy
    PaymentAccount:
      type: object
      nullable: true
      properties:
        name:
          type: string
          nullable: true
        accountMask:
          type: string
          nullable: true
      required:
        - name
        - accountMask
    Statement:
      type: object
      properties:
        id:
          type: string
        accountId:
          type: string
        accountName:
          type: string
          description: Nickname when set, else the product label.
        month:
          type: string
          description: The statement month, 'yyyy-MM' (UTC).
        description:
          type: string
          description: The month as the customer sees it, e.g. 'June 2026'.
      required:
        - id
        - accountId
        - accountName
        - month
        - description
    StatementDownload:
      type: object
      properties:
        url:
          type: string
          description: Short-lived signed URL to the statement PDF.
        expiresAt:
          type: string
          description: ISO 8601 expiry of the URL.
      required:
        - url
        - expiresAt
    Invoice:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
          description: The customer-facing invoice number.
        title:
          type: string
          description: The invoice title/description the sender set.
        recipient:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
          required:
            - name
            - email
          description: Who the invoice is billed to.
        dateIssued:
          type: string
          description: Issue date, 'yyyy-MM-dd'.
        dueDate:
          type: string
          nullable: true
          description: Due date, 'yyyy-MM-dd', or null when the sender left it open.
        subtotal:
          $ref: '#/components/schemas/Money'
        taxTotal:
          $ref: '#/components/schemas/Money'
        total:
          $ref: '#/components/schemas/Money'
      required:
        - id
        - number
        - title
        - recipient
        - dateIssued
        - dueDate
        - subtotal
        - taxTotal
        - total
    InvoiceDetail:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
          description: The customer-facing invoice number.
        title:
          type: string
          description: The invoice title/description the sender set.
        recipient:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
          required:
            - name
            - email
          description: Who the invoice is billed to.
        dateIssued:
          type: string
          description: Issue date, 'yyyy-MM-dd'.
        dueDate:
          type: string
          nullable: true
          description: Due date, 'yyyy-MM-dd', or null when the sender left it open.
        subtotal:
          $ref: '#/components/schemas/Money'
        taxTotal:
          $ref: '#/components/schemas/Money'
        total:
          $ref: '#/components/schemas/Money'
        additionalInfo:
          type: string
          nullable: true
          description: The free-form note the sender added, or null.
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
      required:
        - id
        - number
        - title
        - recipient
        - dateIssued
        - dueDate
        - subtotal
        - taxTotal
        - total
        - additionalInfo
        - lineItems
    InvoiceLineItem:
      type: object
      properties:
        description:
          type: string
        quantity:
          type: string
          description: Decimal string; quantities may be fractional.
        unitPrice:
          $ref: '#/components/schemas/Money'
        taxPercent:
          type: number
          description: Tax rate applied to this line, in percent.
        amount:
          $ref: '#/components/schemas/Money'
      required:
        - description
        - quantity
        - unitPrice
        - taxPercent
        - amount
    InvoiceRecipient:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        address:
          type: object
          nullable: true
          properties:
            line1:
              type: string
            line2:
              type: string
              nullable: true
            city:
              type: string
            state:
              type: string
              nullable: true
            postalCode:
              type: string
            country:
              type: string
          required:
            - line1
            - line2
            - city
            - state
            - postalCode
            - country
        createdAt:
          type: string
          description: ISO 8601 timestamp.
      required:
        - id
        - name
        - email
        - address
        - createdAt
    TreasurySummary:
      type: object
      properties:
        accountId:
          type: string
          description: Arc CM brokerage account id (cross-references /v1/accounts).
        asOf:
          type: string
          description: As-of timestamp, ISO-8601.
        totalValue:
          $ref: '#/components/schemas/Money'
        cashAvailableToTrade:
          $ref: '#/components/schemas/Money'
        totalInterest:
          $ref: '#/components/schemas/Money'
        totalDividend:
          $ref: '#/components/schemas/Money'
        netYieldBps:
          type: integer
          description: >-
            Blended net yield in basis points (net of company fees), e.g. 487 =
            4.87%.
      required:
        - accountId
        - asOf
        - totalValue
        - cashAvailableToTrade
        - totalInterest
        - totalDividend
        - netYieldBps
    TreasuryPosition:
      type: object
      properties:
        assetClass:
          type: string
          enum:
            - cash
            - mmf
            - treasury_bill
            - treasury_note
            - rolling_treasury_bills
        symbol:
          type: string
          nullable: true
        cusip:
          type: string
          nullable: true
        marketValue:
          $ref: '#/components/schemas/Money'
        shares:
          type: string
          nullable: true
          description: >-
            Fractional share count as a decimal string, or null (e.g. treasury
            notes).
        costBasis:
          allOf:
            - $ref: '#/components/schemas/Money'
            - nullable: true
        netYieldBps:
          type: integer
          nullable: true
          description: Net yield in basis points (net of fees), or null.
        grossYieldBps:
          type: integer
          nullable: true
          description: Gross yield in basis points, or null.
        sharePrice:
          type: string
          nullable: true
          description: Current market share price as a decimal string, or null.
        maturityDate:
          type: string
          nullable: true
          description: Maturity date (ISO-8601), T-bills only; else null.
      required:
        - assetClass
        - symbol
        - cusip
        - marketValue
        - shares
        - costBasis
        - netYieldBps
        - grossYieldBps
        - sharePrice
        - maturityDate
    TreasuryRates:
      type: object
      properties:
        funds:
          type: array
          items:
            type: object
            properties:
              symbol:
                type: string
              grossYieldBps:
                type: integer
                nullable: true
              netYieldBps:
                type: integer
                nullable: true
                description: >-
                  Net of the key's company fees; null when no fee schedule
                  applies.
              timeframe:
                type: string
                nullable: true
                enum:
                  - seven_day
                  - thirty_day
                  - null
              sharePrice:
                type: string
                nullable: true
              asOfDate:
                type: string
                nullable: true
            required:
              - symbol
              - grossYieldBps
              - netYieldBps
              - timeframe
              - sharePrice
              - asOfDate
        highestYieldBps:
          type: integer
          nullable: true
        highestNetYieldBps:
          type: integer
          nullable: true
        cashSweep:
          type: object
          nullable: true
          properties:
            grossYieldBps:
              type: integer
              nullable: true
            netYieldBps:
              type: integer
              nullable: true
          required:
            - grossYieldBps
            - netYieldBps
      required:
        - funds
        - highestYieldBps
        - highestNetYieldBps
        - cashSweep
    AccountingConnection:
      type: object
      properties:
        id:
          type: string
        provider:
          type: string
          nullable: true
          description: Platform display name (e.g. "QuickBooks Online"), or null.
        type:
          type: string
          enum:
            - accounting
            - bank_feed
          description: >-
            `accounting` = books linked in via Codat; `bank_feed` = Arc’s feed
            pushed out.
        status:
          type: string
          enum:
            - connected
            - pending
            - disconnected
            - error
          description: Normalized across both types.
        lastSyncedAt:
          type: string
          nullable: true
          description: >-
            ISO-8601 last successful sync, or null (accounting links don’t
            persist one).
        addedAt:
          type: string
          description: ISO-8601 timestamp the connection was added.
      required:
        - id
        - provider
        - type
        - status
        - lastSyncedAt
        - addedAt
  parameters: {}
paths:
  /me:
    get:
      operationId: getMe
      summary: 'The identity behind the key: company, key metadata, and owner.'
      tags:
        - Identity
      responses:
        '200':
          description: The authenticated identity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Me'
  /organization:
    get:
      operationId: getOrganization
      summary: The company organization profile.
      tags:
        - Identity
      parameters:
        - schema:
            type: string
            description: Set to "true" to include the company’s investment preferences.
          required: false
          description: Set to "true" to include the company’s investment preferences.
          name: investmentPreferences
          in: query
      responses:
        '200':
          description: The organization profile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
  /profile:
    get:
      operationId: getProfile
      summary: The key owner’s personal profile.
      tags:
        - Identity
      responses:
        '200':
          description: The owner’s profile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
  /users:
    get:
      operationId: listUsers
      summary: List company members.
      tags:
        - Identity
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - admin
              - member
              - manager
              - bookkeeper
              - card_only
              - lender
            description: Filter by member role.
          required: false
          description: Filter by member role.
          name: role
          in: query
        - schema:
            type: string
            enum:
              - active
              - pending
            description: active members or pending invitations.
          required: false
          description: active members or pending invitations.
          name: status
          in: query
        - schema:
            type: string
            description: Case-insensitive exact match on the member email.
          required: false
          description: Case-insensitive exact match on the member email.
          name: email
          in: query
        - schema:
            type: string
            description: Case-insensitive substring match on the member name.
          required: false
          description: Case-insensitive substring match on the member name.
          name: name
          in: query
      responses:
        '200':
          description: A page of members.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /accounts:
    get:
      operationId: listAccounts
      summary: >-
        List cash-management accounts and their balances. Filter server-side
        rather than paging and filtering client-side.
      tags:
        - Accounts
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - treasury
              - operating
            description: Only accounts of this type.
          required: false
          description: Only accounts of this type.
          name: type
          in: query
        - schema:
            type: string
            enum:
              - ACTIVE
              - ACCOUNT_RESTRICTED
              - PENDING_APPROVAL
              - ACCOUNT_CLOSED
            description: Only accounts reporting this status.
          required: false
          description: Only accounts reporting this status.
          name: status
          in: query
      responses:
        '200':
          description: A page of accounts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Account'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /cards:
    get:
      operationId: listCards
      summary: List Arc-issued cards.
      tags:
        - Accounts
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - own
              - team
            description: own (default) shows your cards; team shows the company’s.
          required: false
          description: own (default) shows your cards; team shows the company’s.
          name: scope
          in: query
        - schema:
            type: string
            enum:
              - active
              - inactive
              - canceled
            description: Filter by card status.
          required: false
          description: Filter by card status.
          name: status
          in: query
        - schema:
            type: string
            enum:
              - physical
              - virtual
            description: Filter by card form factor.
          required: false
          description: Filter by card form factor.
          name: format
          in: query
        - schema:
            type: string
            description: Case-insensitive substring match on the cardholder name.
          required: false
          description: Case-insensitive substring match on the cardholder name.
          name: cardholder
          in: query
        - schema:
            type: string
            pattern: ^\d{4}$
            description: >-
              Exactly this masked last-4 (four digits) — the only per-card
              handle, since cards carry no public id.
          required: false
          description: >-
            Exactly this masked last-4 (four digits) — the only per-card handle,
            since cards carry no public id.
          name: last4
          in: query
      responses:
        '200':
          description: A page of cards.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Card'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /external-accounts:
    get:
      operationId: listExternalAccounts
      summary: List linked external bank accounts.
      tags:
        - Accounts
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - checking
              - savings
            description: Only accounts of this type.
          required: false
          description: Only accounts of this type.
          name: type
          in: query
        - schema:
            type: string
            enum:
              - active
              - inactive
            description: Only connections reporting this status.
          required: false
          description: Only connections reporting this status.
          name: status
          in: query
      responses:
        '200':
          description: A page of linked accounts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExternalAccount'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /transactions:
    get:
      operationId: listTransactions
      summary: >-
        List cash-management transactions, newest first. Filter server-side
        rather than paging and filtering client-side.
      tags:
        - Accounts
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            description: Inclusive lower bound, YYYY-MM-DD.
          required: false
          description: Inclusive lower bound, YYYY-MM-DD.
          name: from
          in: query
        - schema:
            type: string
            description: Inclusive upper bound, YYYY-MM-DD.
          required: false
          description: Inclusive upper bound, YYYY-MM-DD.
          name: to
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Set to "true" to omit transfers between company-owned accounts.
          required: false
          description: Set to "true" to omit transfers between company-owned accounts.
          name: excludeInternalTransfers
          in: query
        - schema:
            type: string
            description: >-
              Only this account: its id from GET /v1/accounts, or the accountArn
              a row carries.
          required: false
          description: >-
            Only this account: its id from GET /v1/accounts, or the accountArn a
            row carries.
          name: account
          in: query
        - schema:
            type: string
            enum:
              - debit
              - credit
            description: debit is money out, credit is money in.
          required: false
          description: debit is money out, credit is money in.
          name: direction
          in: query
        - schema:
            type: string
            enum:
              - OPEN
              - POSTED
              - VOID
              - RETURNED
            description: Only rows reporting this status.
          required: false
          description: Only rows reporting this status.
          name: status
          in: query
        - schema:
            type: string
            enum:
              - ach
              - ach-credit
              - ach-debit
              - ach-transfer
              - card
              - check-deposit
              - internal-transfer
              - international-wire-transfer
              - rewards-redemption
              - wire
              - wire-credit
              - wire-debit
              - wire-transfer
            description: Payment method; ach and wire match every variant of each.
          required: false
          description: Payment method; ach and wire match every variant of each.
          name: method
          in: query
        - schema:
            type: string
            description: >-
              Lower bound on |amount|, in integer minor units (100000 =
              $1,000.00).
          required: false
          description: >-
            Lower bound on |amount|, in integer minor units (100000 =
            $1,000.00).
          name: minAmount
          in: query
        - schema:
            type: string
            description: Upper bound on |amount|, in integer minor units.
          required: false
          description: Upper bound on |amount|, in integer minor units.
          name: maxAmount
          in: query
        - schema:
            type: string
            description: >-
              Case-insensitive substring match across the transaction: the
              counterparty or merchant name, the description and notes, and
              bank/account identifiers are all matched, so this is broader than
              a name filter.
          required: false
          description: >-
            Case-insensitive substring match across the transaction: the
            counterparty or merchant name, the description and notes, and
            bank/account identifiers are all matched, so this is broader than a
            name filter.
          name: search
          in: query
      responses:
        '200':
          description: A page of transactions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transaction'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /transactions/{id}:
    get:
      operationId: getTransaction
      summary: A single transaction’s detail.
      tags:
        - Accounts
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The transaction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetail'
        '404':
          description: No resource with that id in the key’s company.
  /payments:
    get:
      operationId: listPayments
      summary: >-
        List outgoing payments. Filter server-side rather than paging and
        filtering client-side.
      tags:
        - Payments
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            description: Inclusive lower bound, YYYY-MM-DD.
          required: false
          description: Inclusive lower bound, YYYY-MM-DD.
          name: from
          in: query
        - schema:
            type: string
            description: Inclusive upper bound, YYYY-MM-DD.
          required: false
          description: Inclusive upper bound, YYYY-MM-DD.
          name: to
          in: query
        - schema:
            type: string
            enum:
              - all
              - paid
              - scheduled
              - draft
              - pending-approval
              - canceled
            description: Filter by lifecycle state; defaults to all states.
          required: false
          description: Filter by lifecycle state; defaults to all states.
          name: status
          in: query
        - schema:
            type: string
            description: >-
              Case-insensitive substring match on the payee name. A canceled or
              declined payment with no saved contact reports the destination
              institution name instead, and is not matched by this filter.
          required: false
          description: >-
            Case-insensitive substring match on the payee name. A canceled or
            declined payment with no saved contact reports the destination
            institution name instead, and is not matched by this filter.
          name: counterparty
          in: query
        - schema:
            type: string
            enum:
              - ach
              - international-wire
              - international-wire-fee
              - intra-transfer
              - wire
            description: Payment method; wire matches domestic and international wires.
          required: false
          description: Payment method; wire matches domestic and international wires.
          name: method
          in: query
        - schema:
            type: string
            description: >-
              Lower bound on the amount, in integer minor units (100000 =
              $1,000.00).
          required: false
          description: >-
            Lower bound on the amount, in integer minor units (100000 =
            $1,000.00).
          name: minAmount
          in: query
        - schema:
            type: string
            description: Upper bound on the amount, in integer minor units.
          required: false
          description: Upper bound on the amount, in integer minor units.
          name: maxAmount
          in: query
      responses:
        '200':
          description: A page of payments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payment'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /payments/{id}:
    get:
      operationId: getPayment
      summary: A single payment’s detail, in any lifecycle state.
      tags:
        - Payments
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentDetail'
        '404':
          description: No resource with that id in the key’s company.
  /statements:
    get:
      operationId: listStatements
      summary: >-
        List available monthly account statements. Filter server-side rather
        than paging and filtering client-side.
      tags:
        - Statements
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            description: 'Only this account: its id from GET /v1/accounts.'
          required: false
          description: 'Only this account: its id from GET /v1/accounts.'
          name: account
          in: query
        - schema:
            type: string
            description: Only this statement month, YYYY-MM.
          required: false
          description: Only this statement month, YYYY-MM.
          name: month
          in: query
        - schema:
            type: string
            description: Only this statement year, YYYY.
          required: false
          description: Only this statement year, YYYY.
          name: year
          in: query
      responses:
        '200':
          description: A page of statements.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Statement'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /statements/{id}/download:
    get:
      operationId: downloadStatement
      summary: A short-lived signed URL for a statement PDF.
      tags:
        - Statements
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The signed download URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatementDownload'
        '404':
          description: No resource with that id in the key’s company.
  /invoices:
    get:
      operationId: listInvoices
      summary: >-
        List invoices you’ve sent (money in). Filter server-side rather than
        paging and filtering client-side.
      tags:
        - Invoices
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
        - schema:
            type: string
            description: Inclusive lower bound, YYYY-MM-DD.
          required: false
          description: Inclusive lower bound, YYYY-MM-DD.
          name: from
          in: query
        - schema:
            type: string
            description: Inclusive upper bound, YYYY-MM-DD.
          required: false
          description: Inclusive upper bound, YYYY-MM-DD.
          name: to
          in: query
        - schema:
            type: string
            description: Case-insensitive substring match on the recipient name.
          required: false
          description: Case-insensitive substring match on the recipient name.
          name: recipient
          in: query
        - schema:
            type: string
            description: Inclusive lower bound on the due date, YYYY-MM-DD.
          required: false
          description: Inclusive lower bound on the due date, YYYY-MM-DD.
          name: dueFrom
          in: query
        - schema:
            type: string
            description: Inclusive upper bound on the due date, YYYY-MM-DD.
          required: false
          description: Inclusive upper bound on the due date, YYYY-MM-DD.
          name: dueTo
          in: query
        - schema:
            type: boolean
            description: >-
              Set to true to keep only invoices due strictly before today (UTC).
              Invoices carry no payment status, so this is a due-date test only.
          required: false
          description: >-
            Set to true to keep only invoices due strictly before today (UTC).
            Invoices carry no payment status, so this is a due-date test only.
          name: overdue
          in: query
        - schema:
            type: string
            description: Case-insensitive exact match on the invoice number.
          required: false
          description: Case-insensitive exact match on the invoice number.
          name: number
          in: query
      responses:
        '200':
          description: A page of invoices.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invoice'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /invoices/{id}:
    get:
      operationId: getInvoice
      summary: 'A single invoice’s detail: the list row plus its line items.'
      tags:
        - Invoices
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The invoice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceDetail'
        '404':
          description: No resource with that id in the key’s company.
  /invoice-recipients:
    get:
      operationId: listInvoiceRecipients
      summary: List the customers you bill.
      tags:
        - Invoices
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
      responses:
        '200':
          description: A page of recipients.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InvoiceRecipient'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /treasury/summary:
    get:
      operationId: getTreasurySummary
      summary: The treasury (invested) account overview.
      tags:
        - Treasury
      responses:
        '200':
          description: The treasury summary.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasurySummary'
  /treasury/positions:
    get:
      operationId: listTreasuryPositions
      summary: List treasury holdings.
      tags:
        - Treasury
      responses:
        '200':
          description: A page of positions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/TreasuryPosition'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
  /treasury/rates:
    get:
      operationId: getTreasuryRates
      summary: Current money-market fund rates and the cash-sweep rate.
      tags:
        - Treasury
      responses:
        '200':
          description: The current rates.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasuryRates'
  /accounting-connections:
    get:
      operationId: listAccountingConnections
      summary: List accounting integrations and their sync status.
      tags:
        - Accounting
      parameters:
        - schema:
            type: string
            description: Page size, 1–100 (default 25).
          required: false
          description: Page size, 1–100 (default 25).
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a prior response nextCursor.
          required: false
          description: Opaque cursor from a prior response nextCursor.
          name: cursor
          in: query
      responses:
        '200':
          description: A page of connections.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AccountingConnection'
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass back as ?cursor for the next page; null on the last
                      page.
                required:
                  - data
                  - nextCursor
