# File Upload

## Get Order Files

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Order/GetOrderFiles`

Get list of files in order.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |
| {% endtab %}        |        |                     |
| {% endtabs %}       |        |                     |

## Get Order File Detail

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Order/GetOrderFileDetail`

Get file detail and binary data of order.

#### Query Parameters

| Name                                     | Type   | Description                                                                         |
| ---------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                       | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number                                   | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| fileid<mark style="color:red;">\*</mark> | Int    | File ID                                                                             |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| Parameter     | Type   | Description/Example |
| ------------- | ------ | ------------------- |
| id            | Int    | File ID             |
| content       | String | Base64 Encode Data  |
| fileName      | String | File Name           |
| type          | String | File Type           |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add File to Order

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Order/AddOrderFile`

Add file to order.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                   | Type | Description      |
| -------------------------------------- | ---- | ---------------- |
| file<mark style="color:red;">\*</mark> | File | File Binary Data |

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

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% endtab %}  |        |                                       |
| {% endtabs %} |        |                                       |

## Get Purchase Order Files

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/PurchaseOrder/GetPurchaseOrderFiles`

Get list of files in purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |
| {% endtab %}        |        |                     |
| {% endtabs %}       |        |                     |

## Get Purchase Order File Detail

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/PurchaseOrder/GetPurchaseOrderFileDetail`

Get file detail and binary data of purchase order.

#### Query Parameters

| Name                                     | Type   | Description                                                                                  |
| ---------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| id                                       | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number                                   | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| fileid<mark style="color:red;">\*</mark> | Int    | File ID                                                                                      |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| Parameter     | Type   | Description/Example |
| ------------- | ------ | ------------------- |
| id            | Int    | File ID             |
| content       | String | Base64 Encode Data  |
| fileName      | String | File Name           |
| type          | String | File Type           |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add File to Purchase Order

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/PurchaseOrder/AddPurchaseOrderFile`

Add file to purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                   | Type | Description      |
| -------------------------------------- | ---- | ---------------- |
| file<mark style="color:red;">\*</mark> | File | File Binary Data |

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

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% endtab %}  |        |                                       |
| {% endtabs %} |        |                                       |

## Get Quotation Files

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Quotation/GetQuotationFiles`

Get list of files in quotation.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |
| {% endtab %}        |        |                     |
| {% endtabs %}       |        |                     |

## Get Quotation File Detail

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Quotation/GetQuotationFileDetail`

Get file detail and binary data of quotation.

#### Query Parameters

| Name                                     | Type   | Description                                                                             |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| id                                       | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number                                   | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| fileid<mark style="color:red;">\*</mark> | Int    | File ID                                                                                 |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| Parameter     | Type   | Description/Example |
| ------------- | ------ | ------------------- |
| id            | Int    | File ID             |
| content       | String | Base64 Encode Data  |
| fileName      | String | File Name           |
| type          | String | File Type           |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add File to Quotation

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Quotation/AddQuotationFile`

Add file to quotation.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                   | Type | Description      |
| -------------------------------------- | ---- | ---------------- |
| file<mark style="color:red;">\*</mark> | File | File Binary Data |

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

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% endtab %}  |        |                                       |
| {% endtabs %} |        |                                       |


---

# Agent Instructions: 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:

```
GET https://developers.zortout.com/api-reference/file-upload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
