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

# Transfer positions between portfolios

> Transfer an existing position from one portfolio to another. The position transfer must fulfill the same portfolio-level margin requirements as submitting a new order on the opposite side for the sender's portfolio and a new order on the same side  for the recipient's portfolio. Additionally, organization-level requirements must be satisfied when evaluating the outcome of the position transfer.

## API Key Permissions

This endpoint requires an API key with `trade` permission.

<Tabs groupId="programming-language">
  <Tab value="Java" title="Java">
    ```java theme={null}
    PortfoliosService portfoliosService = IntxServiceFactory.createPortfoliosService(client);
    TransferPositionsRequest request = new TransferPositionsRequest.Builder()
        .from("portfolio_id_1")
        .to("portfolio_id_2")
        .instrument("BTC-PERP")
        .amount("1")
        .build();
    TransferPositionsResponse response = portfoliosService.transferPositions(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 portfoliosService = new PortfoliosService(client);
    var request = new TransferPositionsRequest(
        From: "portfolio_id_1",
        To: "portfolio_id_2",
        Instrument: "BTC-PERP",
        Amount: "1",
    );
    var response = portfoliosService.TransferPositions(request);
    ```

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

  <Tab value="Python" title="Python">
    ```python theme={null}
    client = IntxClient()
    request = TransferPositionRequest(
        from="portfolio_id_1",
        to="portfolio_id_2",
        instrument="BTC-PERP",
        amount="1",
    )
    response = client.transfer_positions(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 portfoliosService = new PortfoliosService(client);

    portfoliosService.createTransferPosition({
        from: 'portfolio_id_1',
        to: 'portfolio_id_2',
        instrument: 'ETH-PERP',
        amount: '1',
    }).then(async (response) => {
        console.log('Transfer Created: ', response);
    })
    ```

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


## OpenAPI

````yaml POST /api/v1/portfolios/transfer-position
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/portfolios/transfer-position:
    post:
      tags:
        - Portfolios
      summary: Transfer positions between portfolios
      description: >-
        Transfer an existing position from one portfolio to another. The
        position transfer must fulfill the same portfolio-level margin
        requirements as submitting a new order on the opposite side for the
        sender's portfolio and a new order on the same side  for the recipient's
        portfolio. Additionally, organization-level requirements must be
        satisfied when evaluating the outcome of the position transfer.
      operationId: createPortfolioPositionTransfer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - instrument
                - quantity
                - side
              properties:
                from:
                  description: >-
                    Identifies the portfolio by UUID (e.g.,
                    `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID
                    (e.g., `5189861793641175`) to transfer positions from
                  type: string
                to:
                  description: >-
                    Identifies the portfolio by UUID (e.g.,
                    `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID
                    (e.g., `5189861793641175`) to transfer positions to
                  type: string
                instrument:
                  description: >-
                    Identifies the instrument by name (e.g., `BTC-PERP`), UUID
                    (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or
                    instrument ID (e.g., `1482439423963469`)
                  type: string
                quantity:
                  description: >-
                    The full or partial quantity of the position being
                    transferred
                  type: string
                side:
                  description: The side of the position being transferred, BUY or SELL
                  type: string
      responses:
        '200':
          description: Transfer processed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    description: true if the transfer was successful
                    type: boolean
                    example: true
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
components:
  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

````