The snake might be ready to shed.
Meal size could be too large.
Depending on the age of the snake, breeding season might affect the feeding response. Some snakes do not eat during the breeding season.
Cage temperature might be too hot or too cold for the snake.
Some cage decor might not be accepted by the snake, if the snake is constantly trying to get out of its enclosure this might be the reason.
A lot of times when hatchling snakes are placed in their new homes, they stop eating. This can be due to the enclosure being too large for a baby snake. Baby snakes stress very quickly in large environments. If your hatchling suddenly stops eating, reduce its cage size and offer it a meal again.