Tesser Treasury API

The Treasury API from Tesser — 12 operation(s) for treasury.

OpenAPI Specification

tesser-treasury-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Tesser Accounts Treasury API
  description: The Tesser Payments Platform API documentation.
  version: v1
  contact: {}
servers: []
security:
- bearer: []
tags:
- name: Treasury
paths:
  /v1/treasury/activity:
    get:
      operationId: treasury_getTreasuryActivity
      parameters:
      - name: page
        required: true
        in: query
        schema:
          type: number
      - name: limit
        required: true
        in: query
        schema:
          type: number
      - name: account_id
        required: true
        in: query
        schema:
          type: string
      - name: completed_only
        required: false
        in: query
        schema:
          type: boolean
      - name: types
        required: false
        in: query
        description: Filter by activity type
        schema:
          enum:
          - deposit
          - withdrawal
          - rebalance
          type: string
      responses:
        '200':
          description: ''
      security:
      - bearer: []
      summary: Get treasury activity feed (deposits, withdrawals + rebalances)
      tags:
      - Treasury
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
  /v1/treasury/balances:
    get:
      description: 'Get treasury balances grouped by currency. Each currency includes: available balance from managed accounts, pending review payment amounts, and rejected payment amounts. Optionally filter by specific currencies.'
      operationId: treasury_getTreasuryBalances
      parameters:
      - name: currency
        required: false
        in: query
        description: 'Filter by currency. Comma-separated for multiple values. Example: USDC,USDT'
        schema:
          example: USDC
          type: string
      - name: managed
        required: false
        in: query
        description: Filter by managed status. 'true' for managed accounts only, 'false' for non-managed only, omit for all accounts.
        schema:
          example: 'true'
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasuryBalancesResponseDto'
        '401':
          description: Authentication required or invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0004
                    error_message: Unauthorized
      security:
      - bearer: []
      summary: Get treasury balances
      tags:
      - Treasury
      x-internal: true
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
  /v1/treasury/deposits:
    get:
      description: Retrieve a paginated list of all deposits for the workspace.
      operationId: treasury_getDeposits
      parameters:
      - name: ids
        required: false
        in: query
        description: Filter by deposit IDs (comma-separated UUIDs)
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
      - name: to_account_id
        required: false
        in: query
        description: Filter by destination account ID (desired.to.account_id).
        schema:
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          type: string
      - name: page
        required: false
        in: query
        description: Page number for pagination (1-based)
        schema:
          type: integer
          minimum: 1
      - name: limit
        required: false
        in: query
        description: 'Number of items per page (default: 20)'
        schema:
          type: integer
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: Deposits retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDepositsResponse'
              example:
                data:
                - id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                  workspace_id: b53f6690-3242-4942-9907-885779632832
                  organization_reference_id: null
                  direction: inbound
                  desired:
                    from:
                      account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                      amount: '1000'
                      currency: USD
                      network: null
                    to:
                      account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                      amount: null
                      currency: USDC
                      network: null
                  estimated:
                    from:
                      account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                      amount: '1000'
                      currency: USD
                      network: null
                    to:
                      account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                      amount: '1000'
                      currency: USDC
                      network: null
                  actual:
                    from:
                      account_id: null
                      amount: null
                      currency: null
                      network: null
                    to:
                      account_id: null
                      amount: null
                      currency: null
                      network: null
                  steps:
                  - id: 8a4f2c1e-9b6d-4e35-b7a0-3c5d1e9f2b8a
                    deposit_id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                    step_sequence: 1
                    step_type: transfer
                    estimated:
                      from:
                        account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                        amount: '1000'
                        currency: USD
                        network: null
                      to:
                        account_id: a81bc1f4-7e3d-4926-b04f-3d2e8a9c5f17
                        amount: '1000'
                        currency: USD
                        network: null
                    actual:
                      from:
                        account_id: null
                        amount: null
                        currency: null
                        network: null
                      to:
                        account_id: null
                        amount: null
                        currency: null
                        network: null
                    transaction_hash: null
                    fees: []
                    provider_key: circle_mint
                    status: created
                    status_reasons: null
                    created_at: '2024-03-01T10:00:00.000Z'
                    updated_at: '2024-03-01T10:00:00.000Z'
                    submitted_at: null
                    confirmed_at: null
                    completed_at: null
                    failed_at: null
                  - id: 3b7e9d2f-1c4a-4f68-a5b0-6e8c1d3f9a2b
                    deposit_id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                    step_sequence: 1
                    step_type: transfer
                    estimated:
                      from:
                        account_id: a81bc1f4-7e3d-4926-b04f-3d2e8a9c5f17
                        amount: '1000'
                        currency: USD
                        network: null
                      to:
                        account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                        amount: '1000'
                        currency: USDC
                        network: null
                    actual:
                      from:
                        account_id: null
                        amount: null
                        currency: null
                        network: null
                      to:
                        account_id: null
                        amount: null
                        currency: null
                        network: null
                    transaction_hash: null
                    fees: []
                    provider_key: circle_mint
                    status: created
                    status_reasons: null
                    created_at: '2024-03-01T10:00:00.000Z'
                    updated_at: '2024-03-01T10:00:00.000Z'
                    submitted_at: null
                    confirmed_at: null
                    completed_at: null
                    failed_at: null
                  created_at: '2024-03-01T10:00:00.000Z'
                  updated_at: '2024-03-01T10:00:00.000Z'
                  expires_at: '2024-03-01T14:00:00.000Z'
                pagination:
                  page: 1
                  limit: 20
                  total: 1
                  total_pages: 1
                  has_next: false
                  has_prev: false
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: treasury-3134
                    error_message: Currency pair MXN → ETH is not supported for OpenFX deposits
                  - error_code: treasury-3135
                    error_message: Source bank currency 'USD' does not match deposit from_currency
                  - error_code: treasury-3136
                    error_message: Failed to obtain OpenFX quote for MXN → USDC
                  - error_code: treasury-3331
                    error_message: Amount 16 USD is below the provider's minimum tradable amount of 100 USD
                  - error_code: treasury-3332
                    error_message: Amount 30000000 USD is above the provider's maximum tradable amount of 25000000 USD
        '401':
          description: Authentication required or invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0004
                    error_message: Unauthorized
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0006
                    error_message: An unexpected error occurred
      security:
      - bearer: []
      summary: Get deposits
      tags:
      - Treasury
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
    post:
      description: Create a deposit payment and get deposit instructions.
      operationId: treasury_createDeposit
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDepositRequest'
            examples:
              default:
                summary: Create deposit
                value:
                  desired:
                    from:
                      account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                      amount: '1000'
                      currency: USD
                    to:
                      account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                      currency: USDC
      responses:
        '201':
          description: Deposit created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDepositResponse'
              example:
                data:
                  id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                  workspace_id: b53f6690-3242-4942-9907-885779632832
                  organization_reference_id: null
                  direction: inbound
                  desired:
                    from:
                      account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                      amount: '1000'
                      currency: USD
                      network: null
                    to:
                      account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                      amount: null
                      currency: USDC
                      network: null
                  estimated:
                    from:
                      account_id: null
                      amount: null
                      currency: null
                      network: null
                    to:
                      account_id: null
                      amount: null
                      currency: null
                      network: null
                  actual:
                    from:
                      account_id: null
                      amount: null
                      currency: null
                      network: null
                    to:
                      account_id: null
                      amount: null
                      currency: null
                      network: null
                  steps: []
                  created_at: '2024-03-01T10:00:00.000Z'
                  updated_at: '2024-03-01T10:00:00.000Z'
                  expires_at: '2024-03-01T14:00:00.000Z'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: treasury-3134
                    error_message: Currency pair MXN → ETH is not supported for OpenFX deposits
                  - error_code: treasury-3135
                    error_message: Source bank currency 'USD' does not match deposit from_currency
                  - error_code: treasury-3136
                    error_message: Failed to obtain OpenFX quote for MXN → USDC
                  - error_code: treasury-3331
                    error_message: Amount 16 USD is below the provider's minimum tradable amount of 100 USD
                  - error_code: treasury-3332
                    error_message: Amount 30000000 USD is above the provider's maximum tradable amount of 25000000 USD
        '401':
          description: Authentication required or invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0004
                    error_message: Unauthorized
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0006
                    error_message: An unexpected error occurred
      security:
      - bearer: []
      summary: Create deposit
      tags:
      - Treasury
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
  /v1/treasury/deposits/{id}:
    get:
      description: Retrieve a deposit payment by its unique identifier.
      operationId: treasury_getDeposit
      parameters:
      - name: id
        required: true
        in: path
        description: Deposit ID
        schema:
          type: string
      responses:
        '200':
          description: Deposit retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDepositResponse'
              examples:
                circle:
                  summary: Circle provider deposit
                  value:
                    data:
                      id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                      workspace_id: b53f6690-3242-4942-9907-885779632832
                      organization_reference_id: null
                      direction: inbound
                      desired:
                        from:
                          account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                          amount: '1000'
                          currency: USD
                          network: null
                        to:
                          account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                          amount: null
                          currency: USDC
                          network: null
                      estimated:
                        from:
                          account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                          amount: '1000'
                          currency: USD
                          network: null
                        to:
                          account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                          amount: '1000'
                          currency: USDC
                          network: null
                      actual:
                        from:
                          account_id: null
                          amount: null
                          currency: null
                          network: null
                        to:
                          account_id: null
                          amount: null
                          currency: null
                          network: null
                      steps:
                      - id: 8a4f2c1e-9b6d-4e35-b7a0-3c5d1e9f2b8a
                        deposit_id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                        step_sequence: 1
                        step_type: transfer
                        estimated:
                          from:
                            account_id: 55042f8f-e527-56f1-b57c-eef23ca862db
                            amount: '1000'
                            currency: USD
                            network: null
                          to:
                            account_id: a81bc1f4-7e3d-4926-b04f-3d2e8a9c5f17
                            amount: '1000'
                            currency: USD
                            network: null
                        actual:
                          from:
                            account_id: null
                            amount: null
                            currency: null
                            network: null
                          to:
                            account_id: null
                            amount: null
                            currency: null
                            network: null
                        transaction_hash: null
                        fees: []
                        provider_key: circle_mint
                        status: created
                        status_reasons: null
                        created_at: '2024-03-01T10:00:00.000Z'
                        updated_at: '2024-03-01T10:00:00.000Z'
                        submitted_at: null
                        confirmed_at: null
                        completed_at: null
                        failed_at: null
                      - id: 3b7e9d2f-1c4a-4f68-a5b0-6e8c1d3f9a2b
                        deposit_id: 1c8e4a6f-9b2d-4f53-a0e7-5d3c1b9f2a8e
                        step_sequence: 1
                        step_type: transfer
                        estimated:
                          from:
                            account_id: a81bc1f4-7e3d-4926-b04f-3d2e8a9c5f17
                            amount: '1000'
                            currency: USD
                            network: null
                          to:
                            account_id: 44031e7e-d416-45f0-a46b-ded12b9751ca
                            amount: '1000'
                            currency: USDC
                            network: null
                        actual:
                          from:
                            account_id: null
                            amount: null
                            currency: null
                            network: null
                          to:
                            account_id: null
                            amount: null
                            currency: null
                            network: null
                        transaction_hash: null
                        fees: []
                        provider_key: circle_mint
                        status: created
                        status_reasons: null
                        created_at: '2024-03-01T10:00:00.000Z'
                        updated_at: '2024-03-01T10:00:00.000Z'
                        submitted_at: null
                        confirmed_at: null
                        completed_at: null
                        failed_at: null
                      created_at: '2024-03-01T10:00:00.000Z'
                      updated_at: '2024-03-01T10:00:00.000Z'
                      expires_at: '2024-03-01T14:00:00.000Z'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: counterparties-3001
                    error_message: 'classification must be one of: individual, business'
                  - error_code: counterparties-3002
                    error_message: business_legal_name is required when classification is business
        '401':
          description: Authentication required or invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0004
                    error_message: Unauthorized
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0001
                    error_message: Resource not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: api-0006
                    error_message: An unexpected error occurred
      security:
      - bearer: []
      summary: Get deposit by ID
      tags:
      - Treasury
      x-zuplo-route:
        corsPolicy: anything-goes
        handler:
          export: forwardToBackend
          module: $import(./modules/forward-to-backend)
        policies:
          inbound:
          - set-backend-secret-inbound
          - auth0-jwt-auth-inbound
          - forward-user-info-inbound
  /v1/treasury/deposits/{id}/instructions:
    get:
      description: 'Get deposit instructions for an existing deposit.


        '
      operationId: treasury_getDepositInstructions
      parameters:
      - name: id
        required: true
        in: path
        description: Deposit ID
        schema:
          type: string
      responses:
        '200':
          description: Deposit instructions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepositInstructionsResponse'
              example:
                data:
                  from_account:
                    id: 55042f8f-e527-56f1-b57c-eef23ca862db
                    name: Acme Corp Operating Account
                    bank_name: Chase Bank
                    bank_account_number: '845748459212'
                    bank_code_type: ROUTING
                    bank_identifier_code: '021000021'
                    bank_swift_code: CHASUS33XXX
                  to_account:
                    id: 7a4c2d8e-1b5f-4e69-a7d1-3f8e5c2b9a0d
                    name: Circle USD Wire Deposit Account
                    bank_name: STANDARD CHARTERED BANK
                    bank_account_number: '11001259978'
                    bank_code_type: ROUTING
                    bank_identifier_code: '322286803'
                    bank_swift_code: SCBLSG22XXX
                    tracking_reference: CIR24K2SK3
                    belongs_to:
                      business_legal_name: CIRCLE INTERNET FINANCIAL INC
                      business_street_address1: 99 HIGH STREET
                      business_street_address2: LEVEL 17 SUITE 1701
                      business_city: BOSTON
                      business_state: MA
                      business_postal_code: '02110'
                      business_country: US
                  amount: '1000'
                  currency: USD
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          type: string
                        error_message:
                          type: string
                      required:
                      - error_code
                      - error_message
                required:
                - errors
                example:
                  errors:
                  - error_code: counterparties-3001
                    error_message: 'classification must be one of: individual, business'
                  - error_code: counterparties-3002
                    error_message: business_legal_name is required when classification is business
        '401':
          description: Authentication required or invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        error_code:
                          ty

# --- truncated at 32 KB (162 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tesser/refs/heads/main/openapi/tesser-treasury-api-openapi.yml