Puzzle Accounts API

The Accounts API from Puzzle — 3 operation(s) for accounts.

OpenAPI Specification

puzzle-accounts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Puzzle Api Accounts API
  description: Puzzle Api
  version: '0'
servers:
- url: https://staging.southparkdata.com/rest/v0
tags:
- name: Accounts
paths:
  /company/{id}/accounts:
    post:
      operationId: createFinancialAccount
      summary: Create Financial Account
      description: 'Creates a financial account for the specified Puzzle company.


        The created account will have a status of Syncing until data is added to it, then it will be Ready. Please allow a couple of minutes for this status to update after the data has been added to the account.


        The type of data that can be added to an account depends on the account type.


        Required scope: write:account'
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
          description: Partner-facing external identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nativeId:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                mask:
                  type: string
                type:
                  type: string
                  enum:
                  - Investment
                  - Invoice
                  - Credit
                  - Depository
                  - Loan
                  - Other
                  - PaymentProcessing
                  - Payroll
                  - Fintech
                  - Sweep
                currency:
                  type: string
                  minLength: 3
                  maxLength: 3
                  description: ISO 4217 currency code
                subType:
                  type: string
                  enum:
                  - Annuity
                  - Brokerage
                  - BrokerageForMinors
                  - CD
                  - Checking
                  - CreditCard
                  - EducationSavingsAccount
                  - HSA
                  - Investment
                  - LineOfCredit
                  - Loan
                  - MoneyMarket
                  - Mortgage
                  - Other
                  - PayPal
                  - Prepaid
                  - ProfitSharingPlan
                  - Retirement
                  - Savings
                  - StockPlan
                  - Stripe
                  - TaxAdvantagedInvestment
                  - Trust
                  - Unknown
                  - CashLike
              required:
              - nativeId
              - name
              - mask
              - type
              - currency
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: Partner-facing external identifier
                  nativeId:
                    type: string
                    nullable: true
                  name:
                    type: string
                  mask:
                    type: string
                  type:
                    type: string
                    enum:
                    - Investment
                    - Invoice
                    - Credit
                    - Depository
                    - Loan
                    - Other
                    - PaymentProcessing
                    - Payroll
                    - Fintech
                    - Sweep
                  subType:
                    type: string
                    enum:
                    - Annuity
                    - Brokerage
                    - BrokerageForMinors
                    - CD
                    - Checking
                    - CreditCard
                    - EducationSavingsAccount
                    - HSA
                    - Investment
                    - LineOfCredit
                    - Loan
                    - MoneyMarket
                    - Mortgage
                    - Other
                    - PayPal
                    - Prepaid
                    - ProfitSharingPlan
                    - Retirement
                    - Savings
                    - StockPlan
                    - Stripe
                    - TaxAdvantagedInvestment
                    - Trust
                    - Unknown
                    - CashLike
                    nullable: true
                  currentBalance:
                    type: object
                    properties:
                      amount:
                        type: string
                        minLength: 1
                        description: Arbitrary-precision decimal, serialized as a string
                      currency:
                        type: string
                        minLength: 3
                        maxLength: 3
                        description: ISO 4217 currency code
                    required:
                    - amount
                    - currency
                    description: A monetary amount with its currency
                    nullable: true
                  status:
                    type: string
                    enum:
                    - Syncing
                    - Ready
                  lastUpdatedAt:
                    type: string
                    minLength: 1
                    description: ISO 8601 timestamp
                    nullable: true
                required:
                - id
                - nativeId
                - name
                - mask
                - type
                - subType
                - currentBalance
                - status
                - lastUpdatedAt
    get:
      operationId: financialAccounts
      summary: Get Financial Accounts
      description: 'Retrieves a list of all of the company''s financial accounts.


        Required scope: read:company'
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
          description: Partner-facing external identifier
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  accounts:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                          description: Partner-facing external identifier
                        nativeId:
                          type: string
                          nullable: true
                        name:
                          type: string
                        mask:
                          type: string
                        type:
                          type: string
                          enum:
                          - Investment
                          - Invoice
                          - Credit
                          - Depository
                          - Loan
                          - Other
                          - PaymentProcessing
                          - Payroll
                          - Fintech
                          - Sweep
                        subType:
                          type: string
                          enum:
                          - Annuity
                          - Brokerage
                          - BrokerageForMinors
                          - CD
                          - Checking
                          - CreditCard
                          - EducationSavingsAccount
                          - HSA
                          - Investment
                          - LineOfCredit
                          - Loan
                          - MoneyMarket
                          - Mortgage
                          - Other
                          - PayPal
                          - Prepaid
                          - ProfitSharingPlan
                          - Retirement
                          - Savings
                          - StockPlan
                          - Stripe
                          - TaxAdvantagedInvestment
                          - Trust
                          - Unknown
                          - CashLike
                          nullable: true
                        currentBalance:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                          nullable: true
                        status:
                          type: string
                          enum:
                          - Syncing
                          - Ready
                        lastUpdatedAt:
                          type: string
                          minLength: 1
                          description: ISO 8601 timestamp
                          nullable: true
                      required:
                      - id
                      - nativeId
                      - name
                      - mask
                      - type
                      - subType
                      - currentBalance
                      - status
                      - lastUpdatedAt
                required:
                - accounts
  /company/{id}/accounts/balances:
    post:
      operationId: createAccountBalance
      summary: Create Account Balance
      description: 'Creates a balance for a financial account.


        Note that Puzzle stores all account balances trending towards positive, regardless of account type. Additional details can be found here.


        Required scope: write:account_balance'
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
          description: Partner-facing external identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountId:
                  type: string
                  minLength: 1
                  description: Partner-facing external identifier
                balance:
                  type: object
                  properties:
                    amount:
                      type: string
                      minLength: 1
                      description: Arbitrary-precision decimal, serialized as a string
                    currency:
                      type: string
                      minLength: 3
                      maxLength: 3
                      description: ISO 4217 currency code
                  required:
                  - amount
                  - currency
                  description: A monetary amount with its currency
                availableBalance:
                  type: object
                  properties:
                    amount:
                      type: string
                      minLength: 1
                      description: Arbitrary-precision decimal, serialized as a string
                    currency:
                      type: string
                      minLength: 3
                      maxLength: 3
                      description: ISO 4217 currency code
                  required:
                  - amount
                  - currency
                  description: A monetary amount with its currency
                timestamp:
                  type: string
                  minLength: 1
                  description: ISO 8601 timestamp
              required:
              - accountId
              - balance
              - timestamp
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: Partner-facing external identifier
                  accountId:
                    type: string
                    minLength: 1
                    description: Partner-facing external identifier
                  balance:
                    type: object
                    properties:
                      amount:
                        type: string
                        minLength: 1
                        description: Arbitrary-precision decimal, serialized as a string
                      currency:
                        type: string
                        minLength: 3
                        maxLength: 3
                        description: ISO 4217 currency code
                    required:
                    - amount
                    - currency
                    description: A monetary amount with its currency
                  availableBalance:
                    type: object
                    properties:
                      amount:
                        type: string
                        minLength: 1
                        description: Arbitrary-precision decimal, serialized as a string
                      currency:
                        type: string
                        minLength: 3
                        maxLength: 3
                        description: ISO 4217 currency code
                    required:
                    - amount
                    - currency
                    description: A monetary amount with its currency
                  timestamp:
                    type: string
                    minLength: 1
                    description: ISO 8601 timestamp
                required:
                - id
                - accountId
                - balance
                - availableBalance
                - timestamp
    get:
      operationId: balances
      summary: Get Financial Account Balances
      description: 'Returns the balances on a company''s financial accounts on the provided dates. A balance is the balance on the account at the start of the day provided.


        If we have an official institution account balance for that date, we will use the institution''s provided account balance. If the institution has not provided an account balance for the requested date, we will calculate the balance by summing transactions in the account that have occurred between the target data and the closest balance we have available.


        Note that Puzzle stores all account balances trending towards positive, regardless of account type. Additional details can be found here.


        If any of the company accounts are currently syncing or processing, this endpoint will return a 409 error.


        You can check the status of an account in the company object on the FinancialInstitutionAccount object. If the status is UpToDate then these balances can be retrieved without error.


        Required scope: read:company'
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
          description: Partner-facing external identifier
      - name: dates
        in: query
        required: true
        schema:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  balancesByDate:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                        balances:
                          type: array
                          items:
                            type: object
                            properties:
                              balance:
                                type: object
                                properties:
                                  amount:
                                    type: string
                                    minLength: 1
                                    description: Arbitrary-precision decimal, serialized as a string
                                  currency:
                                    type: string
                                    minLength: 3
                                    maxLength: 3
                                    description: ISO 4217 currency code
                                required:
                                - amount
                                - currency
                                description: A monetary amount with its currency
                              date:
                                type: string
                              derivedFrom:
                                type: string
                                enum:
                                - OfficialInstitutionBalance
                                - Calculated
                              account:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    minLength: 1
                                    description: Partner-facing external identifier
                                  nativeId:
                                    type: string
                                    nullable: true
                                  type:
                                    type: string
                                    enum:
                                    - Investment
                                    - Invoice
                                    - Credit
                                    - Depository
                                    - Loan
                                    - Other
                                    - PaymentProcessing
                                    - Payroll
                                    - Fintech
                                    - Sweep
                                  name:
                                    type: string
                                  mask:
                                    type: string
                                    nullable: true
                                  currentBalance:
                                    type: object
                                    properties:
                                      amount:
                                        type: string
                                        minLength: 1
                                        description: Arbitrary-precision decimal, serialized as a string
                                      currency:
                                        type: string
                                        minLength: 3
                                        maxLength: 3
                                        description: ISO 4217 currency code
                                    required:
                                    - amount
                                    - currency
                                    description: A monetary amount with its currency
                                  status:
                                    type: string
                                    enum:
                                    - Syncing
                                    - Ready
                                  ingestStatus:
                                    type: string
                                    enum:
                                    - Syncing
                                    - Ready
                                  connectionStatus:
                                    type: string
                                    enum:
                                    - OK
                                    - TemporaryOutage
                                    - Disconnected
                                  lastUpdatedAt:
                                    type: string
                                    minLength: 1
                                    description: ISO 8601 timestamp
                                    nullable: true
                                  pathToDetails:
                                    type: string
                                required:
                                - id
                                - nativeId
                                - type
                                - name
                                - mask
                                - currentBalance
                                - status
                                - ingestStatus
                                - connectionStatus
                                - lastUpdatedAt
                                - pathToDetails
                                nullable: true
                            required:
                            - balance
                            - date
                            - derivedFrom
                            - account
                        totalCash:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                      required:
                      - date
                      - balances
                      - totalCash
                required:
                - balancesByDate
  /company/{id}/ledgerAccounts/{ledgerAccountId}:
    get:
      operationId: ledgerAccount
      summary: Get Ledger Account
      description: 'Retrieves a specific account in the company''s chart of accounts.


        By default, the balances on the account are calculated using cash basis.


        Required scope: read:company'
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
          description: Partner-facing external identifier
      - name: ledgerAccountId
        in: path
        required: true
        description: The ledger account ID
        schema:
          type: string
          minLength: 1
          description: Partner-facing external identifier
      - name: basis
        in: query
        required: false
        schema:
          type: string
          enum:
          - cash
          - accrual
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: Partner-facing external identifier
                  name:
                    type: string
                  coaKeys:
                    type: array
                    items:
                      type: string
                      minLength: 1
                      description: Chart-of-accounts key
                  restrictedCoaKeys:
                    type: array
                    items:
                      type: string
                      minLength: 1
                      description: Chart-of-accounts key
                  nominalCode:
                    type: string
                  description:
                    type: string
                    nullable: true
                  keywords:
                    type: array
                    items:
                      type: string
                  type:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  category:
                    type: string
                  subCategory:
                    type: string
                    nullable: true
                  tertiaryCategory:
                    type: string
                    nullable: true
                  parentCode:
                    type: string
                    nullable: true
                  currentBalance:
                    type: object
                    properties:
                      amount:
                        type: string
                        minLength: 1
                        description: Arbitrary-precision decimal, serialized as a string
                      currency:
                        type: string
                        minLength: 3
                        maxLength: 3
                        description: ISO 4217 currency code
                    required:
                    - amount
                    - currency
                    description: A monetary amount with its currency
                  currentBalanceWithoutSubAccounts:
                    type: object
                    properties:
                      amount:
                        type: string
                        minLength: 1
                        description: Arbitrary-precision decimal, serialized as a string
                      currency:
                        type: string
                        minLength: 3
                        maxLength: 3
                        description: ISO 4217 currency code
                    required:
                    - amount
                    - currency
                    description: A monetary amount with its currency
                  isBankAccount:
                    type: boolean
                  accountId:
                    type: string
                    minLength: 1
                    description: Partner-facing external identifier
                    nullable: true
                  views:
                    type: array
                    items:
                      type: string
                  currentness:
                    type: string
                    nullable: true
                required:
                - id
                - name
                - coaKeys
                - restrictedCoaKeys
                - nominalCode
                - keywords
                - type
                - tags
                - category
                - currentBalance
                - currentBalanceWithoutSubAccounts
                - isBankAccount
                - views