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

# Relay a Polymarket deposit-wallet withdrawal

> Relay a user-signed Polymarket deposit-wallet `WALLET` batch (approve/unwrap pUSD or transfer USDC.e) through the Polymarket relayer using server-held builder credentials. Submitted calls must target known Polymarket contracts.



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json post /polymarket/withdraw
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Cross-chain deposit processing service with automatic token bridging and gas
    sponsorship
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /polymarket/withdraw:
    post:
      tags:
        - Processing
      summary: Relay a Polymarket deposit-wallet withdrawal
      description: >-
        Relay a user-signed Polymarket deposit-wallet `WALLET` batch
        (approve/unwrap pUSD or transfer USDC.e) through the Polymarket relayer
        using server-held builder credentials. Submitted calls must target known
        Polymarket contracts.
      parameters:
        - schema:
            type: string
            description: API key for authentication
            example: your-api-key
          required: true
          description: API key for authentication
          name: x-api-key
          in: header
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}\.[a-z0-9]+$
            description: >-
              API version identifier (e.g. "2026-04.amazon"). Optional today,
              will become required in a future release.
            example: 2026-04.amazon
          required: false
          description: >-
            API version identifier (e.g. "2026-04.amazon"). Optional today, will
            become required in a future release.
          name: x-api-version
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolymarketWithdrawRequestBody'
      responses:
        '200':
          description: Withdrawal relayed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolymarketWithdrawResponse'
        '400':
          description: Invalid request, disallowed call, or unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: API key lacks required deposits scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Polymarket relayer rejected or failed the batch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Polymarket builder credentials not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PolymarketWithdrawRequestBody:
      type: object
      properties:
        depositWallet:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        owner:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        nonce:
          type: string
          pattern: ^\d+$
          description: Numeric string representing a bigint value
          example: '1000000000000000000'
        deadline:
          type: string
          pattern: ^\d+$
          description: Numeric string representing a bigint value
          example: '1000000000000000000'
        calls:
          type: array
          items:
            $ref: '#/components/schemas/PolymarketCall'
          minItems: 1
        signature:
          type: string
          pattern: ^0x[a-fA-F0-9]+$
          description: Hex-encoded string (0x followed by hex characters)
          example: '0x1234abcd'
      required:
        - depositWallet
        - owner
        - nonce
        - deadline
        - calls
        - signature
    PolymarketWithdrawResponse:
      type: object
      properties:
        message:
          type: string
        txHash:
          type: string
          pattern: ^0x[a-fA-F0-9]+$
          description: Hex-encoded string (0x followed by hex characters)
          example: '0x1234abcd'
      required:
        - message
        - txHash
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              code:
                type: string
            required:
              - message
      required:
        - error
    PolymarketCall:
      type: object
      properties:
        target:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        value:
          type: string
          pattern: ^\d+$
          description: Numeric string representing a bigint value
          example: '1000000000000000000'
        data:
          type: string
          pattern: ^0x[a-fA-F0-9]+$
          description: Hex-encoded string (0x followed by hex characters)
          example: '0x1234abcd'
      required:
        - target
        - value
        - data

````