files.upload fails with purpose_required / purpose_invalid (fixed in 3.3.0)

Using the SDK method files.upload with a file stream and a purpose value (e.g. purpose: disputeevidence) always failed with purposerequired and purposeinvalid 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 disputeevidence.

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. Source: https://github.com/checkout/checkout-sdk-node/issues/418

Source: https://github.com/checkout/checkout-sdk-node/issues/418