---
sourceType: api-reference
sourceTypeMatchedRule: openApis
slug: MA/openApis/partner/kyb/submitBusinessDocuments
title: Nộp giấy tờ kinh doanh
---
Được sử dụng để nộp giấy tờ doanh nghiệp với metadata. Đây là bước 2 trong quy trình tải lên giấy tờ doanh nghiệp (two-phase process). Trước khi gọi API này, bạn cần tải lên tệp giấy tờ bằng API [Tải lên tệp giấy tờ](/docs/MA/openApis/partner/kyb/uploadDocumentFile) để lấy fileId.

### Parameters

| Property          | Type                         | Required | Description                    |
| ----------------- | ---------------------------- | -------- | ------------------------------ |
| miniAppId         | Long                         | true     | ID của Mini App                |
| businessDocuments | List&lt;BusinessDocument&gt; | true     | Danh sách giấy tờ doanh nghiệp |

#### BusinessDocument

| Property       | Type    | Required | Description                                                |
| -------------- | ------- | -------- | ---------------------------------------------------------- |
| fileId         | String  | true     | ID của tệp (từ bước 1)                                     |
| fileName       | String  | true     | Tên của tệp (từ bước 1)                                    |
| type           | String  | true     | Loại giấy tờ: "BUSINESS_LICENSE" hoặc "ADDITIONAL_LICENSE" |
| documentTypeId | Integer | false    | ID loại giấy tờ (khuyến nghị sử dụng)                      |
| documentType   | String  | false    | Tên loại giấy tờ (legacy, vẫn hỗ trợ)                      |
| subCategoryId  | Integer | false    | ID danh mục con                                            |

:::tip
Khuyến nghị sử dụng `documentTypeId` thay vì `documentType` để dễ bảo trì hơn. Nếu cả hai được cung cấp, `documentTypeId` sẽ được ưu tiên.
:::

### Return Values

| Property | Type   | Description                                              |
| -------- | ------ | -------------------------------------------------------- |
| error    | int    | Mã lỗi của kết quả trả về, bằng 0 nếu request thành công |
| message  | String | Lời nhắn chi tiết tương ứng với mã lỗi                   |
| data     | Object | Kết quả nộp giấy tờ                                      |

:::warning Lưu ý

- Nếu đang có tài liệu đang được xử lý, API sẽ trả về lỗi:
  - **error**: -101
  - **message**: "Nộp tài liệu không thành công, bạn đang có tài liệu đang được xử lý"
- Nếu ứng dụng chưa cập nhật `subCateIds`, API sẽ trả về lỗi:
  - **message**: "Vui lòng cập nhật thông tin"
  - Vui lòng sử dụng API [Cập nhật loại hình](/docs/MA/openApis/partner/apis/updateAppCategory) để cập nhật `subCateIds`. Có thể lấy danh sách `subCateIds` hợp lệ từ API [Lấy thông tin Mini App](/docs/MA/openApis/partner/apis/getAppInfo).
    :::

:::info Giới hạn
Số lượng tệp giấy tờ được tải lên không quá **100 file/tháng**.
:::

#### Data Object

| Property          | Type                  | Description                            |
| ----------------- | --------------------- | -------------------------------------- |
| businessResults   | DocumentRequestResult | Kết quả cho giấy tờ BUSINESS_LICENSE   |
| additionalResults | DocumentRequestResult | Kết quả cho giấy tờ ADDITIONAL_LICENSE |

#### DocumentRequestResult

| Property      | Type                     | Description                 |
| ------------- | ------------------------ | --------------------------- |
| id            | Long                     | ID của request              |
| reviewStatus  | String                   | Trạng thái xét duyệt        |
| ownerId       | String                   | ID của chủ sở hữu           |
| createdAt     | Long                     | Thời gian tạo               |
| documentFiles | List&lt;DocumentInfo&gt; | Danh sách thông tin giấy tờ |

#### Sample Code


### Code sample — Java

```js
import java.util.ArrayList;
import java.util.List;

import com.vng.zalo.miniapp.openapi.sdk.models.documents.request.SubmitBusinessDocumentsRequest;
import com.vng.zalo.miniapp.openapi.sdk.models.documents.response.SubmitBusinessDocumentsResponse;

List<SubmitBusinessDocumentsRequest.BusinessDocument> businessDocuments = new ArrayList<>();

SubmitBusinessDocumentsRequest.BusinessDocument doc = new SubmitBusinessDocumentsRequest.BusinessDocument();
doc.setFileId(fileId);           // Từ bước 1
doc.setFileName(fileName);       // Từ bước 1
doc.setType("BUSINESS_LICENSE");
doc.setDocumentTypeId(1006);     // ID loại giấy tờ (khuyến nghị)
doc.setSubCategoryId(1109);
businessDocuments.add(doc);

SubmitBusinessDocumentsRequest request = new SubmitBusinessDocumentsRequest();
request.setMiniAppId(YOUR_MINI_APP_ID);
request.setBusinessDocuments(businessDocuments);

SubmitBusinessDocumentsResponse response = client.submitBusinessDocuments(request);
```

### Code sample — Node.js

```js
const businessDocuments = [
  {
    fileId, // from upload-document-file
    fileName, // from upload-document-file
    type: "BUSINESS_LICENSE",
    documentType: "GiayPhepKinhDoanh",
    documentTypeId: 1006,
    subCategoryId: 1109,
  },
];

const response = await client.submitBusinessDocumentRequest({
  miniAppId: YOUR_MINI_APP_ID,
  businessDocuments,
});

if (response.error === 0) {
  const { businessResults, additionalResults } = response.data ?? {};
}
```
