Using the standard Bardeen-Cooper-Schrieffer (BCS) theory, we microscopically derive the superconductor-insulator boundary conditions for the Ginzburg-Landau (GL) model. We obtain a negative contribution to free energy in the form of surface integral. Boundary conditions are shown to follow from considering the order parameter reflected in the boundary. These boundary conditions are also derived for more general GL models with higher-order derivatives and pairdensity-wave states. It allows us to describe the formation of boundary states with higher critical temperature and the gap enhancement in the GL theory. In the case of an applied external field, we show that the third critical magnetic field's value Hc3 is higher than what follows from the de Gennes boundary conditions.