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

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

Extract the structured data from a document using the Indian Receipt 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-indian-receipt

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/extract/indian-receipt:
    post:
      operationId: extractIndianReceipt
      summary: Extract Indian receipt
      description: >-
        Extract the structured data from a document using the Indian Receipt
        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_extractIndianReceipt_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_extractIndianReceipt_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_extractIndianReceipt_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
{
  "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
}
```

**SDK Code**

```python Extract Indian Receipt
import requests

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

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

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

print(response.json())
```

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

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

func main() {

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

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

url = URI("https://api.staple.io/v1/documents/extract/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=\"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 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/extract/indian-receipt")
  .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 Indian Receipt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Extract Indian Receipt
using RestSharp;

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