> 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/document.md).

# Document

## Get Documents

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

Get list of documents.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                                                       |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETDOCUMENTS”                                                                                                                                                                                    |
| searchnumber                              | String | Document Number or Reference Number                                                                                                                                                               |
| createdbefore                             | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                                                                  |
| createdafter                              | String | <p>Created Date After ..... </p><p>(yyyy-MM-dd)</p>                                                                                                                                               |
| limit                                     | Int    | Limit per page (Max = 200)                                                                                                                                                                        |
| page                                      | Int    | Page (Default = 1)                                                                                                                                                                                |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                                                                                                                 |
| format                                    | String | json (Default), xml                                                                                                                                                                               |
| idtype                                    | Int    | <p>Related Transaction Type</p><p>1 – Order/Purchase Order<br>2 – Income/Expense<br>3 – Quotation<br>If idtype is not defined or equals 0, the system will show all.</p>                          |
| documenttype                              | Int    | <p>Document Type <br>1 – Receipt<br>2 – Tax Invoice<br>3 – Invoice<br>4 – Quotation<br>5 – Withholding Tax<br>If documenttype is not defined or equals 0, the system will show all documents.</p> |

#### Headers

| Name                                        | Type   | Description                                                                                                                                                        |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                                                                                                                         |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                                                                                                                         |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                                                                                                                            |
| idlist                                      | String | <p>List Of Related Transaction ID</p><p>Ex. “123,124,125“<br>This will be active when idtype is defined and not equals 0. So this will be related on "idtype".</p> |

{% tabs %}
{% tab title="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| Detail              | Type                | Description/Example   |
| ------------------- | ------------------- | --------------------- |
| order               | Order               | Order                 |
| purchase            | PurchaseOrder       | Purchase Order        |
| returnOrder         | ReturnOrder         | Return Order          |
| returnPurchaseOrder | ReturnPurchaseOrder | Return Purchase Order |
| income              | Income              | Income                |
| expense             | Expense             | Expense               |
| quotation           | Quotation           | Quotation             |

<table><thead><tr><th>Document (Array)</th><th width="158">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Document ID</td></tr><tr><td>header</td><td>String</td><td>Document Header</td></tr><tr><td>documentnumber</td><td>String</td><td>Document Number</td></tr><tr><td>referenceid</td><td>Int</td><td>Reference ID of Document</td></tr><tr><td>referencetype</td><td>Int</td><td><p>Reference Type of Document</p><p>0 - Undefined</p><p>1 – Order <br>2 – Purchase Order</p><p>3 – Return Order<br>4 – Return Purchase Order<br>5 – Other Income</p><p>6 – Other Expense</p></td></tr><tr><td>referencenumber</td><td>String</td><td>Reference Number</td></tr><tr><td>linkurl</td><td>String</td><td>Document Url</td></tr><tr><td>documentdate</td><td>Date</td><td>Document Date</td></tr><tr><td>documentdateString</td><td>String</td><td>Document Date<br>(yyyy-MM-dd)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>detail</td><td>Detail</td><td>Document Detail</td></tr></tbody></table>

| Parameter | Type             | Description/Example                   |
| --------- | ---------------- | ------------------------------------- |
| res       | Response         | <p>Response Code <br>200- Success</p> |
| list      | Document (Array) | Document List (Array)                 |
| count     | Int              | Total document number by filter       |
