> For the complete documentation index, see [llms.txt](https://developers-v3.zortout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-v3.zortout.com/api-reference/file-upload.md).

# File Upload

## Get Order Files

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of files in order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETORDERFILES"                                                                     |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |

## Get Order File Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get file detail and binary data of order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETORDERFILEDETAIL”                                                                |
| fileid<mark style="color:red;">\*</mark>  | Int    | File ID                                                                             |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| Parameter | Type   | Description/Example |
| --------- | ------ | ------------------- |
| id        | Int    | File ID             |
| content   | String | Base64 Encode Data  |
| fileName  | String | File Name           |
| type      | String | File Type           |

## Add File to Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add file to order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDORDERFILE"                                                                      |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| Parameter | Type   | Description/Example                   |
| --------- | ------ | ------------------------------------- |
| resCode   | String | <p>Response Code <br>200- Success</p> |
| resDesc   | String | Response Description                  |

## Get Purchase Order Files

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of files in purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETPURCHASEORDERFILES"                                                                      |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |

## Get Purchase Order File Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get file detail and binary data of purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETPURCHASEORDERFILEDETAIL”                                                                 |
| format                                    | String | json (Default), xml                                                                          |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| Parameter | Type   | Description/Example |
| --------- | ------ | ------------------- |
| id        | Int    | File ID             |
| content   | String | Base64 Encode Data  |
| fileName  | String | File Name           |
| type      | String | File Type           |

## Add File to Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add file to purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDPURCHASEORDERFILE"                                                                       |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| Parameter | Type   | Description/Example                   |
| --------- | ------ | ------------------------------------- |
| resCode   | String | <p>Response Code <br>200- Success</p> |
| resDesc   | String | Response Description                  |
