> 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-upload-file.md).

# Upload File

#### Endpoint: POST /v2/gc/files/upload

#### Description: Upload a supporting document (KYC, contract, logistics, payee proof, etc.) and obtain a reusable file path for use in other API calls.

## Request

#### Request Form-Data Field Descriptions

| Field Name | Type   | Required | Description                                                                                                                                  |
| ---------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| bizType    | string | Yes      | Document category. Enum: `PAYMENT \| UPLOAD \| REPORT \| CUSTOMS_RECEIPT \| NETWORK_ACCESS \| COMMERCIAL \| LOGISTICS \| PAYEEINFO \| OTHER` |
| file       | file   | Yes      | The binary document to upload (e.g. PDF, image).                                                                                             |

{% hint style="warning" %}
The `bizType` enum list above was not independently re-verified against the backend for this pass — it's carried over from the prior version of this page. Treat it as likely-correct but unconfirmed; verify with the NeoX integration team if a specific `bizType` value is rejected.
{% endhint %}

#### Request sample

```json
// multipart/form-data request — see the form-data field table above; no JSON body.
```

### Response

#### Response Field Descriptions

| Field Name | Type   | Description                                                                                                       |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| code       | number | Response code. `1` on success; a failure uses a different code (e.g. `2080`) with `message` describing the error. |
| data       | array  | Uploaded file details — see below.                                                                                |
| message    | string | Response message.                                                                                                 |

{% hint style="warning" %}
There is no `state` field in the response envelope. **`data` is an array**, not a single object — even for a single-file upload, the response wraps the result in a one-element array.
{% endhint %}

#### `data` array item fields:

| Field Name | Type   | Description                                                                                                                                         |
| ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| fileName   | string | Original file name of the uploaded document.                                                                                                        |
| path       | string | Reusable file reference path. Pass this value in other API calls (e.g. `kycFiles`, `contractFiles`, `attachmentsFiles`, `detailPath`, `frontPath`). |

#### Response sample

```json
{
  "code": 1,
  "data": [
    {
      "fileName": "contract_2024.pdf",
      "path": "gpt/merchant/20240815/a3f8c1d2-4e56-7890-bcde-f12345678901.pdf"
    }
  ],
  "message": "Successful"
}
```

Failure response shape:

```json
{
  "code": 2080,
  "message": "Upload failed"
}
```

## Example cURL

```bash
curl -X POST "https://{base_url_openapi}/v2/gc/files/upload" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: multipart/form-data" \
  -H "Accept-Language: en" \
  -F "bizType=PAYMENT" \
  -F "file=@/path/to/document.pdf"
```

### Notes

* Requires Bearer token in the Authorization header.
* The Accept-Language header can be used to specify the response language (Support: "vi", "en").
* The request must be sent as `multipart/form-data`; do not use `application/json`.
* The returned `path` value is used as a file reference in other API calls, including `kycFiles`, `contractFiles`, `paymentProofList`, `detailPath`, `frontPath`, and similar fields.
* Choose the `bizType` value that best matches the document's intended purpose.
