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
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 -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
{
"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:| Parameter | In | Type | Required | Description |
|---|
uuid | path | string | ✅ | Transaction UUID |
Response Schema (TransactionInvoiceResponse):| Field | Type | Example |
|---|
transactionUuid | string | 4ea5a94a-2c3c-4601-b623-c30260c21dbc |
invoices | array of InvoiceResponse | |
GET /api/v3/invoices
Find all Invoices with optional filtersParameters:| Parameter | In | Type | Required | Description |
|---|
page | query | integer | | Zero-based page index (0..N) |
size | query | integer | | The size of the page to be returned |
invoiceNumber | query | string | | Invoice number to filter invoices |
issuerRfc | query | string | | RFC Issuer number to filter invoices |
transactionUuid | query | string | | Transaction UUID to filter invoices |
invoiceId | query | string | | Invoice ID to filter invoices |
documentDateRangeStart | query | string | | Start date for invoice date range filter (must be used together with documentDateRangeEnd) |
documentDateRangeEnd | query | string | | End date for invoice date range filter (must be used together with documentDateRangeStart) |
Response Schema (InvoicePageV3):| Field | Type | Example |
|---|
totalPages | integer (int32) | |
totalElements | integer (int64) | |
first | boolean | |
last | boolean | |
size | integer (int32) | |
content | array of InvoiceV3 | |
number | integer (int32) | |
sort | object (SortObject) | |
pageable | object (PageableObject) | |
numberOfElements | integer (int32) | |
empty | boolean | |
sort object (SortObject):| Field | Type | Example |
|---|
empty | boolean | |
sorted | boolean | |
unsorted | boolean | |
pageable object (PageableObject):| Field | Type | Example |
|---|
offset | integer (int64) | |
sort | object (SortObject) | |
paged | boolean | |
pageNumber | integer (int32) | |
pageSize | integer (int32) | |
unpaged | boolean | |