# Downloading a file

Easy access to files is essential for seamless operations. Whether you're handling important documents, images, or software packages, having a straightforward method to download files can significantly enhance efficiency. The Commerce API offers a simple yet powerful endpoint that allows users to download files securely and efficiently. Using the [`GET /files/{fileId}/content`](https://app.gitbook.com/s/drE2RCYBuoRpd2TC2sx2/file-management/retrieve-a-file) request, where you replace `{fileId}` with the actual identifier of the file you wish to download, you can retrieve the content of a specific file by its unique identifier. This guide will walk you through the steps to use a cURL command to download a file using your API key and site ID, ensuring a smooth and secure file transfer process.

Here's an example CURL command to achieve this:

{% tabs %}
{% tab title="cURL" %}

```http
curl --location --request GET 'https://api.digitalriver.com/files/{fileId}/content' \
--header 'authorization: Basic YOUR_API_KEY' \
--header 'x-siteid: YOUR_SITE_ID'

```

{% endtab %}

{% tab title="200 OK response" %}

```json
{
  "id": "9e00869b-e2f5-4663-aacb-e33687466020",
  "fileName": "File Name"
}
```

{% endtab %}
{% endtabs %}

Be sure to replace `YOUR_API_KEY` with your actual API key and `YOUR_SITE_ID` with your site ID. Also, replace `{fileId}` with the specific file ID you are trying to download.

Refer to the [Downloading the invoice](https://docs.digitalriver.com/commerce-api/admin-apis/order-management/downloading-the-invoice) section for more detailed information.
