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

# Transfer Inventory

> This endpoint transfers inventory between warehouses or locations.

### Body

<ParamField body="inventory_item_id" type="string">
  The unique identifier of the inventory item to transfer
</ParamField>

<ParamField body="quantity" type="number">
  The quantity to transfer
</ParamField>

<ParamField body="from_warehouse_id" type="string">
  The source warehouse ID
</ParamField>

<ParamField body="from_location_id" type="string">
  The source location within the warehouse
</ParamField>

<ParamField body="to_warehouse_id" type="string">
  The destination warehouse ID
</ParamField>

<ParamField body="to_location_id" type="string">
  The destination location within the warehouse
</ParamField>

<ParamField body="transfer_reason" type="string">
  The reason for the transfer (e.g., "rebalancing", "fulfillment", "returns\_processing")
</ParamField>

<ParamField body="priority" type="string">
  Transfer priority (e.g., "standard", "expedited", "urgent")
</ParamField>

<ParamField body="expected_arrival" type="string">
  Expected arrival date at destination
</ParamField>

### Response

<ResponseField name="id" type="string">
  The unique identifier of the transfer record
</ResponseField>

<ResponseField name="transfer_number" type="string">
  The system-generated transfer number for tracking
</ResponseField>

<ResponseField name="inventory_item_id" type="string">
  The inventory item being transferred
</ResponseField>

<ResponseField name="quantity" type="number">
  The quantity being transferred
</ResponseField>

<ResponseField name="from_warehouse" type="object">
  Source warehouse details

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Warehouse ID
    </ResponseField>

    <ResponseField name="name" type="string">
      Warehouse name
    </ResponseField>

    <ResponseField name="location_id" type="string">
      Location within warehouse
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="to_warehouse" type="object">
  Destination warehouse details

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Warehouse ID
    </ResponseField>

    <ResponseField name="name" type="string">
      Warehouse name
    </ResponseField>

    <ResponseField name="location_id" type="string">
      Location within warehouse
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="status" type="string">
  Transfer status (e.g., "pending", "in\_transit", "completed", "cancelled")
</ResponseField>

<ResponseField name="created_at" type="string">
  Timestamp when the transfer was created
</ResponseField>

<ResponseField name="success" type="boolean">
  Indicates whether the transfer was initiated successfully
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/inventory_items/:id/transfer' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "inventory_item_id": "inv_abc123",
      "quantity": 50,
      "from_warehouse_id": "wh_east_01",
      "from_location_id": "loc_a1_shelf_3",
      "to_warehouse_id": "wh_west_01",
      "to_location_id": "loc_b2_shelf_1",
      "transfer_reason": "rebalancing",
      "priority": "standard",
      "expected_arrival": "2024-01-20"
  }'
  ```

  ```graphQL GraphQL theme={null}
  mutation inventoryTransferMutation {
    inventoryTransfer(
      inventoryItemId: "${inventoryItemId}",
      quantity: ${quantity},
      fromWarehouseId: "${fromWarehouseId}",
      fromLocationId: "${fromLocationId}",
      toWarehouseId: "${toWarehouseId}",
      toLocationId: "${toLocationId}",
      transferReason: "${transferReason}",
      priority: "${priority}",
      expectedArrival: "${expectedArrival}"
    ) {
      transfer {
        id
        transfer_number
        quantity
        status
        from_warehouse {
          id
          name
        }
        to_warehouse {
          id
          name
        }
      }
      userErrors {
        field
        message
      }
    }
  }
  ```

  ```js Node.js theme={null}
  const transfer = await stateset.inventory.transfer({
    inventory_item_id: 'inv_abc123',
    quantity: 50,
    from_warehouse_id: 'wh_east_01',
    from_location_id: 'loc_a1_shelf_3',
    to_warehouse_id: 'wh_west_01',
    to_location_id: 'loc_b2_shelf_1',
    transfer_reason: 'rebalancing',
    priority: 'standard',
    expected_arrival: '2024-01-20'
  });
  ```

  ```python Python theme={null}
  transfer = stateset.inventory.transfer({
    'inventory_item_id': 'inv_abc123',
    'quantity': 50,
    'from_warehouse_id': 'wh_east_01',
    'from_location_id': 'loc_a1_shelf_3',
    'to_warehouse_id': 'wh_west_01',
    'to_location_id': 'loc_b2_shelf_1',
    'transfer_reason': 'rebalancing',
    'priority': 'standard',
    'expected_arrival': '2024-01-20'
  })
  ```

  ```ruby Ruby theme={null}
  transfer = Stateset::Inventory.transfer({
    inventory_item_id: 'inv_abc123',
    quantity: 50,
    from_warehouse_id: 'wh_east_01',
    from_location_id: 'loc_a1_shelf_3',
    to_warehouse_id: 'wh_west_01',
    to_location_id: 'loc_b2_shelf_1',
    transfer_reason: 'rebalancing',
    priority: 'standard',
    expected_arrival: '2024-01-20'
  })
  ```

  ```go Go theme={null}
  transfer, err := stateset.Inventory.transfer({
    InventoryItemID: 'inv_abc123',
    Quantity: 50,
    FromWarehouseID: 'wh_east_01',
    FromLocationID: 'loc_a1_shelf_3',
    ToWarehouseID: 'wh_west_01',
    ToLocationID: 'loc_b2_shelf_1',
    TransferReason: 'rebalancing',
    Priority: 'standard',
    ExpectedArrival: '2024-01-20'
  })
  ```

  ```java Java theme={null}
  InventoryTransfer transfer = stateset.inventory.transfer({
    inventoryItemId: 'inv_abc123',
    quantity: 50,
    fromWarehouseId: 'wh_east_01',
    fromLocationId: 'loc_a1_shelf_3',
    toWarehouseId: 'wh_west_01',
    toLocationId: 'loc_b2_shelf_1',
    transferReason: 'rebalancing',
    priority: 'standard',
    expectedArrival: '2024-01-20'
  });
  ```

  ```php PHP theme={null}
  $transfer = $stateset->inventory->transfer([
    'inventory_item_id' => 'inv_abc123',
    'quantity' => 50,
    'from_warehouse_id' => 'wh_east_01',
    'from_location_id' => 'loc_a1_shelf_3',
    'to_warehouse_id' => 'wh_west_01',
    'to_location_id' => 'loc_b2_shelf_1',
    'transfer_reason' => 'rebalancing',
    'priority' => 'standard',
    'expected_arrival' => '2024-01-20'
  ]);
  ```

  ```csharp C# theme={null}
  var transfer = await stateset.Inventory.Transfer(new {
    InventoryItemId = 'inv_abc123',
    Quantity = 50,
    FromWarehouseId = 'wh_east_01',
    FromLocationId = 'loc_a1_shelf_3',
    ToWarehouseId = 'wh_west_01',
    ToLocationId = 'loc_b2_shelf_1',
    TransferReason = 'rebalancing',
    Priority = 'standard',
    ExpectedArrival = '2024-01-20'
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "trans_xyz456",
    "transfer_number": "TRF-2024-0001",
    "inventory_item_id": "inv_abc123",
    "quantity": 50,
    "from_warehouse": {
      "id": "wh_east_01",
      "name": "East Coast Warehouse",
      "location_id": "loc_a1_shelf_3"
    },
    "to_warehouse": {
      "id": "wh_west_01",
      "name": "West Coast Warehouse",
      "location_id": "loc_b2_shelf_1"
    },
    "transfer_reason": "rebalancing",
    "priority": "standard",
    "status": "in_transit",
    "expected_arrival": "2024-01-20",
    "created_at": "2024-01-15T10:00:00Z",
    "created_by": "user_123",
    "success": true
  }
  ```

  ```json Error Response theme={null}
  {
    "error": {
      "code": "insufficient_inventory",
      "message": "Not enough inventory available for transfer. Available: 30, Requested: 50",
      "details": {
        "available_quantity": 30,
        "requested_quantity": 50,
        "warehouse_id": "wh_east_01"
      }
    }
  }
  ```
</ResponseExample>
