Yes, you can book children and infants through the API in most cases, as long as you send the correct passenger type and date of birth with the booking.
When you search, you say how many adults, children and infants are travelling, and you say whether each infant has a seat of their own or is sitting on an adult's lap. The fares that come back are already priced for that mix, so the child fare or infant fare appears as its own line instead of you having to guess a discount. At booking you send each passenger's date of birth, and the airline checks the traveller is still inside the age band on the day of travel, not on the day you made the booking.
There are limits worth knowing before you quote. Airlines set their own age bands, so a traveller counted as a child by one carrier can be charged as an adult by another and the same family will price differently on two options. An infant cannot travel without an adult on the same booking, and most airlines allow only one lap infant per adult. Children flying alone are usually not sold through an API at all, because the airline wants its own form and fee handled directly with them. Which passenger types your account can send also depends on the supplier behind that fare and on your plan.
Before you quote a family trip, price it once in your test environment using the real ages, check the child and infant lines separately, and confirm with the airline if any traveller has a birthday falling close to the travel dates.