> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Scan Thai ID Card

POST https://api.staple.io/v1/documents/scan/tid
Content-Type: multipart/form-data

Scan a document using the Thai ID Card model in Staple to receive the structured data extracted. The documents would be left in the queue specified for any further manipulation.

Reference: https://docs.staple.ai/api-reference/v1/documents/scan-thai-id-card

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/scan/tid:
    post:
      operationId: scanThaiIdCard
      summary: Scan Thai ID Card
      description: >-
        Scan a document using the Thai ID Card model in Staple to receive the
        structured data extracted. The documents would be left in the queue
        specified for any further manipulation.
      tags:
        - documents
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Documents_scanThaiIdCard_Response_200'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: string
                  format: binary
                  description: File to upload
                qid:
                  type: string
                handwritten:
                  type: string
              required:
                - files
                - qid
                - handwritten
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Documents_scanThaiIdCard_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_scanThaiIdCard_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples

### Scan Thai ID Card



**Request**

```json
{}
```

**Response**

```json
{
  "scanDocuments": {
    "data": {
      "BigBoxes": [
        {
          "box": [
            150,
            14,
            1193,
            719,
            671.5,
            366.5,
            "บัตร ประจำ ตัว ประชาชน Thai National ID Car\nเลข ประจำ ตัว ประชาชน 13004 00124 03 9\nIdentification Number\nชื่อ ตัว และ ชื่อสกุล น.ส. อรัญ ญา แซ่ จิ ว\nName\nMiss Aranya\nLast name\nSaejeaw\nเกิด วัน ที่ 25 พ.ย.2533\nDate of Birth 25 Nov.1990\nศาสนา พุ ท ย\nที่ อยู่ 50 หมู่ ที่ 3 ต . บ้าน ปรางค์\nอ . คง จ . นครราชสีมา\n24 พ.ณ.2558\n2. ค .2560\nร\nใน บัตร หมดอายุ\nวัน ออก บัตร\nส ก็ อ )\n( า ที่ ต่อ\n24 Nov.2026\n288 2017\n30000502021140\nDate of Expiry\nเจ้าพนักงาน ออก บัตร\nDate of Tenue\n"
          ],
          "page": 0
        },
        {
          "box": [
            691,
            650,
            863,
            676,
            777,
            663,
            "24 Nov.2026\n"
          ],
          "page": 0
        }
      ],
      "DOB": {
        "UICategory": "Personal Information",
        "UIName": "DOB",
        "matches": [
          {
            "keyword": [
              439,
              382,
              666,
              431,
              552,
              406.5,
              "Date of Birth"
            ],
            "match": "25 Nov.1990",
            "matchmulti": null,
            "page": 0,
            "value": [
              666,
              382,
              876,
              431,
              771,
              406.5,
              " 25 Nov.1990"
            ]
          }
        ]
      },
      "DetectedText": "บัตร ประจำ ตัว ประชาชน Thai National ID Car เลข ประจำ ตัว ประชาชน 13004 00124 03 9 Identification Number ชื่อ ตัว และ ชื่อสกุล  น.ส. อรัญ ญา แซ่ จิ ว Name Miss Aranya Last name Saejeaw เกิด วัน ที่ 25 พ.ย.2533 Date of Birth  25 Nov.1990 ศาสนา พุ ท ย ที่ อยู่ 50 หมู่ ที่ 3 ต . บ้าน ปรางค์ อ . คง จ . นครราชสีมา 2. ค .2560 ร 24 พ.ณ.2558 วัน ออก บัตร ใน บัตร หมดอายุ 288 2017 ( า ที่ ต่อ ส ก็ อ ) Date of Tenue เจ้าพนักงาน ออก บัตร Date of Expiry 30000502021140 24 Nov.2026 ",
      "DocSize": [
        [
          721,
          1200,
          3
        ]
      ],
      "ExpiryDate": {
        "UICategory": "Card Information",
        "UIName": "Date of Expiry",
        "matches": [
          {
            "keyword": [
              690,
              678,
              873,
              711,
              781.5,
              694.5,
              "Date of Expiry"
            ],
            "match": "24 Nov.2026",
            "matchmulti": null,
            "page": 0,
            "value": [
              690,
              650,
              863,
              677,
              776.5,
              663.5,
              "Date of Expiry\n24 Nov.2026"
            ]
          }
        ]
      },
      "FirstNameE": {
        "UICategory": "Personal Information",
        "UIName": "Firstname (Eng)",
        "matches": [
          {
            "keyword": null,
            "match": "Miss Aranya",
            "matchmulti": null,
            "page": 0,
            "value": [
              522,
              226,
              763,
              269,
              642.5,
              247.5,
              "Miss Aranya"
            ]
          }
        ]
      },
      "ID": {
        "UICategory": "Card Information",
        "UIName": "ID Number",
        "matches": [
          {
            "keyword": null,
            "match": "เลข ประจำ ตัว ประชาชน 13004 00124 03 9",
            "matchmulti": null,
            "page": 0,
            "value": [
              247,
              62,
              969,
              137,
              608,
              99.5,
              "เลข ประจำ ตัว ประชาชน 13004 00124 03 9"
            ]
          }
        ]
      },
      "IssueDate": {
        "UICategory": "Card Information",
        "UIName": "Date of Issue",
        "matches": [
          {
            "keyword": null,
            "match": "288 2017",
            "matchmulti": null,
            "page": 0,
            "value": [
              150,
              654,
              309,
              685,
              229.5,
              669.5,
              "288 2017"
            ]
          }
        ]
      },
      "LastNameE": {
        "UICategory": "Personal Information",
        "UIName": "Lastname (Eng)",
        "matches": [
          {
            "keyword": [
              411,
              280,
              553,
              326,
              482,
              303,
              "Last name"
            ],
            "match": "Saejeaw",
            "matchmulti": null,
            "page": 0,
            "value": [
              590,
              280,
              739,
              328,
              664.5,
              304,
              "Saejeaw"
            ]
          }
        ]
      },
      "NameT": {
        "UICategory": "Personal Information",
        "UIName": "Name (Thai)",
        "matches": [
          {
            "keyword": [
              163,
              141,
              488,
              236,
              325,
              188.5,
              "ชื่อ ตัว และ ชื่อสกุล"
            ],
            "match": "น.ส. อรัญ ญา แซ่ จิ ว",
            "matchmulti": null,
            "page": 0,
            "value": [
              488,
              141,
              830,
              236,
              659,
              188.5,
              " น.ส. อรัญ ญา แซ่ จิ ว"
            ]
          }
        ]
      },
      "SmallBoxes": [
        {
          "box": [
            252,
            14,
            1193,
            81,
            722.5,
            47.5,
            "บัตร ประจำ ตัว ประชาชน Thai National ID Car"
          ],
          "page": 0
        },
        {
          "box": [
            247,
            62,
            969,
            137,
            608,
            99.5,
            "เลข ประจำ ตัว ประชาชน 13004 00124 03 9"
          ],
          "page": 0
        },
        {
          "box": [
            246,
            111,
            553,
            144,
            399.5,
            127.5,
            "Identification Number"
          ],
          "page": 0
        },
        {
          "box": [
            163,
            141,
            488,
            236,
            325,
            188.5,
            "ชื่อ ตัว และ ชื่อสกุล"
          ],
          "page": 0
        },
        {
          "box": [
            488,
            141,
            830,
            236,
            659,
            188.5,
            " น.ส. อรัญ ญา แซ่ จิ ว"
          ],
          "page": 0
        },
        {
          "box": [
            412,
            226,
            489,
            269,
            450.5,
            247.5,
            "Name"
          ],
          "page": 0
        },
        {
          "box": [
            522,
            226,
            763,
            269,
            642.5,
            247.5,
            "Miss Aranya"
          ],
          "page": 0
        },
        {
          "box": [
            411,
            280,
            553,
            326,
            482,
            303,
            "Last name"
          ],
          "page": 0
        },
        {
          "box": [
            590,
            280,
            739,
            328,
            664.5,
            304,
            "Saejeaw"
          ],
          "page": 0
        },
        {
          "box": [
            444,
            328,
            803,
            374,
            623.5,
            351,
            "เกิด วัน ที่ 25 พ.ย.2533"
          ],
          "page": 0
        },
        {
          "box": [
            439,
            382,
            666,
            431,
            552,
            406.5,
            "Date of Birth"
          ],
          "page": 0
        },
        {
          "box": [
            666,
            382,
            876,
            431,
            771,
            406.5,
            " 25 Nov.1990"
          ],
          "page": 0
        },
        {
          "box": [
            440,
            437,
            599,
            484,
            519.5,
            460.5,
            "ศาสนา พุ ท ย"
          ],
          "page": 0
        },
        {
          "box": [
            157,
            473,
            580,
            540,
            368.5,
            506.5,
            "ที่ อยู่ 50 หมู่ ที่ 3 ต . บ้าน ปรางค์"
          ],
          "page": 0
        },
        {
          "box": [
            157,
            535,
            440,
            580,
            298.5,
            557.5,
            "อ . คง จ . นครราชสีมา"
          ],
          "page": 0
        },
        {
          "box": [
            155,
            586,
            309,
            618,
            232,
            602,
            "2. ค .2560"
          ],
          "page": 0
        },
        {
          "box": [
            356,
            594,
            366,
            631,
            361,
            612.5,
            "ร"
          ],
          "page": 0
        },
        {
          "box": [
            694,
            584,
            858,
            612,
            776,
            598,
            "24 พ.ณ.2558"
          ],
          "page": 0
        },
        {
          "box": [
            153,
            618,
            277,
            653,
            215,
            635.5,
            "วัน ออก บัตร"
          ],
          "page": 0
        },
        {
          "box": [
            692,
            614,
            861,
            654,
            776.5,
            634,
            "ใน บัตร หมดอายุ"
          ],
          "page": 0
        },
        {
          "box": [
            150,
            654,
            309,
            685,
            229.5,
            669.5,
            "288 2017"
          ],
          "page": 0
        },
        {
          "box": [
            370,
            645,
            464,
            685,
            417,
            665,
            "( า ที่ ต่อ"
          ],
          "page": 0
        },
        {
          "box": [
            559,
            642,
            619,
            682,
            589,
            662,
            "ส ก็ อ )"
          ],
          "page": 0
        },
        {
          "box": [
            152,
            685,
            313,
            715,
            232.5,
            700,
            "Date of Tenue"
          ],
          "page": 0
        },
        {
          "box": [
            366,
            682,
            626,
            716,
            496,
            699,
            "เจ้าพนักงาน ออก บัตร"
          ],
          "page": 0
        },
        {
          "box": [
            690,
            678,
            873,
            711,
            781.5,
            694.5,
            "Date of Expiry"
          ],
          "page": 0
        },
        {
          "box": [
            911,
            669,
            1137,
            700,
            1024,
            684.5,
            "30000502021140"
          ],
          "page": 0
        },
        {
          "box": [
            691,
            650,
            863,
            677,
            777,
            663.5,
            "24 Nov.2026"
          ],
          "page": 0
        }
      ],
      "num_pages": 1
    },
    "docId": 7974,
    "status": "COMPLETED"
  }
}
```

**SDK Code**

```python Scan Thai ID Card
import requests

url = "https://api.staple.io/v1/documents/scan/tid"

payload = "-----011000010111000001101001--\r\n"
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Scan Thai ID Card
const url = 'https://api.staple.io/v1/documents/scan/tid';
const form = new FormData();

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Scan Thai ID Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/documents/scan/tid"

	payload := strings.NewReader("-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Scan Thai ID Card
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/scan/tid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Scan Thai ID Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/scan/tid")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001--\r\n")
  .asString();
```

```php Scan Thai ID Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/scan/tid', [
  'headers' => [
    'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Scan Thai ID Card
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/scan/tid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("undefined", "-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Scan Thai ID Card
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = []

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/documents/scan/tid")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Documents_scanThaiIdCard_example



**Request**

```json
{
  "files": "<file: string>",
  "handwritten": "[true]",
  "qid": "1"
}
```

**Response**

```json
{
  "scanDocuments": {
    "data": {
      "BigBoxes": [
        {
          "box": [
            150,
            14,
            1193,
            719,
            671.5,
            366.5,
            "บัตร ประจำ ตัว ประชาชน Thai National ID Car\nเลข ประจำ ตัว ประชาชน 13004 00124 03 9\nIdentification Number\nชื่อ ตัว และ ชื่อสกุล น.ส. อรัญ ญา แซ่ จิ ว\nName\nMiss Aranya\nLast name\nSaejeaw\nเกิด วัน ที่ 25 พ.ย.2533\nDate of Birth 25 Nov.1990\nศาสนา พุ ท ย\nที่ อยู่ 50 หมู่ ที่ 3 ต . บ้าน ปรางค์\nอ . คง จ . นครราชสีมา\n24 พ.ณ.2558\n2. ค .2560\nร\nใน บัตร หมดอายุ\nวัน ออก บัตร\nส ก็ อ )\n( า ที่ ต่อ\n24 Nov.2026\n288 2017\n30000502021140\nDate of Expiry\nเจ้าพนักงาน ออก บัตร\nDate of Tenue\n"
          ],
          "page": 0
        },
        {
          "box": [
            691,
            650,
            863,
            676,
            777,
            663,
            "24 Nov.2026\n"
          ],
          "page": 0
        }
      ],
      "DOB": {
        "UICategory": "Personal Information",
        "UIName": "DOB",
        "matches": [
          {
            "keyword": [
              439,
              382,
              666,
              431,
              552,
              406.5,
              "Date of Birth"
            ],
            "match": "25 Nov.1990",
            "matchmulti": null,
            "page": 0,
            "value": [
              666,
              382,
              876,
              431,
              771,
              406.5,
              " 25 Nov.1990"
            ]
          }
        ]
      },
      "DetectedText": "บัตร ประจำ ตัว ประชาชน Thai National ID Car เลข ประจำ ตัว ประชาชน 13004 00124 03 9 Identification Number ชื่อ ตัว และ ชื่อสกุล  น.ส. อรัญ ญา แซ่ จิ ว Name Miss Aranya Last name Saejeaw เกิด วัน ที่ 25 พ.ย.2533 Date of Birth  25 Nov.1990 ศาสนา พุ ท ย ที่ อยู่ 50 หมู่ ที่ 3 ต . บ้าน ปรางค์ อ . คง จ . นครราชสีมา 2. ค .2560 ร 24 พ.ณ.2558 วัน ออก บัตร ใน บัตร หมดอายุ 288 2017 ( า ที่ ต่อ ส ก็ อ ) Date of Tenue เจ้าพนักงาน ออก บัตร Date of Expiry 30000502021140 24 Nov.2026 ",
      "DocSize": [
        [
          721,
          1200,
          3
        ]
      ],
      "ExpiryDate": {
        "UICategory": "Card Information",
        "UIName": "Date of Expiry",
        "matches": [
          {
            "keyword": [
              690,
              678,
              873,
              711,
              781.5,
              694.5,
              "Date of Expiry"
            ],
            "match": "24 Nov.2026",
            "matchmulti": null,
            "page": 0,
            "value": [
              690,
              650,
              863,
              677,
              776.5,
              663.5,
              "Date of Expiry\n24 Nov.2026"
            ]
          }
        ]
      },
      "FirstNameE": {
        "UICategory": "Personal Information",
        "UIName": "Firstname (Eng)",
        "matches": [
          {
            "keyword": null,
            "match": "Miss Aranya",
            "matchmulti": null,
            "page": 0,
            "value": [
              522,
              226,
              763,
              269,
              642.5,
              247.5,
              "Miss Aranya"
            ]
          }
        ]
      },
      "ID": {
        "UICategory": "Card Information",
        "UIName": "ID Number",
        "matches": [
          {
            "keyword": null,
            "match": "เลข ประจำ ตัว ประชาชน 13004 00124 03 9",
            "matchmulti": null,
            "page": 0,
            "value": [
              247,
              62,
              969,
              137,
              608,
              99.5,
              "เลข ประจำ ตัว ประชาชน 13004 00124 03 9"
            ]
          }
        ]
      },
      "IssueDate": {
        "UICategory": "Card Information",
        "UIName": "Date of Issue",
        "matches": [
          {
            "keyword": null,
            "match": "288 2017",
            "matchmulti": null,
            "page": 0,
            "value": [
              150,
              654,
              309,
              685,
              229.5,
              669.5,
              "288 2017"
            ]
          }
        ]
      },
      "LastNameE": {
        "UICategory": "Personal Information",
        "UIName": "Lastname (Eng)",
        "matches": [
          {
            "keyword": [
              411,
              280,
              553,
              326,
              482,
              303,
              "Last name"
            ],
            "match": "Saejeaw",
            "matchmulti": null,
            "page": 0,
            "value": [
              590,
              280,
              739,
              328,
              664.5,
              304,
              "Saejeaw"
            ]
          }
        ]
      },
      "NameT": {
        "UICategory": "Personal Information",
        "UIName": "Name (Thai)",
        "matches": [
          {
            "keyword": [
              163,
              141,
              488,
              236,
              325,
              188.5,
              "ชื่อ ตัว และ ชื่อสกุล"
            ],
            "match": "น.ส. อรัญ ญา แซ่ จิ ว",
            "matchmulti": null,
            "page": 0,
            "value": [
              488,
              141,
              830,
              236,
              659,
              188.5,
              " น.ส. อรัญ ญา แซ่ จิ ว"
            ]
          }
        ]
      },
      "SmallBoxes": [
        {
          "box": [
            252,
            14,
            1193,
            81,
            722.5,
            47.5,
            "บัตร ประจำ ตัว ประชาชน Thai National ID Car"
          ],
          "page": 0
        },
        {
          "box": [
            247,
            62,
            969,
            137,
            608,
            99.5,
            "เลข ประจำ ตัว ประชาชน 13004 00124 03 9"
          ],
          "page": 0
        },
        {
          "box": [
            246,
            111,
            553,
            144,
            399.5,
            127.5,
            "Identification Number"
          ],
          "page": 0
        },
        {
          "box": [
            163,
            141,
            488,
            236,
            325,
            188.5,
            "ชื่อ ตัว และ ชื่อสกุล"
          ],
          "page": 0
        },
        {
          "box": [
            488,
            141,
            830,
            236,
            659,
            188.5,
            " น.ส. อรัญ ญา แซ่ จิ ว"
          ],
          "page": 0
        },
        {
          "box": [
            412,
            226,
            489,
            269,
            450.5,
            247.5,
            "Name"
          ],
          "page": 0
        },
        {
          "box": [
            522,
            226,
            763,
            269,
            642.5,
            247.5,
            "Miss Aranya"
          ],
          "page": 0
        },
        {
          "box": [
            411,
            280,
            553,
            326,
            482,
            303,
            "Last name"
          ],
          "page": 0
        },
        {
          "box": [
            590,
            280,
            739,
            328,
            664.5,
            304,
            "Saejeaw"
          ],
          "page": 0
        },
        {
          "box": [
            444,
            328,
            803,
            374,
            623.5,
            351,
            "เกิด วัน ที่ 25 พ.ย.2533"
          ],
          "page": 0
        },
        {
          "box": [
            439,
            382,
            666,
            431,
            552,
            406.5,
            "Date of Birth"
          ],
          "page": 0
        },
        {
          "box": [
            666,
            382,
            876,
            431,
            771,
            406.5,
            " 25 Nov.1990"
          ],
          "page": 0
        },
        {
          "box": [
            440,
            437,
            599,
            484,
            519.5,
            460.5,
            "ศาสนา พุ ท ย"
          ],
          "page": 0
        },
        {
          "box": [
            157,
            473,
            580,
            540,
            368.5,
            506.5,
            "ที่ อยู่ 50 หมู่ ที่ 3 ต . บ้าน ปรางค์"
          ],
          "page": 0
        },
        {
          "box": [
            157,
            535,
            440,
            580,
            298.5,
            557.5,
            "อ . คง จ . นครราชสีมา"
          ],
          "page": 0
        },
        {
          "box": [
            155,
            586,
            309,
            618,
            232,
            602,
            "2. ค .2560"
          ],
          "page": 0
        },
        {
          "box": [
            356,
            594,
            366,
            631,
            361,
            612.5,
            "ร"
          ],
          "page": 0
        },
        {
          "box": [
            694,
            584,
            858,
            612,
            776,
            598,
            "24 พ.ณ.2558"
          ],
          "page": 0
        },
        {
          "box": [
            153,
            618,
            277,
            653,
            215,
            635.5,
            "วัน ออก บัตร"
          ],
          "page": 0
        },
        {
          "box": [
            692,
            614,
            861,
            654,
            776.5,
            634,
            "ใน บัตร หมดอายุ"
          ],
          "page": 0
        },
        {
          "box": [
            150,
            654,
            309,
            685,
            229.5,
            669.5,
            "288 2017"
          ],
          "page": 0
        },
        {
          "box": [
            370,
            645,
            464,
            685,
            417,
            665,
            "( า ที่ ต่อ"
          ],
          "page": 0
        },
        {
          "box": [
            559,
            642,
            619,
            682,
            589,
            662,
            "ส ก็ อ )"
          ],
          "page": 0
        },
        {
          "box": [
            152,
            685,
            313,
            715,
            232.5,
            700,
            "Date of Tenue"
          ],
          "page": 0
        },
        {
          "box": [
            366,
            682,
            626,
            716,
            496,
            699,
            "เจ้าพนักงาน ออก บัตร"
          ],
          "page": 0
        },
        {
          "box": [
            690,
            678,
            873,
            711,
            781.5,
            694.5,
            "Date of Expiry"
          ],
          "page": 0
        },
        {
          "box": [
            911,
            669,
            1137,
            700,
            1024,
            684.5,
            "30000502021140"
          ],
          "page": 0
        },
        {
          "box": [
            691,
            650,
            863,
            677,
            777,
            663.5,
            "24 Nov.2026"
          ],
          "page": 0
        }
      ],
      "num_pages": 1
    },
    "docId": 7974,
    "status": "COMPLETED"
  }
}
```

**SDK Code**

```python Documents_scanThaiIdCard_example
import requests

url = "https://api.staple.io/v1/documents/scan/tid"

files = { "files": "open('string', 'rb')" }
payload = {
    "handwritten": "[true]",
    "qid": "1"
}
headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript Documents_scanThaiIdCard_example
const url = 'https://api.staple.io/v1/documents/scan/tid';
const form = new FormData();
form.append('files', 'string');
form.append('handwritten', '[true]');
form.append('qid', '1');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Documents_scanThaiIdCard_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/documents/scan/tid"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Documents_scanThaiIdCard_example
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/scan/tid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Documents_scanThaiIdCard_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/scan/tid")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Documents_scanThaiIdCard_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/scan/tid', [
  'multipart' => [
    [
        'name' => 'files',
        'filename' => 'string',
        'contents' => null
    ],
    [
        'name' => 'handwritten',
        'contents' => '[true]'
    ],
    [
        'name' => 'qid',
        'contents' => '1'
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Documents_scanThaiIdCard_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/scan/tid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Documents_scanThaiIdCard_example
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "files",
    "fileName": "string"
  ],
  [
    "name": "handwritten",
    "value": "[true]"
  ],
  [
    "name": "qid",
    "value": "1"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/documents/scan/tid")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```