A magnetic piston shoe pair for an axial piston pump and a motor, comprising a primary iron core, two secondary iron cores, coils, a swash plate, micro-molding holes, an annular pressing plate, piston shoes, coil suites, pistons, cylinders, a spring, a transmission shaft, and a distributor plate, wherein the primary iron core is configured at a central position of a back surface of the swash plate;
- the two secondary iron cores are symmetrically distributed on both sides of the primary iron core, and respectively located between a first pressure zone and a second pressure zone of a piston pair working area;
- the coils are wound around the primary iron core and the secondary iron cores;
- and the coils are electrically connected to an external alternating current power supply.