Operations using API

How Staple’s APIs may be used to automate specific tasks?

Invoice flow with no human interaction

In this section, we describe the API process for sending a document to Staple, and immediately receiving Staple's predicted data for the document without any human intervention. Scanning a document is a primary function of Staple. Here is an example of a flow where a user scans an invoice document using the API calls.

1. POST Registration

To register an account via the API, navigate to the endpoint that belongs to the Registration of the user (Staple API documentation > Users > Registration). Hover over to the request section and go to the “Body” tab. This tab consists of a request sent to the server. Fill out the information in all required fields. The optional fields can be blank, but we recommend filling in all user details. An example of the Registration is shown below.

Untitled

After editing the code, send the request by clicking on the “Send” button. It sends the request to the server and accepts a response with the requested data. A response with two fields, an access token (accessToken) and a refresh token (refreshToken), is generated.

Untitled

The access token is used for the authentication of the user. Once a user is registered and logged in, the access token is used in identifying the user. Any request sent by this user has the access token in its header. This helps the server to identify which user is making the request.

The access token is short-lived. It can be used only for some time after which the user will have to re-authenticate themselves and generate a new access token. This can be skipped using the refresh token. It requests the API to get a new access token that allows the user to continue accessing the application resources.

2. POST Login

Once a user is registered, they can log in to the server using the credentials used in the registration. Navigate to the endpoint that belongs to logging in the user. In the request section, open the tab containing the body of the request and enter the credentials.

Untitled

This creates a response and gives tokens to the user. Here, an additional token (apiKey) is generated. The api key is used for uniquely identifying the user and authenticating its requests and access to resources.

Untitled

3. POST Create Group

To upload a document to a user’s account, a group must be present. A group contains a queue which holds similar types of documents. If a group is not present, the user has to create a group. An endpoint is curated for the same.

In the endpoint, the user needs to fill out the required fields in the headers section. The headers are an important part of the API request and response as they contain meta-data associated with the request and response. For the user to have access to the resources to be accessed by the request, some fields of the headers should be updated.

The mandatory fields are “Authorization” and “x-api-key”.

Untitled

In the "Authorization" of the Headers section, replace the token variable with the value of the access token generated after logging in and keep the word “Bearer” undisturbed. Next, edit the value column for the key named “x-api-key” to the value of generated apiKey. Each step after this will need the x-api-key and Authorization values to be altered. It ensures that the current user has access to the operations being performed via the request. In the Body section, fill in the required fields.

Untitled

This generates a response with details of the created group. The “id” field holds the unique id for the generated group.

Untitled

4. POST Create Queue

To create a queue, follow the same steps as above in the code for creating a group. Set the qid field to the id of the desired group in integer format. Then, fill out the fields in the body section. Users can set the optional fields to null or leave them untouched.

Untitled

This generates the response with details of the queue created.

Untitled

5. POST Upload Multiple Documents

There are various ways to upload a document. Users can upload multiple documents or upload each document by the document type. Navigate to the code section corresponding to uploading documents. Here, fill out the required headers. There are two fields to be filled up in the body section. The "qid" is the id of the queue where the documents have to be uploaded while the "files" rows take a file as its input. To do so, we need to change the data type of “files” to Files. Click on the empty space beside “files” in the same cell. A dropdown showing data types will be displayed. Select Files from the same. Then, choose the file from the device.

Untitled

The generated response will be:

Untitled

6. POST Scan Invoice

Another method to upload documents is by scanning the document according to its document type.

This returns a response as

{
 "scanDocuments": {
   "data": {
     "num_pages": 1,
     "Type": "invoice_pdf",
     "DocSize": [
       [
         2000,
         1546
       ]
     ],
     "Customer": null,
     "Supplier": null,
     "TableDetected": true,
     "DetectedText": "Invoice Date 13 Nov 2018 Invoice Number INV-4412 Sleek Tech Pte Ltd. 28C Stanley Street 068737 SINGAPORE EA 1758937 NOTARUM 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 NOTARUM 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. ",
     "InvoiceNumber": {
       "matches": [
         {
           "match": "INV-4412",
           "matchmulti": null,
           "value": [
             1078,
             1557,
             1170,
             1576,
             1124,
             1566.5,
             "INV-4412",
             "INV-4412"
           ],
           "keyword": [
             863,
             1553,
             1020,
             1577,
             941.5,
             1565,
             "Invoice Number",
             "Invoice Number"
           ],
           "page": 0
         }
       ],
       "UICategory": "Basic Information",
       "UIName": "Invoice Number",
       "UIType": "Text"
     },
     "PONumber": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "PO Number",
       "UIType": "Text"
     },
     "AccountNumber": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Payment Instructions",
       "UIName": "Account Number",
       "UIType": "Text"
     },
     "AccountName": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Payment Instructions",
       "UIName": "Account Name",
       "UIType": "Text"
     },
     "SwiftCode": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Payment Instructions",
       "UIName": "Swift Code",
       "UIType": "Text"
     },
     "IBAN": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Payment Instructions",
       "UIName": "IBAN",
       "UIType": "Text"
     },
     "Email": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "Email",
       "UIType": "Text"
     },
     "URL": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "URL",
       "UIType": "Text"
     },
     "Total": {
       "matches": [
         {
           "match": 300,
           "matchmulti": null,
           "value": [
             1355,
             1028,
             1422,
             1051,
             1388.5,
             1039.5,
             "300.00",
             "300.00"
           ],
           "keyword": [
             1092,
             914,
             1218,
             935,
             1155,
             1037.5,
             "TOTAL SGD",
             "TOTAL SGD"
           ],
           "page": 0
         }
       ],
       "UICategory": "VAT & Amounts",
       "UIName": "Total",
       "UIType": "Amount"
     },
     "Subtotal": {
       "matches": [
         {
           "match": 300,
           "matchmulti": null,
           "value": [
             1356,
             916,
             1423,
             936,
             1389.5,
             926,
             "300.00",
             "300.00"
           ],
           "keyword": [
             1139,
             800,
             1219,
             821,
             1179,
             923.5,
             "Subtotal",
             "Subtotal"
           ],
           "page": 0
         }
       ],
       "UICategory": "VAT & Amounts",
       "UIName": "Subtotal",
       "UIType": "Amount"
     },
     "TaxTotal": {
       "matches": [
         {
           "match": 0,
           "matchmulti": null,
           "value": [
             1380,
             971,
             1421,
             989,
             1400.5,
             980,
             "0.00",
             "0.00"
           ],
           "keyword": [
             1091,
             970,
             1219,
             989,
             1155,
             979.5,
             "TOTAL TAX",
             "TOTAL TAX"
           ],
           "page": 0
         }
       ],
       "UICategory": "VAT & Amounts",
       "UIName": "Tax Total",
       "UIType": "Amount"
     },
     "Currency": {
       "matches": [
         {
           "match": "SGD",
           "matchmulti": null,
           "value": [
             1092,
             1027,
             1218,
             1048,
             1155,
             1037.5,
             "TOTAL SGD",
             "TOTAL SGD"
           ],
           "keyword": [
             1092,
             1027,
             1218,
             1048,
             1155,
             1037.5,
             "TOTAL SGD",
             "TOTAL SGD"
           ],
           "page": 0
         },
         {
           "match": "SGD",
           "matchmulti": null,
           "value": [
             1011,
             1125,
             1217,
             1147,
             1114,
             1136,
             "AMOUNT DUE SGD",
             "AMOUNT DUE SGD"
           ],
           "keyword": [
             1011,
             1125,
             1217,
             1147,
             1114,
             1136,
             "AMOUNT DUE SGD",
             "AMOUNT DUE SGD"
           ],
           "page": 0
         }
       ],
       "UICategory": "VAT & Amounts",
       "UIName": "Currency",
       "UIType": "Text"
     },
     "Tables": [
       {
         "header": [
           77,
           727,
           1430,
           768
         ],
         "GridX": [
           82,
           564,
           1071,
           1256.5,
           1525
         ],
         "GridY": [
           800,
           856,
           897
         ],
         "headernum": 4,
         "HeaderPage": 0,
         "GridYPages": [
           0,
           0,
           0
         ]
       }
     ],
     "LineItems": [
       [
         {
           "Description ": [
             "Corporate Secretary"
           ],
           "Quantity ": [
             "1.00"
           ],
           "Unit Price ": [
             "800.00"
           ],
           "Amount SGD ": [
             "800.00"
           ]
         },
         {
           "Description ": [
             "Incorporation Discount"
           ],
           "Quantity ": [
             "1.00"
           ],
           "Unit Price ": [
             "( 500.00 )"
           ],
           "Amount SGD ": [
             "( 500.00 )"
           ]
         }
       ]
     ],
     "LineItems_standardHeader": [
       [
         {
           "Description": "Corporate Secretary",
           "Quantity": 1,
           "UnitAmount": 800,
           "LineAmount": 800
         },
         {
           "Description": "Incorporation Discount",
           "Quantity": 1,
           "UnitAmount": 500,
           "LineAmount": 500
         }
       ]
     ],
     "Freight": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "VAT & Amounts",
       "UIName": "Freight",
       "UIType": "Amount"
     },
     "BillingAddress": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "Billing Address",
       "UIType": "Text"
     },
     "ShippingAddress": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "Shipping Address",
       "UIType": "Text"
     },
     "CompanyName": {
       "matches": [
         {
           "match": "Sleek Tech Pte Ltd.",
           "matchmulti": null,
           "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"
           ],
           "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"
           ],
           "page": 0
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "Vendor Name",
       "UIType": "Text"
     },
     "SenderAddress": {
       "matches": [
         {
           "match": "Sleek Tech Pte Ltd.\n28C Stanley Street\n068737\nSINGAPORE\nEA 1758937",
           "matchmulti": null,
           "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"
           ],
           "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"
           ],
           "page": 0
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "Vendor Address",
       "UIType": "Text"
     },
     "OtherAddress": {
       "matches": [
         {
           "match": "NOTARUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE",
           "matchmulti": null,
           "value": [
             148,
             380,
             367,
             534,
             257.5,
             457,
             "NOTARUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE",
             "NOTARUM PTE LTD\n32 Carpenter street ]\n# 03-01\nSINGAPORE 059911\nSINGAPORE"
           ],
           "keyword": [
             148,
             380,
             367,
             534,
             257.5,
             457,
             "NOTARUM 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
         }
       ],
       "UICategory": "Vendor & Customer",
       "UIName": "Other Address",
       "UIType": "Text"
     },
     "InvoiceDate": {
       "matches": [
         {
           "match": "2018-11-13",
           "matchmulti": null,
           "value": [
             921,
             322,
             1046,
             343,
             983.5,
             332.5,
             "13 Nov 2018",
             "13 Nov 2018"
           ],
           "keyword": [
             921,
             295,
             1044,
             316,
             982.5,
             305.5,
             "Invoice Date",
             "Invoice Date"
           ],
           "page": 0
         }
       ],
       "UICategory": "Basic Information",
       "UIName": "Invoice Date",
       "UIType": "Date"
     },
     "PaymentDate": {
       "matches": [
         {
           "match": "2018-11-13",
           "matchmulti": null,
           "value": [
             71,
             1233,
             353,
             1258,
             212,
             1245.5,
             "Due Date: 13 Nov 2018",
             "Due Date: 13 Nov 2018"
           ],
           "keyword": [
             71,
             1233,
             353,
             1258,
             212,
             1245.5,
             "Due Date: 13 Nov 2018",
             "Due Date: 13 Nov 2018"
           ],
           "page": 0
         }
       ],
       "UICategory": "Basic Information",
       "UIName": "Payment Date",
       "UIType": "Date"
     },
     "OtherDate": {
       "matches": [
         {
           "match": null,
           "value": null,
           "keyword": null,
           "page": null
         }
       ],
       "UICategory": "Basic Information",
       "UIName": "Other Date",
       "UIType": "Date"
     },
     "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,
           "NOTARUM 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,
           "NOTARUM 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
       }
     ],
     "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,
           "NOTARUM 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,
           "NOTARUM 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
       }
     ]
   },
   "docId": 8721,
   "status": "COMPLETED"
 }
}

7. GET Get Document by ID

To get a document in JSON format, go to the endpoint named “Get document”. This is a Get request fetching information from the server. In this case, it returns the scanned document. Users can also export the document. The difference between the two is that the get request returns the document in a rich format while export is mostly used for automation solutions. Fill up the "x-api-key" and "accessKey" in the headers. In the request URL, replace the docID variable with the id of the document to be accessed. Send the request and the response containing all the information is received.

Untitled

The changes will be reflected in the account.

Untitled

8. POST Export Document by ID

Users can export the document once it is completed. The endpoint “Export Document by ID” facilitates this. To complete the request, users have to add the two headers of “API key” and “Authorization”. Following this, the user has to enter their document ID in the URL.

Untitled

9. POST Change Multiple Documents to Complete

To move document/s to the completed tab, users can resort to the “Change multiple Documents to complete” endpoint. The headers required to complete this request are the “API key” and the “Authorization token”. The document/s to be moved are specified in the request payload. Here, users can mention an array of all the documents to be moved.

Request:

Untitled

Response:

Untitled

Previous:

Next:

Next:

Previous:

Want to know more?