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

# Withdraw to counterparty Id

<Tabs groupId="programming-language">
  <Tab value="Java" title="Java">
    ```java theme={null}
    TransfersService transfersService = IntxServiceFactory.createTransfersService(client);
    WithdrawToCounterpartyIdRequest request = new WithdrawToCounterpartyIdRequest.Builder()
        .portfolio("portfolio_id")
        .counterpartyId("counterparty_id")
        .asset("BTC")
        .amount("1")
        .build();
    WithdrawToCounterpartyIdResponse response = transfersService.withdrawToCounterpartyId(request);
    ```

    For more information, please visit the [INTX Java SDK](https://github.com/coinbase-samples/intx-sdk-java).
  </Tab>

  <Tab value=".NET" title=".NET">
    ```cs theme={null}
    var transfersService = new TransfersService(client);
    var request = new WithdrawToCounterpartyIdRequest(
        Portfolio: "portfolio_id",
        CounterpartyId: "counterparty_id",
        Asset: "BTC",
        Amount: "1",
    );
    var response = transfersService.WithdrawToCounterpartyId(request);
    ```

    For more information, please visit the [INTX .NET SDK](https://github.com/coinbase-samples/intx-sdk-dotnet).
  </Tab>

  <Tab value="Go" title="Go">
    ```go theme={null}
    transfersSvc := transfers.NewTransfersService(client)
    request := &transfers.CreateWithdrawalToCounterpartyIdRequest{
        Portfolio: "portfolio_id",
        CounterpartyId: "counterparty_id",
        Asset: "BTC",
        Amount: "1",
    }
    response, err := transfersSvc.CreateWithdrawalToCounterpartyId(context.Background(), request)
    ```

    For more information, please visit the [INTX Go SDK](https://github.com/coinbase-samples/intx-sdk-go).
  </Tab>

  <Tab value="Python" title="Python">
    ```python theme={null}
    client = IntxClient()
    request = WithdrawToCounterpartyIdRequest(
        portfolio="portfolio_id",
        counterparty_id="counterparty_id",
        asset="BTC",
        amount="1",
    )
    response = client.withdraw_to_counterparty_id(request)
    ```

    For more information, please visit the [INTX Python SDK](https://github.com/coinbase-samples/intx-sdk-py).
  </Tab>

  <Tab value="Typescript" title="TS/JS">
    ```js theme={null}
    const transfersService = new TransfersService(client);

    transfersService.withdrawToCounterparty({
        portfolio: 'PORTFOLIO_ID_HERE',
        counterpartyId: 'COUNTERPARTY_ID_HERE',
        asset: 'BTC',
        amount: "1",
        nonce: 12345
    }).then(async (response) => {
        console.log('Withdrawal created: ', response);
    })
    ```

    For more information, please visit the [INTX TS SDK](https://github.com/coinbase-samples/intx-sdk-ts).
  </Tab>

  <Tab value="CLI" title="CLI">
    ```
    intxctl create-withdrawal-to-counterparty-id --help
    ```

    For more information, please visit the [INTX CLI](https://github.com/coinbase-samples/intx-cli).
  </Tab>
</Tabs>


## OpenAPI

````yaml POST /api/v1/transfers/withdraw/counterparty
openapi: 3.0.3
info:
  title: REST API
  description: >
    # Welcome to Coinbase INTX API

    ## Introduction

    The INTX APIs allow institutions to trade and manage orders on the
    International Exchange. The following API pages detail various REST API
    endpoints we offer.

    ## Getting Started

    To get started, please visit one of the following pages:

    - [Quickstart](/international-exchange/introduction/quickstart)

    -
    [Overview](/api-reference/international-exchange-api/rest-api/introduction)

    -
    [Authentication](/api-reference/international-exchange-api/rest-api/authentication)

    - [Rate Limits](/international-exchange/introduction/rate-limits-overview)

    ## FIX API

    - [FIX API reference](/international-exchange/fix-api/fix-api-overview)

    ## WebSocket API

    - [WebSocket API
    reference](/international-exchange/websocket-feed/websocket-overview)
  version: '1.0'
servers:
  - url: https://api.international.coinbase.com
security: []
paths:
  /api/v1/transfers/withdraw/counterparty:
    post:
      tags:
        - Transfers
      summary: Withdraw to counterparty Id
      operationId: counterpartyWithdraw
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - portfolio
                - counterparty_id
                - asset
                - amount
                - nonce
              properties:
                portfolio:
                  description: >-
                    Identifies the portfolio to withdraw from by UUID (e.g.,
                    `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID
                    (e.g., `5189861793641175`)
                  type: string
                counterparty_id:
                  description: Counterparty Id to withdraw to
                  type: string
                  example: CBTQDGENHE
                asset:
                  description: >-
                    Identifies the asset by name (e.g., `BTC`), UUID (e.g.,
                    `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g.,
                    `1482439423963469`)
                  type: string
                amount:
                  description: The amount of the asset being transferred
                  type: string
                nonce:
                  description: >-
                    A unique positive integer representing the withdrawal
                    request
                  type: integer
                  example: 30
      responses:
        '200':
          description: Counterparty withdrawal initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCounterpartyWithdrawResult_v1'
        '400':
          description: Counterparty withdrawal Failed
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
components:
  schemas:
    CreateCounterpartyWithdrawResult_v1:
      type: object
      properties:
        idem:
          description: Idempotent UUID representing the successful withdraw
          type: string
          example: 253b30a5-9b03-4cd2-9c76-d0f32b2bd733
        portfolio_uuid:
          description: UUID for the portfolio where the withdraw was initiated
          type: string
          format: uuid
          example: 3d50e347-6a59-4965-a4cd-b25934d84126
        source_counterparty_id:
          description: Counterparty Id of the source portfolio
          type: string
          example: CBTQDGENHE
        target_counterparty_id:
          description: Counterparty Id of the target portfolio
          type: string
          example: CBA6POFJW7
        asset:
          description: The asset being transferred
          type: string
          example: USDC
        amount:
          description: The amount of the asset being transferred
          type: string
          example: 5100.5
  securitySchemes:
    auth_client_id:
      type: apiKey
      name: CB-ACCESS-KEY
      in: header
      description: The Client ID that owns the API Key for the request
    auth_passphrase:
      type: apiKey
      name: CB-ACCESS-PASSPHRASE
      in: header
      description: The pass phrase affiliated with the API Key
    auth_signature:
      type: apiKey
      name: CB-ACCESS-SIGN
      in: header
      description: >-
        A HMAC SHA-256 signature using the API Key secret on the string
        TIMESTAMP, METHOD, REQUEST_PATH, BODY
    auth_timestamp:
      type: apiKey
      name: CB-ACCESS-TIMESTAMP
      in: header
      description: The timestamp of when the request is being made

````