Automatically link new dns to IP on purchase

Hi, I'm trying to make some automatic DNS command on a project and need them to be linked as soon as possible to a certain IP.

It would be way easier for me if this DNS/IP link could be made automatically.

I tried calling the API right after ordering my domain name but of course it is way too soon and the domain name was not created yet, thus returning an error since I'm trying to alter a DNS that does not exist.

Does anybody know if there is a way to setup the DNS before purchase so that it is automatically linked to the right IP upon creation?
Any equivalent would be welcome of course.

Thank you for your time and have a great day.

PS: It might actually be very simple and clearly stated in the API, though i'm kinda new to it and might have missed some stuff. Thanks for your patience.