Skip to main content
Recommended for all new integrations.

When a Transaction Has an Invoice

If a transaction has invoice:
  • The hasInvoice field is set to true
  • You’ll receive a link to download them
  • URLs are valid for 12 hours

Endpoint Format

GET /v3/transactions/{uuid}/invoicesUse this endpoint to retrieve XML invoice details and metadata associated with a specific transaction.

Example: Getting Invoices for a Transaction

In the following example, we will get the invoice information for the transaction with the UUID “47f8ed9e-4d7b-450b-ad6a-f1d83e3ce4e1” in Mexico.

cURL Request

cURL
curl -X GET
"https://public-api.mx.clara.com/api/v3/transactions/47f8ed9e-4d7b-450b-ad6a-f1d83e3ce4e1/invoices" \ 
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Sample JSON Response

JSON
{
  "transactionUuid": "47f8ed9e-4d7b-450b-ad6a-f1d83e3ce4e1",
  "invoices": [
    {
      "invoiceId": "54cd6b23-5146-437f-b133-879c432e6776",
      "invoiceNumber": null,
      "taxRegime": "621",
      "issuer": {
        "rfc": "CLARA123XML",
        "businessName": "CLARA"
      },
      "taxReceipts": {
        "cfdi": "G03",
        "paymentMethod": "Q4"
      },
      "tax": {
        "retained": {
          "isr": 0.75,
          "iva": null,
          "ieps": null
        },
        "transferred": {
          "iva": 0.0,
          "ieps": 0.0
        }
      },
      "amount": {
        "total": 400.00,
        "subTotal": 300.00,
        "currency": "MXN"
      },
      "documentDate": "2024-10-01",
      "xmlStatus": "Vigente",
      "xmlCode": "S – Comprobante obtenido satisfactoriamente."
    }
  ]
}

⚠️ The download URL is temporary and will expire 12 hours after generation. Ensure you download and store the file before it expires.ℹ️ Note: The example provided contains mock data and does not reflect real tax calculations or financial details.

Endpoint Reference

GET /api/v3/transactions/{uuid}/invoices

Get a transaction by UUIDParameters:
ParameterInTypeRequiredDescription
uuidpathstringTransaction UUID
Response Schema (TransactionInvoiceResponse):
FieldTypeExample
transactionUuidstring4ea5a94a-2c3c-4601-b623-c30260c21dbc
invoicesarray of InvoiceResponse

GET /api/v3/invoices

Find all Invoices with optional filtersParameters:
ParameterInTypeRequiredDescription
pagequeryintegerZero-based page index (0..N)
sizequeryintegerThe size of the page to be returned
invoiceNumberquerystringInvoice number to filter invoices
issuerRfcquerystringRFC Issuer number to filter invoices
transactionUuidquerystringTransaction UUID to filter invoices
invoiceIdquerystringInvoice ID to filter invoices
documentDateRangeStartquerystringStart date for invoice date range filter (must be used together with documentDateRangeEnd)
documentDateRangeEndquerystringEnd date for invoice date range filter (must be used together with documentDateRangeStart)
Response Schema (InvoicePageV3):
FieldTypeExample
totalPagesinteger (int32)
totalElementsinteger (int64)
firstboolean
lastboolean
sizeinteger (int32)
contentarray of InvoiceV3
numberinteger (int32)
sortobject (SortObject)
pageableobject (PageableObject)
numberOfElementsinteger (int32)
emptyboolean
sort object (SortObject):
FieldTypeExample
emptyboolean
sortedboolean
unsortedboolean
pageable object (PageableObject):
FieldTypeExample
offsetinteger (int64)
sortobject (SortObject)
pagedboolean
pageNumberinteger (int32)
pageSizeinteger (int32)
unpagedboolean