# File uploader The file uploader enables you to upload files to Checkout.com as evidence for a dispute. --- ## Upload a file Upload a file to use as evidence in a dispute. Your request must be multipart/form-data and the file must be in either JPEG, JPG, PNG, or PDF format, and no larger than 4MB. It's best practice to: - Compress files to reduce file size, but aim to maintain overall quality. - Ensure documents are legible, do not contain blurry or truncated text, and have all four corners visible. - Use a standard 300 dots per inch (DPI) resolution for passport-style photos, and ensure that they meet facial recognition and clarity requirements. - Use a 150 to 300 DPI resolution for documents, and ensure that text is legible when zoomed in. > **Information** > > Ensure the files you upload adhere to the [dispute evidence file requirements](https://www.checkout.com/docs/payments/process-disputes/dispute-evidence-file-requirements.md) imposed by the schemes. In your request, include the following fields: - `file` – The local path of the file to upload, and its type. - `purpose` – The purpose of the file upload. You must set this to `dispute_evidence` or `arbitration_evidence`. Call the [Upload file](https://api-reference.checkout.com/tag/Disputes/#operation/uploadFile) endpoint. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/files` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/files` ### Request example ```Node.js import { Checkout } from 'checkout-node-sdk'; const cko = new Checkout('sk_XXXX'); const file = await cko.files.upload({ path: fs.createReadStream('./test/files/evidence.jpg'), purpose: 'dispute_evidence', }); ``` If the response returns a file `id`, your request was successful. ### Response example ```json { "id": "file_6lbss42ezvoufcb2beo76rvwly", "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/files/file_6lbss42ezvoufcb2beo76rvwly" } } } ``` Call the [Provide dispute evidence](https://api-reference.checkout.com/tag/Disputes/#operation/provideDisputeEvidence) endpoint to provide the uploaded file as evidence to support a dispute. --- ## Get file information Use the following endpoint to retrieve information about a file that you've uploaded. Call the [Get file information](https://api-reference.checkout.com/tag/Disputes/#operation/getFileInformation) endpoint. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `GET` `https://{prefix}.api.checkout.com/files/{file_id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/files/{file_id}` ### Request example ```Node.js import { Checkout } from 'checkout-node-sdk'; const cko = new Checkout('sk_XXXX'); const getFile = await cko.files.getFile('file_zna32sccqbwevd3ldmejtplbhu'); ``` If the response returns a file `id`, your request was successful. ### Response example ```json { "id": "file_6lbss42ezvoufcb2beo76rvwly", "filename": "receipt.png", "purpose": "dispute_evidence", "size": 1024, "uploaded_on": "2016-05-17T16:48:52.000Z", "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/files/file_6lbss42ezvoufcb2beo76rvwly" }, "download": { "href": "https://checkout-file-upload.s3.eu-west-2.amazonaws.com/ucdac/ucdac/6lbss42ezvoufcb2beo76rvwly?X-Amz-Expires=3600&x-amz-security-token=FQoDYXdzENL%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEa" } } } ```