The statue was commissioned by the Parte Guelfa for their external niche at the centre of the east facade of Orsanmichele facing via de' Calzaiuoli.
Their patron saint (canonized in 1317) had given up his crown for the religious life, an idea that favorably symbolized the Guelphs' believe in the Papacy.
Donatello was still alive when due to political pressure the Parte Guelfa had to give up their prestigious representational space at Orsanmichele, the economical centre of Florence.
The statue was instead taken to "the next best location" (Janson), Santa Croce, which their patron saint Louis of Anjou had visited and therefore the Guelphs were affiliated with.
After the war the Saint Louis was briefly placed in then the supposedly original niche at Orsanmichele, and it was first prooven that it was indeed Donatello's sculpture for the Guelphs.