> For the complete documentation index, see [llms.txt](https://docs.neox.vn/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neox.vn/docs/global/global-collections/integration/files/api-download-file.md).

# Download File

#### Endpoint: GET https\://{base\_url\_openapi}/v2/gc/files/download

#### Description: Download a statement, receipt, or declaration form as a raw binary file.

{% hint style="warning" %}
**Response Format Exception:** Unlike other Global Collections APIs, this endpoint returns raw binary file content directly instead of the standard JSON envelope (see [Security Method](/docs/global/global-collections/integration/security-method.md#4-standard-response-envelope)).
{% endhint %}

## Request

#### Standard Request Headers

| Header          | Required | Description                                                                                                                    |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Authorization   | Yes      | `Bearer <access_token>` obtained from [API authenPlatform](/docs/global/global-collections/integration/api-authenplatform.md). |
| Content-Type    | Yes      | `application/json`                                                                                                             |
| Accept-Language | No       | Response language. Supported: `vi`, `en`. Default: `en`.                                                                       |

#### Request Params Field Descriptions

| Field Name      | Type   | Required | Description                                                                                                                                                                                                                             |
| --------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| path            | string | No       | File reference path returned by the Upload File API. Provide either `path` or `type`.                                                                                                                                                   |
| type            | string | No       | Named file type for pre-generated platform files. Provide either `path` or `type`. Values: `ACCOUNT_HISTORY\|YYYYMMDD` (daily statement), `DAILY_BALANCE\|YYYYMMDD` (daily balance), `DECLARATION_FILE`, `OVERSEA_PAYMENT`, `WITHDRAW`. |
| requestId       | string | No       | Original request ID of the associated transaction. **Mandatory** when `type` is `DECLARATION_FILE`, `OVERSEA_PAYMENT`, or `WITHDRAW`.                                                                                                   |
| childMerchantId | string | No       | Sub-merchant ID. Required when downloading files scoped to a specific sub-merchant.                                                                                                                                                     |
| outPath         | string | No       | Local file system path where the downloaded file should be saved.                                                                                                                                                                       |

### Response

#### Response Field Descriptions

| Field Name | Type   | Description                                                                        |
| ---------- | ------ | ---------------------------------------------------------------------------------- |
| (body)     | binary | Raw binary file content. This endpoint does not return the standard JSON envelope. |

#### Response headers

| Header Name          | Description                                                                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------ |
| x-neo-request-id     | Unique request identifier assigned by the platform.                                                    |
| x-neo-sign           | Platform response signature for integrity verification.                                                |
| x-neo-hash-crc64ecma | CRC-64/ECMA checksum of the file content for corruption detection.                                     |
| content-disposition  | Contains the `filename` of the downloaded file (e.g. `attachment; filename="statement_20240815.zip"`). |

#### Response sample

```
Response Headers:
  x-neo-request-id: b7e4a1d0-3c92-4f58-a821-9d1234567890
  x-neo-sign: <platform-signature>
  x-neo-hash-crc64ecma: 14750404129753557614
  content-disposition: attachment; filename="ACCOUNT_HISTORY_20240815.zip"

Response Body:
  <raw binary file content>
```

## Example cURL

```bash
curl -X GET "https://{base_url_openapi}/v2/gc/files/download?type=ACCOUNT_HISTORY%7C20240815" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -H "Accept-Language: en" \
  --output statement_20240815.zip
```

### Notes

* Authentication follows the standard OAuth 2.0 Bearer Token mechanism described in [Security Method](/docs/global/global-collections/integration/security-method.md#1-protocol--authentication).
* `{base_url_openapi}` is environment-specific and provided by NeoX (see [Security Method](/docs/global/global-collections/integration/security-method.md#2-base-url)).
* Provide either `path` or `type` as the download source — both are not required simultaneously.
* `requestId` is mandatory when `type` is `DECLARATION_FILE`, `OVERSEA_PAYMENT`, or `WITHDRAW`.
* Daily files (statements, balances) become available after **06:00** the following day.
* The response body is raw binary content, not the standard JSON envelope. Use `--output` or equivalent to save the file locally.
* Verify file integrity using the `x-yop-hash-crc64ecma` checksum in the response header.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.neox.vn/docs/global/global-collections/integration/files/api-download-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
