> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ebrc.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Extract Invoice Data

> Extract structured billing data from an invoice PDF: parties, line items, amounts, and currency, ready to map against inward remittances for eBRC generation.

Extract structured billing data from an invoice PDF: vendor information, line items, amounts, and tax details.

`POST /invoices/extract` on the [Tradelens host](/api-reference/extraction/introduction#base-url).

## Request

<ParamField body="file" type="file" required>
  The invoice PDF document to process. Must be a valid PDF file under 5 MB.
</ParamField>

### Headers

<ParamField header="x-api-key" type="string" required>
  Your Tradelens API key. This is a separate key from your eBRC API key.
</ParamField>

<ParamField header="accept" type="string" default="application/json">
  Response content type (application/json)
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl --location 'https://tradelens-apis.eximfiles.io/platform/invoices/extract' \
  --header 'x-api-key: <TRADELENS_API_KEY>' \
  --header 'accept: application/json' \
  --form 'file=@"/path/to/invoice.pdf"'
  ```

  ```javascript JavaScript theme={"dark"}
  const formData = new FormData();
  formData.append('file', fileInput.files[0]);

  fetch('https://tradelens-apis.eximfiles.io/platform/invoices/extract', {
    method: 'POST',
    headers: {
      'x-api-key': '<TRADELENS_API_KEY>',
      'accept': 'application/json'
    },
    body: formData
  })
  .then(response => response.json())
  .then(data => console.log(data));
  ```

  ```python Python theme={"dark"}
  import requests

  url = "https://tradelens-apis.eximfiles.io/platform/invoices/extract"
  headers = {
      "x-api-key": "<TRADELENS_API_KEY>",
      "accept": "application/json"
  }
  files = {
      "file": open("invoice.pdf", "rb")
  }

  response = requests.post(url, headers=headers, files=files)
  data = response.json()
  ```
</CodeGroup>

## Response

<ResponseField name="status" type="string">
  Processing status (success/error)
</ResponseField>

<ResponseField name="data" type="object">
  Extracted invoice data
</ResponseField>

## Related

* [Extract eBRC-specific Shipping Bill Data](/api-reference/extraction/shipping-bills) for shipping bills.
* [Bulk Upload via Excel](/api-reference/genebrc/bulk-upload) to file extracted rows.
* [Data Extraction overview](/api-reference/extraction/introduction) for auth and limits.
