> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.uuid.mx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.uuid.mx/_mcp/server.

# Timbrar un CFDI

POST https://api.uuid.mx/v1/timbrar
Content-Type: application/json

Timbra un CFDI 4.0. El emisor se selecciona por Emisor.Rfc. Consume un timbre del saldo (producción).

Reference: https://docs.uuid.mx/api-reference/timbrado/timbrar-un-cfdi

## Authentication

- `Authorization` header (bearer token, required) — API key (`uuid_live_*` / `uuid_sandbox_*`) o token de Firebase.

## Request

### Body (application/json)

This endpoint expects a ComprobanteCFDI.

- `Emisor` (ComprobanteCfdiEmisor, required)
- `Serie` (string, optional)
- `Folio` (string, optional)
- `Fecha` (string, optional) — YYYY-MM-DDTHH:MM:SS
- `FormaPago` (string, optional) — Catálogo c_FormaPago (ej. 01, 03, 99)
- `MetodoPago` (string, optional) — PUE | PPD
- `Moneda` (string, optional) — ISO 4217 (ej. MXN, USD)
- `TipoCambio` (string, optional)
- `SubTotal` (string, optional)
- `Total` (string, optional)
- `TipoDeComprobante` (string, optional) — I | E | T | N | P
- `Exportacion` (string, optional) — CFDI 4.0: 01 | 02 | 03
- `LugarExpedicion` (string, optional) — Código postal de expedición
- `Receptor` (ComprobanteCfdiReceptor, optional)
- `Conceptos` (list of ComprobanteCfdiConceptosItems, optional) — Partidas del comprobante
- `Impuestos` (map from string to any, optional)

## Response

### 200

Respuesta del PAC al timbrar (passthrough). En éxito, `data` trae el CFDI timbrado.

- `status` (string, optional) — success | error
- `message` (string, optional, nullable)
- `data` (TimbradoResultData, optional)

## Errors

### 400 Bad Request Error

Default Response

- `error` (string, optional) — Código de error legible por máquina (ej. FACTURA_NOT_FOUND)
- `message` (string, optional) — Detalle accionable del error
- `requestId` (string, optional) — ID de la petición para rastrear en logs

### 401 Unauthorized Error

Default Response

- `error` (string, optional) — Código de error legible por máquina (ej. FACTURA_NOT_FOUND)
- `message` (string, optional) — Detalle accionable del error
- `requestId` (string, optional) — ID de la petición para rastrear en logs

### 402 Payment Required Error

Default Response

- `error` (string, optional) — Código de error legible por máquina (ej. FACTURA_NOT_FOUND)
- `message` (string, optional) — Detalle accionable del error
- `requestId` (string, optional) — ID de la petición para rastrear en logs

### 403 Forbidden Error

Default Response

- `error` (string, optional) — Código de error legible por máquina (ej. FACTURA_NOT_FOUND)
- `message` (string, optional) — Detalle accionable del error
- `requestId` (string, optional) — ID de la petición para rastrear en logs

## Types

### ComprobanteCfdiEmisor

- `Rfc` (string, required) — RFC emisor registrado en tu cuenta
- `Nombre` (string, optional)
- `RegimenFiscal` (string, optional) — Catálogo c_RegimenFiscal (ej. 601, 603)

### ComprobanteCfdiReceptor

- `Rfc` (string, optional)
- `Nombre` (string, optional)
- `DomicilioFiscalReceptor` (string, optional) — CP del receptor
- `RegimenFiscalReceptor` (string, optional)
- `UsoCFDI` (string, optional) — Catálogo c_UsoCFDI (ej. G03)

### ComprobanteCfdiConceptosItems

- `ClaveProdServ` (string, optional)
- `Cantidad` (string, optional)
- `ClaveUnidad` (string, optional)
- `Descripcion` (string, optional)
- `ValorUnitario` (string, optional)
- `Importe` (string, optional)
- `ObjetoImp` (string, optional) — CFDI 4.0: 01 | 02 | 03
- `Impuestos` (map from string to any, optional)

### TimbradoResultData

- `uuid` (string, optional)
- `cfdi` (string, optional) — XML timbrado completo
- `qrCode` (string, optional) — PNG en base64
- `fechaTimbrado` (string, optional)
- `selloCFDI` (string, optional)
- `selloSAT` (string, optional)
- `noCertificadoCFDI` (string, optional)
- `noCertificadoSAT` (string, optional)
- `cadenaOriginalSAT` (string, optional)

## Examples

**Request**

```json
{
  "Emisor": {
    "Rfc": "string"
  }
}
```

**Response**

```json
{
  "status": "string",
  "message": "string",
  "data": {
    "uuid": "string",
    "cfdi": "string",
    "qrCode": "string",
    "fechaTimbrado": "string",
    "selloCFDI": "string",
    "selloSAT": "string",
    "noCertificadoCFDI": "string",
    "noCertificadoSAT": "string",
    "cadenaOriginalSAT": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.uuid.mx/v1/timbrar"

payload = { "Emisor": { "Rfc": "string" } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.uuid.mx/v1/timbrar';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"Emisor":{"Rfc":"string"}}'
};

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.uuid.mx/v1/timbrar"

	payload := strings.NewReader("{\n  \"Emisor\": {\n    \"Rfc\": \"string\"\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.uuid.mx/v1/timbrar")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Emisor\": {\n    \"Rfc\": \"string\"\n  }\n}"

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.post("https://api.uuid.mx/v1/timbrar")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Emisor\": {\n    \"Rfc\": \"string\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.uuid.mx/v1/timbrar', [
  'body' => '{
  "Emisor": {
    "Rfc": "string"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.uuid.mx/v1/timbrar");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Emisor\": {\n    \"Rfc\": \"string\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["Emisor": ["Rfc": "string"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.uuid.mx/v1/timbrar")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```