Ian Lugton, 34, and 27-year-old Emma Duffy of Wemyss Gardens, Wallyford, East Lothian, pleaded guilty to wilfully abandoning and exposing a child under their supervision while drunk and incapable of looking after him.
Haddington Sheriff Court was told that a motorist was travelling along Salters Road in Wallyford at around 4.50am on February 15 when he spotted a child walking alone on the pavement.
Depute fiscal Brent Bissett said: "The driver stopped and put him in the car and immediately contacted the police.
"The boy was dressed only in his pyjamas and brown boots. He was cold and shaking and an ambulance was requested. A police officer noted the temperature was 3°C at the time."
When officers attended the address occupied by Lugton and Duffy the door was open. The pair were taken to St Leonard's Police Station in Edinburgh, where Lugton made no reply to being cautioned and charged. Duffy said: "I am ashamed."
Sheriff Peter Braid deferred sentence until July 2 for background reports.