have you found a solution for this in the meantime? I'm facing the same issue right now, but can't find any useful API. My best guess was the WTPartHelper.service.replacePartAssemblies() but don't really work for me.
Actually, the WTPartHelper.service.replacePartAssembliesis working fine if you haveWTPartMasteras the parent and as the child in a BOM relation.
In other cases, you should look for the WTPartUsageLinkobject, which is representing the BOM relation between the parent and child, and set the replacement part as child for the foundWTPartUsageLink object.