Situation
A bulk registration batch hit a daily quota and 333 of 1,155 items were rejected. A list of what failed is needed.
The wrong way — parsing FAIL out of the result CSV
★ CSV column layouts differ between scripts. Once several batches exist, column order, header names and delimiters drift apart, and parsing breaks silently. The failure list then comes back empty or wrong.
The right way — subtract from the target system
Take the full list you intended to send and subtract what is now present in the target's completed list.
★★ A failure record depends on the format of whatever wrote it; absence is a fact about the target system.
Why this generalises
Aside about the quota itself
The quota counted variants, not products. Items with many options burn through it far faster — the same number of records drains it at a different rate. ★ Check whether the limit's unit is the same unit you are counting in.