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

# Create or get a deposit account (idempotent)

> Idempotent on (integrator_id, wallet_id, source_currency, destination_currency). Returns the existing deposit account if one matches, otherwise provisions a Bridge Virtual Account whose destination = the requested wallet and persists the result. Per ONR-04 + Phase 11 polish (multi-stablecoin).



## OpenAPI

````yaml /api-reference/openapi.json post /payout/onramp/deposit-accounts
openapi: 3.0.0
info:
  title: Relayer
  description: >-
    Relayer API — Kit-based crypto infrastructure for OTC exchange, wallet
    signing, payouts, and widget actions.
  version: '1.0'
  contact: {}
servers:
  - url: https://testnet.relayer.fi/v1
    description: Sandbox (testnet wallets, no real fiat)
  - url: https://api.relayer.fi/v1
    description: Production (mainnet wallets, regulated fiat rails)
security:
  - api-key: []
tags:
  - name: 'Action: Builders'
    description: Transaction metadata builders
  - name: 'Action: Directory'
    description: Widget directory
  - name: 'Action: Execute'
  - name: 'Action: Tokens'
    description: Token lists per chain/protocol
  - name: Addresses
  - name: Agents
  - name: App
    description: Application endpoints
  - name: 'Payout: Accounts'
    description: Payment execution
  - name: 'Payout: Off-ramp'
  - name: 'Payout: On-ramp'
  - name: 'Payout: Orders'
  - name: 'Payout: Recipients'
    description: Beneficiary management
  - name: Signing - Passkeys
  - name: Signing - Recovery
  - name: Signing Approvals
    description: Transaction signing approvals
  - name: Signing Policies
    description: Signing policy management
  - name: Transactions
    description: Transaction signing and broadcasting
  - name: Wallets
    description: Wallet and address management
paths:
  /payout/onramp/deposit-accounts:
    post:
      tags:
        - 'Payout: On-ramp'
      summary: Create or get a deposit account (idempotent)
      description: >-
        Idempotent on (integrator_id, wallet_id, source_currency,
        destination_currency). Returns the existing deposit account if one
        matches, otherwise provisions a Bridge Virtual Account whose destination
        = the requested wallet and persists the result. Per ONR-04 + Phase 11
        polish (multi-stablecoin).
      operationId: OnrampController_createDepositAccount
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDepositAccountDto'
      responses:
        '201':
          description: >-
            Deposit account created (or already existed for this
            integrator/wallet/currency)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepositAccountResponseDto'
        '400':
          description: Validation failed, KYC/KYB not complete, or unsupported wallet chain
        '404':
          description: Wallet not found for this integrator
      security:
        - bearer: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -X POST
            https://api.relayer.fi/v1/payout/onramp/deposit-accounts \
              -H "Authorization: ApiKey $RELAYER_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "currency":      "mxn",
                "country":       "MX",
                "stablecoin":    "usdc",
                "chain":         "base",
                "destinationAddress": "0xYourWallet..."
              }'
        - lang: TypeScript
          label: Node.js
          source: >-
            const response = await
            fetch("https://api.relayer.fi/v1/payout/onramp/deposit-accounts", {
              method: "POST",
              headers: {
                Authorization: `ApiKey ${process.env.RELAYER_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                currency: "mxn",
                country: "MX",
                stablecoin: "usdc",
                chain: "base",
                destinationAddress: yourWalletAddress,
              }),
            });

            const { data } = await response.json();

            // data.clabe — the fiat deposit account. Idempotent.

            // data.id — pass to GET /payout/onramp/deposit-accounts/{id}/events
            for tracking.
components:
  schemas:
    CreateDepositAccountDto:
      type: object
      properties:
        wallet_id:
          type: string
          description: >-
            Wallet identifier. Accepts either the local UUID v4
            (signing.wallets.id) OR the Turnkey wallet id (e.g.
            "wallet-abc123def456"). The on-ramp service resolves both forms via
            the wallet repository.
          example: wallet-abc123def456
        source_currency:
          type: string
          description: Source fiat currency the depositor will send
          enum:
            - usd
            - eur
            - mxn
            - brl
            - gbp
          example: usd
        destination_currency:
          type: string
          description: >-
            Destination stablecoin to receive in the wallet. Defaults to "usdc"
            if omitted (Phase 10 contract). Allowed: usdc, usdt — the rest of
            the Bridge stablecoin set is deferred until liquidity / icon
            coverage justifies it.
          enum:
            - usdc
            - usdt
          example: usdc
          default: usdc
        chain:
          type: string
          description: >-
            Target chain for on-ramp destination. When supplied, the deposit
            account is scoped to this network. Omit to use the wallet's default
            (back-compat with pre-Phase-39 callers).
          enum:
            - base
            - polygon
            - avalanche_c_chain
            - optimism
            - arbitrum
            - ethereum
            - solana
          example: avalanche_c_chain
      required:
        - wallet_id
        - source_currency
    DepositAccountResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Deposit account UUID (payout.deposit_accounts.id)
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        reference:
          type: string
          description: >-
            Friendly URL-safe reference (ONR-YYYYMMDD-XXXX). Backs
            /orders/<reference> lookups via OrdersService.parseOrderId.
            Populated since migration 0053.
          example: ONR-20260505-0001
        integrator_id:
          type: string
          description: Owning integrator UUID (always equals the authenticated caller)
          example: 7f1c5fc8-2a45-4cb0-9d3a-9b9c5b9a9b9c
        wallet_id:
          type: string
          description: Destination wallet UUID (signing.wallets.id)
          example: 6f1c5fc8-2a45-4cb0-9d3a-9b9c5b9a9b9c
        source_currency:
          type: string
          description: Source fiat currency the depositor will send
          enum:
            - usd
            - eur
            - mxn
            - brl
            - gbp
          example: usd
        bridge_virtual_account_id:
          type: string
          description: >-
            Bridge Virtual Account id — used by webhooks to route lifecycle
            events
          example: va_01h5x...
        destination_payment_rail:
          type: string
          description: Crypto rail the funds settle on (e.g. base, solana)
          example: base
        destination_currency:
          type: string
          description: Crypto destination currency (e.g. usdc)
          example: usdc
        destination_address:
          type: string
          description: On-chain destination address (the wallet account address)
          example: 0xAbC...123
        source_deposit_instructions:
          type: object
          description: >-
            Bank rails / routing / clabe / iban — varies per source_currency.
            Raw Bridge `source_deposit_instructions` payload. May be null if
            Bridge has not yet returned instructions.
          additionalProperties: true
          nullable: true
        status:
          type: string
          description: Lifecycle status. `active` = ready to receive deposits.
          enum:
            - active
            - deactivated
          example: active
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - reference
        - integrator_id
        - wallet_id
        - source_currency
        - bridge_virtual_account_id
        - destination_payment_rail
        - destination_currency
        - destination_address
        - source_deposit_instructions
        - status
        - created_at
        - updated_at
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use this format: `ApiKey <your_api_key>`'

````