> 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.

# Extract Invoice

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

Extract the structured data from a document using the Invoice model in Staple. The document would NOT be left in the queue specified for any further manipulation.

Reference: https://docs.staple.ai/api-reference/v1/documents/extract-invoice

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/extract/invoice:
    post:
      operationId: extractInvoice
      summary: Extract Invoice
      description: >-
        Extract the structured data from a document using the Invoice model in
        Staple. The document would NOT 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_extractInvoice_Response_200'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: File to upload
              required:
                - file
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Documents_extractInvoice_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_extractInvoice_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



**Request**

```json
{
  "file": "<file: string>"
}
```

**Response**

```json
{
  "AccountName": {
    "UICategory": "Payment Instructions",
    "UIName": "Account Name",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "AccountNumber": {
    "UICategory": "Payment Instructions",
    "UIName": "Account Number",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "BigBoxes": [
    {
      "box": [
        921,
        295,
        1046,
        343,
        983.5,
        319,
        "Invoice Date\n13 Nov 2018",
        "Invoice Date\n13 Nov 2018"
      ],
      "page": 0
    },
    {
      "box": [
        920,
        367,
        1077,
        415,
        998.5,
        391,
        "Invoice Number\nINV-4412",
        "Invoice Number\nINV-4412"
      ],
      "page": 0
    },
    {
      "box": [
        1199,
        300,
        1402,
        451,
        1300.5,
        375.5,
        "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
        "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937"
      ],
      "page": 0
    },
    {
      "box": [
        148,
        380,
        367,
        534,
        257.5,
        457,
        "NOTABUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE",
        "NOTARUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE"
      ],
      "page": 0
    },
    {
      "box": [
        82,
        729,
        193,
        757,
        137.5,
        743,
        "Description",
        "Description"
      ],
      "page": 0
    },
    {
      "box": [
        935,
        737,
        1017,
        766,
        976,
        751.5,
        "Quantity",
        "Quantity"
      ],
      "page": 0
    },
    {
      "box": [
        1125,
        741,
        1221,
        762,
        1173,
        751.5,
        "Unit Price",
        "Unit Price"
      ],
      "page": 0
    },
    {
      "box": [
        1292,
        742,
        1425,
        764,
        1358.5,
        753,
        "Amount SGD",
        "Amount SGD"
      ],
      "page": 0
    },
    {
      "box": [
        81,
        788,
        284,
        816,
        182.5,
        802,
        "Corporate Secretary",
        "Corporate Secretary"
      ],
      "page": 0
    },
    {
      "box": [
        976,
        798,
        1016,
        817,
        996,
        807.5,
        "1.00",
        "1.00"
      ],
      "page": 0
    },
    {
      "box": [
        1153,
        798,
        1220,
        820,
        1186.5,
        809,
        "800.00",
        "800.00"
      ],
      "page": 0
    },
    {
      "box": [
        1357,
        800,
        1424,
        821,
        1390.5,
        810.5,
        "800.00",
        "800.00"
      ],
      "page": 0
    },
    {
      "box": [
        80,
        845,
        305,
        870,
        192.5,
        857.5,
        "Incorporation Discount",
        "Incorporation Discount"
      ],
      "page": 0
    },
    {
      "box": [
        976,
        855,
        1015,
        873,
        995.5,
        864,
        "1.00",
        "1.00"
      ],
      "page": 0
    },
    {
      "box": [
        1138,
        854,
        1219,
        882,
        1178.5,
        868,
        "( 500.00 )",
        "( 500.00 )"
      ],
      "page": 0
    },
    {
      "box": [
        1342,
        856,
        1423,
        884,
        1382.5,
        870,
        "( 500.00 )",
        "( 500.00 )"
      ],
      "page": 0
    },
    {
      "box": [
        1139,
        913,
        1219,
        934,
        1179,
        923.5,
        "Subtotal",
        "Subtotal"
      ],
      "page": 0
    },
    {
      "box": [
        1356,
        916,
        1423,
        936,
        1389.5,
        926,
        "300.00",
        "300.00"
      ],
      "page": 0
    },
    {
      "box": [
        1091,
        970,
        1219,
        989,
        1155,
        979.5,
        "TOTAL TAX",
        "TOTAL TAX"
      ],
      "page": 0
    },
    {
      "box": [
        1380,
        971,
        1421,
        989,
        1400.5,
        980,
        "0.00",
        "0.00"
      ],
      "page": 0
    },
    {
      "box": [
        1092,
        1027,
        1218,
        1048,
        1155,
        1037.5,
        "TOTAL SGD",
        "TOTAL SGD"
      ],
      "page": 0
    },
    {
      "box": [
        1355,
        1028,
        1422,
        1051,
        1388.5,
        1039.5,
        "300.00",
        "300.00"
      ],
      "page": 0
    },
    {
      "box": [
        1037,
        1067,
        1217,
        1091,
        1127,
        1079,
        "Less Amount Paid",
        "Less Amount Paid"
      ],
      "page": 0
    },
    {
      "box": [
        1355,
        1070,
        1422,
        1091,
        1388.5,
        1080.5,
        "300.00",
        "300.00"
      ],
      "page": 0
    },
    {
      "box": [
        1011,
        1125,
        1217,
        1147,
        1114,
        1136,
        "AMOUNT DUE SGD",
        "AMOUNT DUE SGD"
      ],
      "page": 0
    },
    {
      "box": [
        1378,
        1130,
        1421,
        1149,
        1399.5,
        1139.5,
        "0.00",
        "0.00"
      ],
      "page": 0
    },
    {
      "box": [
        71,
        1233,
        353,
        1258,
        212,
        1245.5,
        "Due Date: 13 Nov 2018",
        "Due Date: 13 Nov 2018"
      ],
      "page": 0
    },
    {
      "box": [
        862,
        1521,
        1020,
        1577,
        941,
        1549,
        "Customer\nInvoice Number",
        "Customer\nInvoice Number"
      ],
      "page": 0
    },
    {
      "box": [
        1078,
        1520,
        1295,
        1576,
        1186.5,
        1548,
        "NOTABUM PTE LTD\nINV-4412",
        "NOTARUM PTE LTD\nINV-4412"
      ],
      "page": 0
    },
    {
      "box": [
        861,
        1599,
        986,
        1654,
        923.5,
        1626.5,
        "Amount Due\nDue Date",
        "Amount Due\nDue Date"
      ],
      "page": 0
    },
    {
      "box": [
        1075,
        1599,
        1201,
        1655,
        1138,
        1627,
        "0.00\n13 Nov 2018",
        "0.00\n13 Nov 2018"
      ],
      "page": 0
    },
    {
      "box": [
        145,
        1589,
        390,
        1741,
        267.5,
        1665,
        "To Sleek Tech Pte.Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
        "To Sleek Tech Pte.Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937"
      ],
      "page": 0
    },
    {
      "box": [
        860,
        1677,
        1036,
        1698,
        948,
        1687.5,
        "Amount Enclosed",
        "Amount Enclosed"
      ],
      "page": 0
    },
    {
      "box": [
        1073,
        1718,
        1423,
        1744,
        1248,
        1731,
        "Enter the amount you are paying above",
        "Enter the amount you are paying above"
      ],
      "page": 0
    },
    {
      "box": [
        64,
        1887,
        871,
        1917,
        467.5,
        1902,
        "Company Registration No 201708433H.Registered Office: 28C Stanley Street ,068737 Singapore.",
        "Company Registration No 201708433H.Registered Office: 28C Stanley Street ,068737 Singapore."
      ],
      "page": 0
    }
  ],
  "BillingAddress": {
    "UICategory": "Vendor & Customer",
    "UIName": "Billing Address",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "CompanyName": {
    "UICategory": "Vendor & Customer",
    "UIName": "Vendor Name",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          1199,
          300,
          1402,
          451,
          1300.5,
          375.5,
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937"
        ],
        "match": "Sleek Tech Pte Ltd.",
        "matchmulti": "Sleek Tech Pte Ltd. 28C Stanley Street 068737 SINGAPORE EA 1758937",
        "page": 0,
        "value": [
          1199,
          300,
          1402,
          451,
          1300.5,
          375.5,
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937"
        ]
      }
    ]
  },
  "Currency": {
    "UICategory": "VAT & Amounts",
    "UIName": "Currency",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          1092,
          1027,
          1218,
          1048,
          1155,
          1037.5,
          "TOTAL SGD",
          "TOTAL SGD"
        ],
        "match": "SGD",
        "matchmulti": "TOTAL SGD",
        "page": 0,
        "value": [
          1092,
          1027,
          1218,
          1048,
          1155,
          1037.5,
          "TOTAL SGD",
          "TOTAL SGD"
        ]
      },
      {
        "keyword": [
          1011,
          1125,
          1217,
          1147,
          1114,
          1136,
          "AMOUNT DUE SGD",
          "AMOUNT DUE SGD"
        ],
        "match": "SGD",
        "matchmulti": "AMOUNT DUE SGD",
        "page": 0,
        "value": [
          1011,
          1125,
          1217,
          1147,
          1114,
          1136,
          "AMOUNT DUE SGD",
          "AMOUNT DUE SGD"
        ]
      }
    ]
  },
  "Customer": null,
  "DetectedText": "Invoice Date 13 Nov 2018 Invoice Number INV-4412 Sleek Tech Pte Ltd. 28C Stanley Street 068737 SINGAPORE EA 1758937 NOTABUM PTE LTD 32 Carpenter street ] # 03-01 SINGAPORE 059911 SINGAPORE Description Quantity Unit Price Amount SGD Corporate Secretary 1.00 800.00 800.00 Incorporation Discount 1.00 ( 500.00 ) ( 500.00 ) Subtotal 300.00 TOTAL TAX 0.00 TOTAL SGD 300.00 Less Amount Paid 300.00 AMOUNT DUE SGD 0.00 Due Date: 13 Nov 2018 Customer Invoice Number NOTABUM PTE LTD INV-4412 Amount Due Due Date 0.00 13 Nov 2018 To Sleek Tech Pte.Ltd. 28C Stanley Street 068737 SINGAPORE EA 1758937 Amount Enclosed Enter the amount you are paying above Company Registration No 201708433H.Registered Office: 28C Stanley Street ,068737 Singapore. ",
  "DocSize": [
    [
      2000,
      1546
    ]
  ],
  "Email": {
    "UICategory": "Vendor & Customer",
    "UIName": "Email",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "Freight": {
    "UICategory": "VAT & Amounts",
    "UIName": "Freight",
    "UIType": "Amount",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "IBAN": {
    "UICategory": "Payment Instructions",
    "UIName": "IBAN",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "InvoiceDate": {
    "UICategory": "Basic Information",
    "UIName": "Invoice Date",
    "UIType": "Date",
    "matches": [
      {
        "keyword": [
          921,
          295,
          1044,
          316,
          982.5,
          305.5,
          "Invoice Date",
          "Invoice Date"
        ],
        "match": "2018-11-13",
        "matchmulti": "13 Nov 2018",
        "page": 0,
        "value": [
          921,
          322,
          1046,
          343,
          983.5,
          332.5,
          "13 Nov 2018",
          "13 Nov 2018"
        ]
      }
    ]
  },
  "InvoiceNumber": {
    "UICategory": "Basic Information",
    "UIName": "Invoice Number",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          863,
          1553,
          1020,
          1577,
          941.5,
          1565,
          "Invoice Number",
          "Invoice Number"
        ],
        "match": "INV-4412",
        "matchmulti": "INV-4412",
        "page": 0,
        "value": [
          1078,
          1557,
          1170,
          1576,
          1124,
          1566.5,
          "INV-4412",
          "INV-4412"
        ]
      }
    ]
  },
  "LineItems": [
    [
      {
        "Amount SGD ": [
          "800.00"
        ],
        "Description ": [
          "Corporate Secretary"
        ],
        "Quantity ": [
          "1.00"
        ],
        "Unit Price ": [
          "800.00"
        ]
      },
      {
        "Amount SGD ": [
          "( 500.00 )"
        ],
        "Description ": [
          "Incorporation Discount"
        ],
        "Quantity ": [
          "1.00"
        ],
        "Unit Price ": [
          "( 500.00 )"
        ]
      }
    ]
  ],
  "LineItems_standardHeader": [
    [
      {
        "Description": "Corporate Secretary",
        "LineAmount": 800,
        "Quantity": 1,
        "UnitAmount": 800
      },
      {
        "Description": "Incorporation Discount",
        "LineAmount": 500,
        "Quantity": 1,
        "UnitAmount": 500
      }
    ]
  ],
  "OtherAddress": {
    "UICategory": "Vendor & Customer",
    "UIName": "Other Address",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          148,
          380,
          367,
          534,
          257.5,
          457,
          "NOTABUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE",
          "NOTARUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE"
        ],
        "match": "NOTABUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE",
        "matchmulti": "NOTARUM PTE LTD 32 Carpenter street ] # 03-01 SINGAPORE 059911 SINGAPORE",
        "page": 0,
        "value": [
          148,
          380,
          367,
          534,
          257.5,
          457,
          "NOTABUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE",
          "NOTARUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE"
        ]
      }
    ]
  },
  "OtherDate": {
    "UICategory": "Basic Information",
    "UIName": "Other Date",
    "UIType": "Date",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "PONumber": {
    "UICategory": "Vendor & Customer",
    "UIName": "PO Number",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "PaymentDate": {
    "UICategory": "Basic Information",
    "UIName": "Payment Date",
    "UIType": "Date",
    "matches": [
      {
        "keyword": [
          71,
          1233,
          353,
          1258,
          212,
          1245.5,
          "Due Date: 13 Nov 2018",
          "Due Date: 13 Nov 2018"
        ],
        "match": "2018-11-13",
        "matchmulti": "Due Date: 13 Nov 2018",
        "page": 0,
        "value": [
          71,
          1233,
          353,
          1258,
          212,
          1245.5,
          "Due Date: 13 Nov 2018",
          "Due Date: 13 Nov 2018"
        ]
      }
    ]
  },
  "SenderAddress": {
    "UICategory": "Vendor & Customer",
    "UIName": "Vendor Address",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          1199,
          300,
          1402,
          451,
          1300.5,
          375.5,
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937"
        ],
        "match": "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
        "matchmulti": "Sleek Tech Pte Ltd. 28C Stanley Street 068737 SINGAPORE EA 1758937",
        "page": 0,
        "value": [
          1199,
          300,
          1402,
          451,
          1300.5,
          375.5,
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
          "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937"
        ]
      }
    ]
  },
  "ShippingAddress": {
    "UICategory": "Vendor & Customer",
    "UIName": "Shipping Address",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "SmallBoxes": [
    {
      "box": [
        921,
        295,
        1044,
        316,
        982.5,
        305.5,
        "Invoice Date",
        "Invoice Date"
      ],
      "page": 0
    },
    {
      "box": [
        921,
        322,
        1046,
        343,
        983.5,
        332.5,
        "13 Nov 2018",
        "13 Nov 2018"
      ],
      "page": 0
    },
    {
      "box": [
        920,
        367,
        1077,
        389,
        998.5,
        378,
        "Invoice Number",
        "Invoice Number"
      ],
      "page": 0
    },
    {
      "box": [
        920,
        394,
        1012,
        415,
        966,
        404.5,
        "INV-4412",
        "INV-4412"
      ],
      "page": 0
    },
    {
      "box": [
        1200,
        300,
        1402,
        321,
        1301,
        310.5,
        "Sleek Tech Pte Ltd.",
        "Sleek Tech Pte Ltd."
      ],
      "page": 0
    },
    {
      "box": [
        1200,
        333,
        1388,
        360,
        1294,
        346.5,
        "28C Stanley Street",
        "28C Stanley Street"
      ],
      "page": 0
    },
    {
      "box": [
        1199,
        365,
        1273,
        387,
        1236,
        376,
        "068737",
        "068737"
      ],
      "page": 0
    },
    {
      "box": [
        1199,
        396,
        1332,
        420,
        1265.5,
        408,
        "SINGAPORE",
        "SINGAPORE"
      ],
      "page": 0
    },
    {
      "box": [
        1200,
        431,
        1323,
        451,
        1261.5,
        441,
        "EA 1758937",
        "EA 1758937"
      ],
      "page": 0
    },
    {
      "box": [
        150,
        380,
        367,
        403,
        258.5,
        391.5,
        "NOTABUM PTE LTD",
        "NOTARUM PTE LTD"
      ],
      "page": 0
    },
    {
      "box": [
        149,
        413,
        348,
        441,
        248.5,
        427,
        "32 Carpenter street ]",
        "32 Carpenter street ]"
      ],
      "page": 0
    },
    {
      "box": [
        148,
        445,
        214,
        467,
        181,
        456,
        "# 03-01",
        "# 03-01"
      ],
      "page": 0
    },
    {
      "box": [
        148,
        478,
        360,
        501,
        254,
        489.5,
        "SINGAPORE 059911",
        "SINGAPORE 059911"
      ],
      "page": 0
    },
    {
      "box": [
        148,
        511,
        280,
        534,
        214,
        522.5,
        "SINGAPORE",
        "SINGAPORE"
      ],
      "page": 0
    },
    {
      "box": [
        82,
        729,
        193,
        757,
        137.5,
        743,
        "Description",
        "Description"
      ],
      "page": 0
    },
    {
      "box": [
        935,
        737,
        1017,
        766,
        976,
        751.5,
        "Quantity",
        "Quantity"
      ],
      "page": 0
    },
    {
      "box": [
        1125,
        741,
        1221,
        762,
        1173,
        751.5,
        "Unit Price",
        "Unit Price"
      ],
      "page": 0
    },
    {
      "box": [
        1292,
        742,
        1425,
        764,
        1358.5,
        753,
        "Amount SGD",
        "Amount SGD"
      ],
      "page": 0
    },
    {
      "box": [
        81,
        788,
        284,
        816,
        182.5,
        802,
        "Corporate Secretary",
        "Corporate Secretary"
      ],
      "page": 0
    },
    {
      "box": [
        976,
        798,
        1016,
        817,
        996,
        807.5,
        "1.00",
        "1.00"
      ],
      "page": 0
    },
    {
      "box": [
        1153,
        798,
        1220,
        820,
        1186.5,
        809,
        "800.00",
        "800.00"
      ],
      "page": 0
    },
    {
      "box": [
        1357,
        800,
        1424,
        821,
        1390.5,
        810.5,
        "800.00",
        "800.00"
      ],
      "page": 0
    },
    {
      "box": [
        80,
        845,
        305,
        870,
        192.5,
        857.5,
        "Incorporation Discount",
        "Incorporation Discount"
      ],
      "page": 0
    },
    {
      "box": [
        976,
        855,
        1015,
        873,
        995.5,
        864,
        "1.00",
        "1.00"
      ],
      "page": 0
    },
    {
      "box": [
        1138,
        854,
        1219,
        882,
        1178.5,
        868,
        "( 500.00 )",
        "( 500.00 )"
      ],
      "page": 0
    },
    {
      "box": [
        1342,
        856,
        1423,
        884,
        1382.5,
        870,
        "( 500.00 )",
        "( 500.00 )"
      ],
      "page": 0
    },
    {
      "box": [
        1139,
        913,
        1219,
        934,
        1179,
        923.5,
        "Subtotal",
        "Subtotal"
      ],
      "page": 0
    },
    {
      "box": [
        1356,
        916,
        1423,
        936,
        1389.5,
        926,
        "300.00",
        "300.00"
      ],
      "page": 0
    },
    {
      "box": [
        1091,
        970,
        1219,
        989,
        1155,
        979.5,
        "TOTAL TAX",
        "TOTAL TAX"
      ],
      "page": 0
    },
    {
      "box": [
        1380,
        971,
        1421,
        989,
        1400.5,
        980,
        "0.00",
        "0.00"
      ],
      "page": 0
    },
    {
      "box": [
        1092,
        1027,
        1218,
        1048,
        1155,
        1037.5,
        "TOTAL SGD",
        "TOTAL SGD"
      ],
      "page": 0
    },
    {
      "box": [
        1355,
        1028,
        1422,
        1051,
        1388.5,
        1039.5,
        "300.00",
        "300.00"
      ],
      "page": 0
    },
    {
      "box": [
        1037,
        1067,
        1217,
        1091,
        1127,
        1079,
        "Less Amount Paid",
        "Less Amount Paid"
      ],
      "page": 0
    },
    {
      "box": [
        1355,
        1070,
        1422,
        1091,
        1388.5,
        1080.5,
        "300.00",
        "300.00"
      ],
      "page": 0
    },
    {
      "box": [
        1011,
        1125,
        1217,
        1147,
        1114,
        1136,
        "AMOUNT DUE SGD",
        "AMOUNT DUE SGD"
      ],
      "page": 0
    },
    {
      "box": [
        1378,
        1130,
        1421,
        1149,
        1399.5,
        1139.5,
        "0.00",
        "0.00"
      ],
      "page": 0
    },
    {
      "box": [
        71,
        1233,
        353,
        1258,
        212,
        1245.5,
        "Due Date: 13 Nov 2018",
        "Due Date: 13 Nov 2018"
      ],
      "page": 0
    },
    {
      "box": [
        862,
        1521,
        960,
        1541,
        911,
        1531,
        "Customer",
        "Customer"
      ],
      "page": 0
    },
    {
      "box": [
        863,
        1553,
        1020,
        1577,
        941.5,
        1565,
        "Invoice Number",
        "Invoice Number"
      ],
      "page": 0
    },
    {
      "box": [
        1078,
        1520,
        1295,
        1544,
        1186.5,
        1532,
        "NOTABUM PTE LTD",
        "NOTARUM PTE LTD"
      ],
      "page": 0
    },
    {
      "box": [
        1078,
        1557,
        1170,
        1576,
        1124,
        1566.5,
        "INV-4412",
        "INV-4412"
      ],
      "page": 0
    },
    {
      "box": [
        861,
        1599,
        986,
        1619,
        923.5,
        1609,
        "Amount Due",
        "Amount Due"
      ],
      "page": 0
    },
    {
      "box": [
        862,
        1633,
        955,
        1654,
        908.5,
        1643.5,
        "Due Date",
        "Due Date"
      ],
      "page": 0
    },
    {
      "box": [
        1075,
        1599,
        1117,
        1618,
        1096,
        1608.5,
        "0.00",
        "0.00"
      ],
      "page": 0
    },
    {
      "box": [
        1077,
        1634,
        1201,
        1655,
        1139,
        1644.5,
        "13 Nov 2018",
        "13 Nov 2018"
      ],
      "page": 0
    },
    {
      "box": [
        145,
        1589,
        170,
        1608,
        157.5,
        1598.5,
        "To",
        "To"
      ],
      "page": 0
    },
    {
      "box": [
        189,
        1589,
        390,
        1610,
        289.5,
        1599.5,
        "Sleek Tech Pte.Ltd.",
        "Sleek Tech Pte.Ltd."
      ],
      "page": 0
    },
    {
      "box": [
        188,
        1622,
        377,
        1647,
        282.5,
        1634.5,
        "28C Stanley Street",
        "28C Stanley Street"
      ],
      "page": 0
    },
    {
      "box": [
        188,
        1656,
        261,
        1676,
        224.5,
        1666,
        "068737",
        "068737"
      ],
      "page": 0
    },
    {
      "box": [
        188,
        1687,
        320,
        1710,
        254,
        1698.5,
        "SINGAPORE",
        "SINGAPORE"
      ],
      "page": 0
    },
    {
      "box": [
        188,
        1722,
        313,
        1741,
        250.5,
        1731.5,
        "EA 1758937",
        "EA 1758937"
      ],
      "page": 0
    },
    {
      "box": [
        860,
        1677,
        1036,
        1698,
        948,
        1687.5,
        "Amount Enclosed",
        "Amount Enclosed"
      ],
      "page": 0
    },
    {
      "box": [
        1073,
        1718,
        1423,
        1744,
        1248,
        1731,
        "Enter the amount you are paying above",
        "Enter the amount you are paying above"
      ],
      "page": 0
    },
    {
      "box": [
        64,
        1887,
        871,
        1917,
        467.5,
        1902,
        "Company Registration No 201708433H.Registered Office: 28C Stanley Street ,068737 Singapore.",
        "Company Registration No 201708433H.Registered Office: 28C Stanley Street ,068737 Singapore."
      ],
      "page": 0
    }
  ],
  "Subtotal": {
    "UICategory": "VAT & Amounts",
    "UIName": "Subtotal",
    "UIType": "Amount",
    "matches": [
      {
        "keyword": [
          1139,
          800,
          1219,
          821,
          1179,
          923.5,
          "Subtotal",
          "Subtotal"
        ],
        "match": 300,
        "matchmulti": "300.00",
        "page": 0,
        "value": [
          1356,
          916,
          1423,
          936,
          1389.5,
          926,
          "300.00",
          "300.00"
        ]
      }
    ]
  },
  "Supplier": null,
  "SwiftCode": {
    "UICategory": "Payment Instructions",
    "UIName": "Swift Code",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "TableDetected": true,
  "Tables": [
    {
      "GridX": [
        82,
        564,
        1071,
        1256.5,
        1525
      ],
      "GridY": [
        800,
        856,
        897
      ],
      "GridYPages": [
        0,
        0,
        0
      ],
      "HeaderPage": 0,
      "header": [
        77,
        727,
        1430,
        768
      ],
      "headernum": 4
    }
  ],
  "TaxTotal": {
    "UICategory": "VAT & Amounts",
    "UIName": "Tax Total",
    "UIType": "Amount",
    "matches": [
      {
        "keyword": [
          1091,
          970,
          1219,
          989,
          1155,
          979.5,
          "TOTAL TAX",
          "TOTAL TAX"
        ],
        "match": 0,
        "matchmulti": "0.00",
        "page": 0,
        "value": [
          1380,
          971,
          1421,
          989,
          1400.5,
          980,
          "0.00",
          "0.00"
        ]
      }
    ]
  },
  "Total": {
    "UICategory": "VAT & Amounts",
    "UIName": "Total",
    "UIType": "Amount",
    "matches": [
      {
        "keyword": [
          1092,
          914,
          1218,
          935,
          1155,
          1037.5,
          "TOTAL SGD",
          "TOTAL SGD"
        ],
        "match": 300,
        "matchmulti": "300.00",
        "page": 0,
        "value": [
          1355,
          1028,
          1422,
          1051,
          1388.5,
          1039.5,
          "300.00",
          "300.00"
        ]
      }
    ]
  },
  "Type": "invoice_pdf",
  "URL": {
    "UICategory": "Vendor & Customer",
    "UIName": "URL",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "matchmulti": null,
        "page": null,
        "value": null
      }
    ]
  },
  "num_pages": 1
}
```

**SDK Code**

```python Extract Invoice
import requests

url = "https://api.staple.io/v1/documents/extract/invoice"

files = { "file": "open('string', 'rb')" }
headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Extract Invoice
const url = 'https://api.staple.io/v1/documents/extract/invoice';
const form = new FormData();
form.append('file', 'string');

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 Extract Invoice
package main

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

func main() {

	url := "https://api.staple.io/v1/documents/extract/invoice"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\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 Extract Invoice
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/extract/invoice")

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=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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

```java Extract Invoice
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/extract/invoice")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/extract/invoice', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Extract Invoice
using RestSharp;

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

```swift Extract Invoice
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ]
]

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/extract/invoice")! 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()
```