Inicio rápido de Francia
Este inicio rápido te guía para crear tu primer registro fiscal firmado con fiskaly SIGN FR, cumpliendo las tres obligaciones fiscales francesas clave: firma, registro y archivado.
Requisitos previos
Sección titulada «Requisitos previos»- Una cuenta fiskaly (regístrate en hub.fiskaly.com)
- Una clave de API y un secreto para una organización GROUP en el entorno de PRUEBA
- Información del contribuyente: nombre de empresa, número SIREN, dirección
Tu secreto de API se muestra solo una vez. Guárdalo inmediatamente en un lugar seguro.
Autenticar
curl -X POST https://test.api.fiskaly.com/tokens \ -H "Content-Type: application/json" \ -H "X-Api-Version: 2026-02-03" \ -d '{ "content": { "type": "API_KEY", "key": "YOUR_API_KEY", "secret": "YOUR_API_SECRET" } }'const BASE = "https://test.api.fiskaly.com"; const API_VERSION = "2026-02-03"; const authResp = await fetch(`${BASE}/tokens`, { method: "POST", headers: { "Content-Type": "application/json", "X-Api-Version": API_VERSION, }, body: JSON.stringify({ content: { type: "API_KEY", key: "YOUR_API_KEY", secret: "YOUR_API_SECRET" }, }), }); const { access_token } = await authResp.json(); const headers = { "Authorization": `Bearer ${access_token}`, "Content-Type": "application/json", "X-Api-Version": API_VERSION, };import requests, uuid BASE = "https://test.api.fiskaly.com" API_VERSION = "2026-02-03" auth = requests.post(f"{BASE}/tokens", json={ "content": {"type": "API_KEY", "key": "YOUR_API_KEY", "secret": "YOUR_API_SECRET"} }, headers={"X-Api-Version": API_VERSION}) access_token = auth.json()["access_token"] hdrs = {"Authorization": f"Bearer {access_token}", "X-Api-Version": API_VERSION}// POST https://test.api.fiskaly.com/tokens // Headers: X-Api-Version: 2026-02-03 // Body: {"content":{"type":"API_KEY","key":"...","secret":"..."}}using var client = new HttpClient(); client.DefaultRequestHeaders.Add("X-Api-Version", "2026-02-03"); var authResp = await client.PostAsJsonAsync( "https://test.api.fiskaly.com/tokens", new { content = new { type = "API_KEY", key = "YOUR_API_KEY", secret = "YOUR_API_SECRET" } });📘NoteSIGN FR usa la misma plataforma API que SIGN IT. Todas las solicitudes requieren el encabezado
X-Api-Version. Las operaciones de escritura también necesitanX-Idempotency-Key.Crear Organización, Contribuyente, Ubicación y Sistema
La configuración sigue el mismo patrón que SIGN IT — crea una organización UNIT, luego un Contribuyente, Ubicación y Sistema, poniendo en servicio cada recurso:
# Crear Organización UNIT curl -X POST https://test.api.fiskaly.com/organizations \ -H "Authorization: Bearer ${ACCESS_TOKEN}" \ -H "Content-Type: application/json" \ -H "X-Api-Version: 2026-02-03" \ -H "X-Idempotency-Key: $(uuidgen)" \ -d '{"content": {"type": "UNIT", "name": "My French Company"}}' # Crear clave API de Sujeto para la UNIT, volver a autenticar, luego: # Crear Contribuyente curl -X POST https://test.api.fiskaly.com/taxpayers \ -H "Authorization: Bearer ${UNIT_TOKEN}" \ -H "Content-Type: application/json" \ -H "X-Api-Version: 2026-02-03" \ -H "X-Idempotency-Key: $(uuidgen)" \ -d '{ "content": { "type": "COMPANY", "name": {"legal": "Ma Societe SARL"}, "address": {"street": "1 Rue de Rivoli", "zip": "75001", "city": "Paris", "country_code": "FR"}, "fiscalization": { "type": "FR", "tax_id_number": "123456789" } } }' # Poner en servicio el Contribuyente, crear + poner en servicio Ubicación y Sistema # (mismo patrón que SIGN IT — consulta la guía de integración completa)// Crear Organización UNIT const org = await fetch(`${BASE}/organizations`, { method: "POST", headers: { ...headers, "X-Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify({ content: { type: "UNIT", name: "My French Company" } }), }).then(r => r.json()); // Después de crear la clave API de Sujeto y volver a autenticar: // Crear Contribuyente const taxpayer = await fetch(`${BASE}/taxpayers`, { method: "POST", headers: { ...headers, "X-Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify({ content: { type: "COMPANY", name: { legal: "Ma Societe SARL" }, address: { street: "1 Rue de Rivoli", zip: "75001", city: "Paris", country_code: "FR" }, fiscalization: { type: "FR", tax_id_number: "123456789" }, }, }), }).then(r => r.json()); // Poner en servicio Contribuyente → crear Ubicación → poner en servicio → crear Sistema → poner en servicio# Crear Contribuyente (después de configurar org + sujeto) taxpayer = requests.post(f"{BASE}/taxpayers", headers={ **hdrs, "X-Idempotency-Key": str(uuid.uuid4()) }, json={"content": { "type": "COMPANY", "name": {"legal": "Ma Societe SARL"}, "address": {"street": "1 Rue de Rivoli", "zip": "75001", "city": "Paris", "country_code": "FR"}, "fiscalization": {"type": "FR", "tax_id_number": "123456789"}, }}).json() # Poner en servicio, luego crear + poner en servicio Ubicación y Sistema...// Mismo patrón que SIGN IT: // POST /organizations → UNIT // POST /subjects → API_KEY (con ámbito) // POST /tokens → volver a autenticar // POST /taxpayers → FR fiscalization // PATCH /taxpayers/{id} → COMMISSIONED // POST /locations → BRANCH // POST /systems → FISCAL_DEVICE// Mismo patrón que SIGN IT — crear y poner en servicio: // Organización → Contribuyente → Ubicación → Sistema // Específico de Francia: fiscalization.type = "FR", tax_id_number = SIREN (9 dígitos)Crear tu primer Registro
# Parte A: Intención curl -X POST https://test.api.fiskaly.com/records \ -H "Authorization: Bearer ${UNIT_TOKEN}" \ -H "Content-Type: application/json" \ -H "X-Api-Version: 2026-02-03" \ -H "X-Idempotency-Key: $(uuidgen)" \ -d '{ "content": { "type": "INTENTION", "system": {"id": "YOUR_SYSTEM_ID"}, "operation": {"type": "TRANSACTION"} } }' # Parte B: Transacción curl -X POST https://test.api.fiskaly.com/records \ -H "Authorization: Bearer ${UNIT_TOKEN}" \ -H "Content-Type: application/json" \ -H "X-Api-Version: 2026-02-03" \ -H "X-Idempotency-Key: $(uuidgen)" \ -d '{ "content": { "type": "TRANSACTION", "intention": {"id": "INTENTION_ID"}, "operation": { "type": "RECEIPT", "document": { "number": "1", "date": "2026-02-27", "amounts": { "total_including_vat": "12.00", "total_excluding_vat": "10.00" } }, "entries": [{ "type": "SALE", "description": "Product A", "nature": "GOOD", "quantity": "1", "amounts": { "unit_including_vat": "12.00", "total_including_vat": "12.00", "total_excluding_vat": "10.00", "vat": {"rate": "20.00", "amount": "2.00"} } }] } } }'// Parte A: Intención const intention = await fetch(`${BASE}/records`, { method: "POST", headers: { ...headers, "X-Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify({ content: { type: "INTENTION", system: { id: systemId }, operation: { type: "TRANSACTION" }, }, }), }).then(r => r.json()); // Parte B: Transacción const record = await fetch(`${BASE}/records`, { method: "POST", headers: { ...headers, "X-Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify({ content: { type: "TRANSACTION", intention: { id: intention.id }, operation: { type: "RECEIPT", document: { number: "1", date: "2026-02-27", amounts: { total_including_vat: "12.00", total_excluding_vat: "10.00" }, }, entries: [{ type: "SALE", description: "Product A", nature: "GOOD", quantity: "1", amounts: { unit_including_vat: "12.00", total_including_vat: "12.00", total_excluding_vat: "10.00", vat: { rate: "20.00", amount: "2.00" }, }, }], }, }, }), }).then(r => r.json()); console.log("Registro creado y archivado:", record.state);# Parte A: Intención intention = requests.post(f"{BASE}/records", headers={ **hdrs, "X-Idempotency-Key": str(uuid.uuid4()) }, json={"content": { "type": "INTENTION", "system": {"id": system_id}, "operation": {"type": "TRANSACTION"}, }}).json() # Parte B: Transacción record = requests.post(f"{BASE}/records", headers={ **hdrs, "X-Idempotency-Key": str(uuid.uuid4()) }, json={"content": { "type": "TRANSACTION", "intention": {"id": intention["id"]}, "operation": { "type": "RECEIPT", "document": {"number": "1", "date": "2026-02-27", "amounts": {"total_including_vat": "12.00", "total_excluding_vat": "10.00"}}, "entries": [{"type": "SALE", "description": "Product A", "nature": "GOOD", "quantity": "1", "amounts": { "unit_including_vat": "12.00", "total_including_vat": "12.00", "total_excluding_vat": "10.00", "vat": {"rate": "20.00", "amount": "2.00"}}}], }, }}).json()// POST /records → INTENTION (system.id, operation.type = TRANSACTION) // POST /records → TRANSACTION (intention.id, datos del recibo con entradas) // Los datos se firman, registran y archivan para cumplir NF525// Creación de registro en dos pasos: INTENTION → TRANSACTION // Tipo de IVA francés: 20,00% (estándar) // La respuesta confirma firma, registro y archivadoUna vez creados, los datos se firman, registran y archivan automáticamente — cumpliendo las tres obligaciones fiscales clave de NF525.
Próximos pasos
Sección titulada «Próximos pasos»Was this page helpful?