> 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 Indian Receipt

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

Scan a document using the Indian Receipt 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-indian-receipt

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/scan/indian-receipt:
    post:
      operationId: scanIndianReceipt
      summary: Scan Indian Receipt
      description: >-
        Scan a document using the Indian Receipt 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_scanIndianReceipt_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_scanIndianReceipt_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_scanIndianReceipt_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 Indian Receipt



**Request**

```json
{}
```

**Response**

```json
{
  "scanDocuments": {
    "data": {
      "BillingAddress": null,
      "BillingAddressCity": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressCountry": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressLine1": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressLine2": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressOther": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressPostalCode": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressState": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "CentralGST": null,
      "Currency": {
        "Content": "INR",
        "keyword": null,
        "value": null
      },
      "DetectedText": "Delicacy Hospitality India Pvt ltd Nizanpet Cross Road.Kukatpally.Hyderabad Date: 26/03/2018 Billed By: Shashikala Order Type: Zomato Guest Name: 7282 \\ 9016 Time: 23:02 Bill No: 77 Table: 27 Itea Nane Oty Price Chinese Veg Platter 1 339.0 Total no.items: 1 : Total no.qty: 1 Sub Total Gst 5% 339 16.95 Grand Total 356.0 Three Hundred Fifty Six Rupees Only. Free Home Delivery: 9133352228/9 GSTIN: 36AAFC064564225 Thank you ! Please visit again. ",
      "Discount": null,
      "DocSize": [
        [
          1920,
          1248
        ]
      ],
      "Email": null,
      "GSTNumber": {
        "Content": 6456422,
        "pos": [
          295,
          1688,
          639,
          1748
        ]
      },
      "IntegratedGST": null,
      "LineItems": [],
      "LineItems_standardHeader": [],
      "OtherDate": {
        "Content": "2018-03-26",
        "pos": [
          302,
          387,
          503,
          445
        ],
        "score": 0.75
      },
      "ServiceCharge": null,
      "StateGST": null,
      "Subtotal": null,
      "TableDetected": false,
      "TaxTotal": {
        "Content": 16.95,
        "pos": [
          1031,
          1250,
          1135,
          1308
        ]
      },
      "Total": {
        "Content": 356,
        "pos": [
          830,
          1389,
          1044,
          1451
        ]
      },
      "Type": "indianreceipt",
      "UENNumber": null,
      "URL": null,
      "VendorName": null
    },
    "docId": 7974,
    "status": "COMPLETED"
  }
}
```

**SDK Code**

```python Scan Indian Receipt
import requests

url = "https://api.staple.io/v1/documents/scan/indian-receipt"

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 Indian Receipt
const url = 'https://api.staple.io/v1/documents/scan/indian-receipt';
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 Indian Receipt
package main

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

func main() {

	url := "https://api.staple.io/v1/documents/scan/indian-receipt"

	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 Indian Receipt
require 'uri'
require 'net/http'

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

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 Indian Receipt
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Scan Indian Receipt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Scan Indian Receipt
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/scan/indian-receipt");
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 Indian Receipt
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/indian-receipt")! 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_scanIndianReceipt_example



**Request**

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

**Response**

```json
{
  "scanDocuments": {
    "data": {
      "BillingAddress": null,
      "BillingAddressCity": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressCountry": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressLine1": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressLine2": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressOther": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressPostalCode": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "BillingAddressState": {
        "keyword": null,
        "match": null,
        "value": null
      },
      "CentralGST": null,
      "Currency": {
        "Content": "INR",
        "keyword": null,
        "value": null
      },
      "DetectedText": "Delicacy Hospitality India Pvt ltd Nizanpet Cross Road.Kukatpally.Hyderabad Date: 26/03/2018 Billed By: Shashikala Order Type: Zomato Guest Name: 7282 \\ 9016 Time: 23:02 Bill No: 77 Table: 27 Itea Nane Oty Price Chinese Veg Platter 1 339.0 Total no.items: 1 : Total no.qty: 1 Sub Total Gst 5% 339 16.95 Grand Total 356.0 Three Hundred Fifty Six Rupees Only. Free Home Delivery: 9133352228/9 GSTIN: 36AAFC064564225 Thank you ! Please visit again. ",
      "Discount": null,
      "DocSize": [
        [
          1920,
          1248
        ]
      ],
      "Email": null,
      "GSTNumber": {
        "Content": 6456422,
        "pos": [
          295,
          1688,
          639,
          1748
        ]
      },
      "IntegratedGST": null,
      "LineItems": [],
      "LineItems_standardHeader": [],
      "OtherDate": {
        "Content": "2018-03-26",
        "pos": [
          302,
          387,
          503,
          445
        ],
        "score": 0.75
      },
      "ServiceCharge": null,
      "StateGST": null,
      "Subtotal": null,
      "TableDetected": false,
      "TaxTotal": {
        "Content": 16.95,
        "pos": [
          1031,
          1250,
          1135,
          1308
        ]
      },
      "Total": {
        "Content": 356,
        "pos": [
          830,
          1389,
          1044,
          1451
        ]
      },
      "Type": "indianreceipt",
      "UENNumber": null,
      "URL": null,
      "VendorName": null
    },
    "docId": 7974,
    "status": "COMPLETED"
  }
}
```

**SDK Code**

```python Documents_scanIndianReceipt_example
import requests

url = "https://api.staple.io/v1/documents/scan/indian-receipt"

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_scanIndianReceipt_example
const url = 'https://api.staple.io/v1/documents/scan/indian-receipt';
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_scanIndianReceipt_example
package main

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

func main() {

	url := "https://api.staple.io/v1/documents/scan/indian-receipt"

	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_scanIndianReceipt_example
require 'uri'
require 'net/http'

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

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_scanIndianReceipt_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/indian-receipt")
  .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_scanIndianReceipt_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/scan/indian-receipt', [
  '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_scanIndianReceipt_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/scan/indian-receipt");
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_scanIndianReceipt_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/indian-receipt")! 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()
```