> 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.

# Retrieve validation results

GET https://api.staple.io/v2/einvoice/mexico/status/{docidOrUUID}

# Get Mexico Validation Status

Retrieve the **latest** validation result for a document, by either the Staple `documentId` or the CFDI `uuid`. Returns the same shape as the *Validate Mexico E-Invoice* endpoint, reconstructed from the most recent stored validation record.

## Endpoint

`GET /v2/einvoice/mexico/status/{idOrUuid}`

## Path Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `idOrUuid` | path | String | Required | Either the Staple `documentId` (e.g. `245234`) or the CFDI `uuid` (e.g. `699628be-2f06-4bc9-adc2-860b51eecbca`). The endpoint resolves either form |

## Request Headers

| Attribute | Type | Option | Description |
| --- | --- | --- | --- |
| `x-api-key` | String | Required | A unique string |
| `Authorization` | String | Required | Bearer token |
| `Accept` | String | Optional | `application/json` |

## Response (Success)

```
{
  "documentId": "245234",
  "uuid": "699628be-2f06-4bc9-adc2-860b51eecbca",
  "validation_result": "VALID",
  "validatedAt": "2026-07-09T08:29:06.785Z",
  "invalid_reason": null,
  "steps": {
    "schema":    { "result": "PASS", "detail": null },
    "satStatus": { "result": "PASS", "detail": null },
    "rfc":       { "result": "PASS", "detail": null }
  }
}

```

## Response (INVALID)

```
{
  "documentId": "245234",
  "uuid": "699628be-2f06-4bc9-adc2-860b51eecbca",
  "validation_result": "INVALID",
  "validatedAt": "2026-07-09T08:29:06.785Z",
  "invalid_reason": "Cancelled E-Invoice",
  "steps": {
    "schema":    { "result": "PASS", "detail": null },
    "satStatus": { "result": "FAIL", "detail": "Cancelled E-Invoice" }
  }
}

```

## Response Fields

| Field | Type | Description |
| --- | --- | --- |
| `documentId` | String | The document id the validation belongs to |
| `uuid` | String | CFDI Folio Fiscal (UUID) |
| `validation_result` | String | `VALID` or `INVALID` |
| `validatedAt` | String | ISO timestamp of the validation run |
| `invalid_reason` | String | null |
| `steps` | Object | Per-step results — `schema`, `satStatus`, `rfc` |

### `steps.\*` Fields

| Field | Type | Description |
| --- | --- | --- |
| `result` | String | `PASS` or `FAIL` |
| `detail` | String | null |

Only the steps that ran in that validation are present.

## Notes

-   Returns the **most recent** validation run — a document may be validated multiple times (the history is append-only).
    
-   Resolution: a value matching the UUID format is looked up by `uuid`; otherwise it is treated as a numeric `documentId`.
    
-   This is a read-only lookup — it does **not** trigger a new validation (use the *Validate* endpoint for that).
    

## Errors

| Status | When |
| --- | --- |
| `400 Bad Request` | `idOrUuid` missing, or is neither a valid CFDI uuid nor a numeric documentId |
| `401 / 403` | Missing/invalid `x-api-key` or `Authorization`, or no access to the document |
| `404 Not Found` | No validation record exists for the given `documentId`/`uuid` (no validation has been run yet) |

* * *

That's all four Mexico endpoints documented (import → creation status → validate → validation status). Want me to paste the **Get Document Creation Status** endpoint too (the polling one), or provide the Postman **example request/response pairs** for these so you can fill the right-panel Examples quickly?

Reference: https://docs.staple.ai/api-reference/v2/e-invoice/retrieve-validation-results

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /v2/einvoice/mexico/status/{docidOrUUID}:
    get:
      operationId: retrieveValidationResults
      summary: Retrieve validation results
      description: "# Get Mexico Validation Status\n\nRetrieve the **latest** validation result for a document, by either the Staple `documentId` or the CFDI `uuid`. Returns the same shape as the *Validate Mexico E-Invoice* endpoint, reconstructed from the most recent stored validation record.\n\n## Endpoint\n\n`GET /v2/einvoice/mexico/status/{idOrUuid}`\n\n## Path Parameters\n\n| Name | In | Type | Required | Description |\n| --- | --- | --- | --- | --- |\n| `idOrUuid` | path | String | Required | Either the Staple\_`documentId`\_(e.g.\_`245234`) or the CFDI\_`uuid`\_(e.g.\_`699628be-2f06-4bc9-adc2-860b51eecbca`). The endpoint resolves either form |\n\n## Request Headers\n\n| Attribute | Type | Option | Description |\n| --- | --- | --- | --- |\n| `x-api-key` | String | Required | A unique string |\n| `Authorization` | String | Required | Bearer token |\n| `Accept` | String | Optional | `application/json` |\n\n## Response (Success)\n\n```\n{\n  \"documentId\": \"245234\",\n  \"uuid\": \"699628be-2f06-4bc9-adc2-860b51eecbca\",\n  \"validation_result\": \"VALID\",\n  \"validatedAt\": \"2026-07-09T08:29:06.785Z\",\n  \"invalid_reason\": null,\n  \"steps\": {\n    \"schema\":    { \"result\": \"PASS\", \"detail\": null },\n    \"satStatus\": { \"result\": \"PASS\", \"detail\": null },\n    \"rfc\":       { \"result\": \"PASS\", \"detail\": null }\n  }\n}\n\n```\n\n## Response (INVALID)\n\n```\n{\n  \"documentId\": \"245234\",\n  \"uuid\": \"699628be-2f06-4bc9-adc2-860b51eecbca\",\n  \"validation_result\": \"INVALID\",\n  \"validatedAt\": \"2026-07-09T08:29:06.785Z\",\n  \"invalid_reason\": \"Cancelled E-Invoice\",\n  \"steps\": {\n    \"schema\":    { \"result\": \"PASS\", \"detail\": null },\n    \"satStatus\": { \"result\": \"FAIL\", \"detail\": \"Cancelled E-Invoice\" }\n  }\n}\n\n```\n\n## Response Fields\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `documentId` | String | The document id the validation belongs to |\n| `uuid` | String | CFDI Folio Fiscal (UUID) |\n| `validation_result` | String | `VALID`\_or\_`INVALID` |\n| `validatedAt` | String | ISO timestamp of the validation run |\n| `invalid_reason` | String | null |\n| `steps` | Object | Per-step results —\_`schema`,\_`satStatus`,\_`rfc` |\n\n### `steps.\\*`\_Fields\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `result` | String | `PASS`\_or\_`FAIL` |\n| `detail` | String | null |\n\nOnly the steps that ran in that validation are present.\n\n## Notes\n\n-   Returns the\_**most recent**\_validation run — a document may be validated multiple times (the history is append-only).\n    \n-   Resolution: a value matching the UUID format is looked up by\_`uuid`; otherwise it is treated as a numeric\_`documentId`.\n    \n-   This is a read-only lookup — it does\_**not**\_trigger a new validation (use the\_*Validate*\_endpoint for that).\n    \n\n## Errors\n\n| Status | When |\n| --- | --- |\n| `400 Bad Request` | `idOrUuid`\_missing, or is neither a valid CFDI uuid nor a numeric documentId |\n| `401 / 403` | Missing/invalid\_`x-api-key`\_or\_`Authorization`, or no access to the document |\n| `404 Not Found` | No validation record exists for the given\_`documentId`/`uuid`\_(no validation has been run yet) |\n\n* * *\n\nThat's all four Mexico endpoints documented (import → creation status → validate → validation status). Want me to paste the **Get Document Creation Status** endpoint too (the polling one), or provide the Postman **example request/response pairs** for these so you can fill the right-panel Examples quickly?"
      tags:
        - eInvoice
      parameters:
        - name: docidOrUUID
          in: path
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/E-Invoice_retrieveValidationResults_Response_200
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    E-Invoice_retrieveValidationResults_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: E-Invoice_retrieveValidationResults_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "documentId": "987654",
  "invalid_reason": null,
  "steps": {
    "rfc": {
      "detail": null,
      "result": "PASS"
    },
    "satStatus": {
      "detail": null,
      "result": "PASS"
    },
    "schema": {
      "detail": null,
      "result": "PASS"
    }
  },
  "uuid": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
  "validatedAt": "2024-05-15T14:22:30.123Z",
  "validation_result": "VALID"
}
```

**SDK Code**

```python
import requests

url = "https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID';
const options = {
  method: 'GET',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/mexico/status/docidOrUUID")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```