What was going on
Using the SDK method files.upload with a file stream and a purpose value (e.g. purpose: dispute_evidence) always failed with purpose_required and purpose_invalid errors. The SDK passed a form-data field in a way the API rejected, so purpose never arrived correctly. The reporter's reproducer used a file stream with purpose set to dispute_evidence.

What fixed it
Confirmed as an SDK bug and fixed in checkout-sdk-node 3.3.0; upgrade to 3.3.0 or newer. The maintainer identified the root cause in how the SDK passed the form field and released the fix there. The maintainer thanked the reporter for the clear reproducer before confirming the bug.