> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payunifi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get custodial bulk-payment inputs

> Returns balances, BundlePay allowances, gas data, and prices for the selected stablecoins on one chain.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}
openapi: 3.0.3
info:
  title: UniFi Public API
  version: 1.0.0
  description: >-
    Production API operations organized around the UniFi payment lifecycle.
    Internal administration, worker, dashboard, support, scheduling, and Falcon
    orchestration routes are intentionally excluded.
servers:
  - url: https://api.payunifi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Check API process availability and dependency health.
  - name: Deposit
    description: Resolve deposit addresses for a UniFi wallet.
  - name: Wallet
    description: Read stablecoin balances across wallets and chains.
  - name: Preflight
    description: >-
      Check balances, allowances, and estimated fees before submitting a
      payment.
  - name: Pay
    description: Create managed-wallet, merchant, and self-custodial payments.
  - name: History
    description: Track payment sessions, receipts, finality, and history.
paths:
  /v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}:
    post:
      tags:
        - Preflight
      summary: Get custodial bulk-payment inputs
      description: >-
        Returns balances, BundlePay allowances, gas data, and prices for the
        selected stablecoins on one chain.
      operationId: getManagedWalletBulkPaymentInputs
      parameters:
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/Chain'
        - $ref: '#/components/parameters/FetchContacts'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkPreOcpRequest'
            example:
              coins:
                - USDT
                - USDC
      responses:
        '200':
          description: Raw custodial inputs for the selected stablecoins.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkPreOcpResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    UserId:
      name: user_id
      in: path
      required: true
      schema:
        type: string
      description: >-
        UniFi user identifier, such as a verified email address or wallet
        address.
    Chain:
      name: chain
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Chain'
      description: Blockchain network.
    FetchContacts:
      name: fetch_contacts
      in: query
      required: false
      schema:
        type: boolean
        default: false
      description: >-
        When true, include the first saved-recipient page for the selected chain
        protocol.
  schemas:
    BulkPreOcpRequest:
      type: object
      required:
        - coins
      properties:
        coins:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/Stablecoin'
      additionalProperties: false
    BulkPreOcpResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
        data:
          $ref: '#/components/schemas/BulkPreOcpValues'
    Chain:
      type: string
      enum:
        - Ethereum
        - Polygon
        - Sepolia
      description: >-
        Production-supported mainnets and public testnets exposed by the public
        reference.
    Stablecoin:
      type: string
      enum:
        - USDT
        - USDC
        - DAI
    BulkPreOcpValues:
      type: object
      required:
        - coin_entries
        - gas_price
        - gas_token_price
      properties:
        coin_entries:
          type: array
          items:
            $ref: '#/components/schemas/BulkPreOcpCoin'
        gas_price:
          type: integer
          minimum: 0
          description: Current gas price in wei.
        gas_token_price:
          type: number
          format: double
          description: Current gas-token price in USD.
        contacts:
          type: array
          items:
            type: object
            additionalProperties: true
        contacts_total:
          type: integer
          format: int64
          minimum: 0
        contacts_next_cursor:
          type: string
          nullable: true
    BulkPreOcpCoin:
      type: object
      required:
        - coin
        - balance
        - allowance
        - coin_price
      properties:
        coin:
          $ref: '#/components/schemas/Stablecoin'
        balance:
          type: string
          description: Human-readable spendable balance.
        allowance:
          type: string
          description: Raw base-unit allowance to BundlePay or Permit2.
        coin_price:
          type: number
          format: double
          description: Stablecoin price in USD.
      additionalProperties: false
  responses:
    BadRequest:
      description: The request is invalid or cannot be completed in the current state.
      content:
        text/plain:
          schema:
            type: string
    Unauthorized:
      description: >-
        The bearer credential is missing, invalid, or not authorized for this
        user.
      content:
        text/plain:
          schema:
            type: string
    NotFound:
      description: The requested resource does not exist.
      content:
        text/plain:
          schema:
            type: string
    Conflict:
      description: The operation conflicts with the resource's current state.
      content:
        text/plain:
          schema:
            type: string
    RateLimited:
      description: The credential has exceeded its current request allowance.
      content:
        text/plain:
          schema:
            type: string
    ServerError:
      description: The API could not complete the request.
      content:
        text/plain:
          schema:
            type: string
    Unavailable:
      description: A required dependency is temporarily unavailable.
      content:
        text/plain:
          schema:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Use a UniFi API key generated from the web app and stored server-side.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.