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

# Get Invoice Details

> Get invoice details including PDF/XML URLs

## Overview

Retrieve detailed information about a specific invoice, including download URLs for the PDF and XML (CFDI) files.

## Query Parameters

<ParamField query="org_id" type="string" required>
  The unique identifier of the organization
</ParamField>

<ParamField query="invoice_id" type="string" required>
  The unique identifier of the invoice
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique invoice identifier
</ResponseField>

<ResponseField name="status" type="string">
  Invoice status. Values: `pending`, `processing`, `completed`, `failed`
</ResponseField>

<ResponseField name="amount" type="number">
  Invoice total amount
</ResponseField>

<ResponseField name="subtotal" type="number">
  Invoice subtotal (before taxes)
</ResponseField>

<ResponseField name="tax" type="number">
  Tax amount (IVA)
</ResponseField>

<ResponseField name="currency" type="string">
  Currency code (e.g., `MXN`)
</ResponseField>

<ResponseField name="vendor" type="object">
  Vendor information

  <Expandable title="Vendor properties">
    <ResponseField name="name" type="string">
      Vendor/merchant name
    </ResponseField>

    <ResponseField name="rfc" type="string">
      Vendor's RFC
    </ResponseField>

    <ResponseField name="address" type="string">
      Vendor's address
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="cfdi_usage" type="string">
  CFDI usage code used
</ResponseField>

<ResponseField name="uuid" type="string">
  SAT UUID (Folio Fiscal) - unique identifier assigned by SAT
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of creation
</ResponseField>

<ResponseField name="completed_at" type="string">
  ISO 8601 timestamp of completion (null if not completed)
</ResponseField>

<ResponseField name="pdf_url" type="string">
  URL to download the invoice PDF
</ResponseField>

<ResponseField name="xml_url" type="string">
  URL to download the invoice XML (CFDI)
</ResponseField>

<ResponseField name="receipt_image_url" type="string">
  URL of the original receipt image
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://app.usatimbre.com/api/timbre/invoice?org_id=org_123456&invoice_id=inv_abc123" \
    -H "Authorization: Bearer tmb_your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    org_id: 'org_123456',
    invoice_id: 'inv_abc123'
  });
  const response = await fetch(`https://app.usatimbre.com/api/timbre/invoice?${params}`, {
    headers: {
      'Authorization': 'Bearer tmb_your_api_key_here'
    }
  });
  const invoice = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://app.usatimbre.com/api/timbre/invoice',
      params={
          'org_id': 'org_123456',
          'invoice_id': 'inv_abc123'
      },
      headers={'Authorization': 'Bearer tmb_your_api_key_here'}
  )
  invoice = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "inv_abc123",
    "status": "completed",
    "amount": 1740.00,
    "subtotal": 1500.00,
    "tax": 240.00,
    "currency": "MXN",
    "vendor": {
      "name": "Restaurant XYZ S.A. de C.V.",
      "rfc": "RXY123456ABC",
      "address": "Av. Reforma 123, CDMX"
    },
    "cfdi_usage": "G03",
    "uuid": "6B8F9D3A-1234-5678-90AB-CDEF12345678",
    "created_at": "2024-01-20T15:30:00Z",
    "completed_at": "2024-01-20T15:35:00Z",
    "pdf_url": "https://app.usatimbre.com/invoices/inv_abc123.pdf",
    "xml_url": "https://app.usatimbre.com/invoices/inv_abc123.xml",
    "receipt_image_url": "https://app.usatimbre.com/receipts/inv_abc123.jpg"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Not Found",
    "message": "Invoice not found"
  }
  ```
</ResponseExample>

## Invoice Status

| Status       | Description                                              |
| ------------ | -------------------------------------------------------- |
| `pending`    | Invoice request received, waiting to be processed        |
| `processing` | Receipt is being analyzed and invoice is being generated |
| `completed`  | Invoice generated successfully, PDF and XML available    |
| `failed`     | Invoice generation failed (check error details)          |

<Tip>
  For `processing` status, poll this endpoint every few seconds until the status changes to `completed` or `failed`.
</Tip>
