Importantly, you will only pay for submissions that you approve. The easiest way to record Prolific IDs is to ask for them as a question during your study, like this:
Also, see our demo for more information.
If your experimental software supports it you can also get the participant ID from a query string. Read here how this works.