Skip to content

FISCALISTO / API

Test and live

Test for free with fk_test_ keys and go live with your issuer, your timbres and an fk_live_ key.

Open in ChatGPTOpen in ClaudeOpen in Cursor

Your company's API has two modes that never mix: each one has its own keys, issuers, customers, invoices, webhooks and events. The key you call with decides the mode; every object says which in livemode.

TestLive
Keyfk_test_…fk_live_…
Validity before SATNone: they aren't real CFDIReal CFDI
CostFreeOne timbre per document, and per SAT lookup and download (what it costs)
IssuerAny RFC; stamped as SAT's test issuerYour RFC, with your CSD and your e.firma
Request limit100 every 10 seconds100 every 10 seconds

Test mode

When you open Desarrolladores in your company you already have a test issuer and an fk_test_ key: you can stamp right away. Test mode applies the same SAT checks as live (catalogs, régimen against use, totals, complementos) and the PAC stamps in its test environment, so an invoice that works in test works in live.

You can create test issuers with any RFC to mirror your real setup, but no files are uploaded: the test environment only accepts SAT's test certificates, so a legal-entity test issuer (12-character RFC) is stamped as EKU9003173C9 and an individual one (13 characters) as CACX7605101P8, XOCHILT CASAS CHAVEZ (the issuer's stamps_as field says which). Everything else is stamped as you set it up: the issuer's régimen (tax_system), such as 626 RESICO, 603 donataria (for your donation receipts), 612 business activity or 621 incorporación fiscal, and its postal code (zip) as place of issue, so the 8% border-region IVA can be tested too. Payroll from an individual employer carries the test CURP CACX760510MGTSHC04. In a traslado, whose receiver is the issuer itself, the receiver carries the fiscal address the test environment has for that taxpayer (20928 for EKU9003173C9, 58000 for CACX7605101P8), whatever the issuer's zip.

Customers and employees, on the other hand, must be on the PAC's list of test RFCs: with an RFC that isn't there, stamping answers 422 invoice_rejected with CFDI40143, and with one that is but with another name or postal code, with CFDI40145 or CFDI40147. Use these, which are the ones in the documentation's examples and among the customers that POST /v1/test_data/reset leaves:

RFCNameRégimenPostal codeFor
ICV060329BY0INMOBILIARIA CVA60133826Legal-entity customers
MASO451221PM4MARIA OLIVIA MARTINEZ SAGAZ612 (605 as an employee)80290Individual customers and payroll employees (CURP MASO451221MSLRGL08)

Test mode is free, with two caveats: an account stamps up to 1,000 test documents a day (see Limits), and emails of test invoices only reach people in your company, so you can try send_email on your own inbox without writing to your customers.

Trigger each SAT rejection

To test how your system responds when SAT rejects an invoice, use one of these RFCs as the customer with your test key. The API answers 422 with invoice_rejected, the sat_code and the message for your user, exactly as in live, and invoice.failed reaches your webhooks. The rest of the data can be anything.

Customer RFCsat_codeWhat it simulates
NOM010101FK9CFDI40145The customer's name doesn't match its RFC.
CPO010101FK1CFDI40147The customer's postal code isn't its tax address's.
REG010101FK9CFDI40157The customer's régimen isn't the one SAT has.
NOI010101FK5CFDI40143The customer's RFC isn't registered with SAT.
USO010101FK4CFDI40161The CFDI use doesn't fit the customer's régimen.
curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: prueba-rechazo-1" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": { "tax_id": "NOM010101FK9", "legal_name": "CLIENTE DE PRUEBA", "tax_system": "601", "zip": "33826" },
    "payment_form": "03",
    "items": [{ "description": "Consultoría", "product_key": "80101500", "unit_price": 1000 }]
  }'

They only work in test: in live those RFCs don't exist and SAT rejects them for that.

Try it from the documentation

Every page of the reference has Probar (Try it): change the fields and press Enviar (Send). If you're signed in to Fiscalisto (with the company open and permission to create keys) you need no key: the request runs as that company's API, in test, and shows in Solicitudes as «Documentación». If not, put your fk_test_… key in Authorization. The request reaches the real API (it stamps in test and sends events to your test webhooks) and you see the whole answer with its headers. The key stays in your browser only. fk_live_ keys aren't accepted there: live calls come from your server.

Start from scratch

So your automated tests always start the same way, reset test mode: each test issuer keeps its RFC and test CSD, and its invoices, customers, products, batches, links and downloads are deleted, along with test events and requests. Keys and webhooks stay. Since it deletes the whole account's test data, a key restricted to some issuers answers 403 key_restricted. With seed (the default) each issuer is left with 2 customers (the ones in the table above) and 3 sample products.

curl https://api.fiscalisto.com/v1/test_data/reset \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "seed": true }'

Only with an fk_test_ key (with fk_live_ it answers test_mode_only) and up to 20 times a day. It's also in Desarrolladores › Inicio, under Datos de prueba.

A test environment for each person

If several people or projects share the account, give each one its own test environment (sandbox): it starts with its own SAT test issuer and an fk_test_ key that only sees that environment's issuers, invoices, webhooks and events. So one person's reset deletes nothing of another's, and their webhook doesn't receive the others' events. The account's test keys don't see what's in an environment either.

curl https://api.fiscalisto.com/v1/sandboxes \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Ana" }'

The answer carries key.secret once: it's the environment's key. With it, POST /v1/test_data/reset empties only that environment, and it has its own 20 resets a day. Environments are created, listed and deleted with an account test key (an environment's key answers key_in_sandbox), up to 25 per account. When you delete one, its keys stop working at once. They're also in Desarrolladores › Llaves, under Entornos de prueba.

Move time forward with a test clock

A monthly recurring invoice, a quote that expires or the month's global ticket invoice take weeks to happen. With a test clock you see them in seconds: the test issuer lives in the clock's time, which only moves when you move it.

First the clock, frozen now (or at frozen_time):

curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/test_clock \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Create your recurring invoices, quotes or tickets as usual, and move it forward, for example three months:

curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/test_clock/advance \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "frozen_time": "2027-01-25T09:00:00-06:00" }'

Moving it forward does, day by day, what would have happened: each period of the recurring invoices is stamped (with that period's {mes} and {año}), quotes expire and global ticket invoices go out, each with its webhooks. The answer arrives when it's done, with what it did in advanced, and the test_clock.ready event arrives too.

  • While it has a clock, the daily processes leave the issuer alone: nothing happens by itself.
  • The clock goes up to two years ahead. Each call stamps up to 25 documents; if more are due, it stops at the end of that day with stopped_early: true, and another call continues from there.
  • CFDI are stamped with the real date and time, because SAT only accepts today's. The period, due dates, amount_due and events do follow the clock.
  • Links your customers open (quotes, self-invoicing) use the real time.
  • DELETE /v1/issuers/iss_…/test_clock puts the issuer back on real time.

Only test issuers have a clock, one each, and it can be moved forward up to 50 times a day.

Don't mix the modes

An id from one mode doesn't exist in the other. If you use an fk_live_ key with a test inv_…, the API answers livemode_mismatch.

Going live

  1. Add your issuer with POST /v1/issuers using a live key, or in the dashboard under Emisores. The data goes exactly as on the constancia de situación fiscal (tax status certificate).
  2. Upload your CSD (sello digital certificate: .cer, .key and password) with POST /v1/issuers/{id}/certificates.
  3. Sign the PAC contract with the RFC's e.firma: POST /v1/issuers/{id}/efirma. Once per RFC.
  4. Have timbres. Your company's own RFCs and connected issuers also use its 10 welcome timbres, the same ones as the app; for more, buy packs in Desarrolladores › Timbres y pagos or in Ajustes › Plan y pagos (it's the same balance). Check yours with GET /v1/balance.
  5. Switch your server's key to an fk_live_ one (created in Desarrolladores › Llaves, which asks for two-step verification).

The issuer is ready when its status is active. Until then, requirement says what's missing. See Issuers.

What a timbre costs

The API comes with every company, the Gratis plan included, and has no monthly or yearly fee. It's one timbre balance with the app: packs are bought in Desarrolladores › Timbres y pagos or in Ajustes › Plan y pagos, last 12 months and work in both. What you stamp with your company's own RFCs (type: "own") uses your plan's timbres for the month first, which don't carry over, then your packs (the one expiring first goes first), then your company's 10 welcome timbres (the same ones as the app, once per company). Connected issuers (type: "connected", other companies) never use your plan's timbres for the month: they use your packs, then the welcome ones; SAT lookups use your packs, then the month's and the welcome ones. If they run out, the API answers 402 insufficient_balance. To stamp for other companies, buy packs, not a plan. The packs for volume (prices in Mexican pesos):

PackPricePer timbre
500 timbres$290 + IVA ($336.40 con IVA)$0.58 + IVA ($0.67 con IVA)
2,000 timbres$990 + IVA ($1,148.40 con IVA)$0.50 + IVA ($0.58 con IVA)
10,000 timbres$4,790 + IVA ($5,556.40 con IVA)$0.48 + IVA ($0.56 con IVA)
50,000 timbres$22,900 + IVA ($26,564 con IVA)$0.46 + IVA ($0.53 con IVA)
100,000 timbres$41,900 + IVA ($48,604 con IVA)$0.42 + IVA ($0.49 con IVA)

There are also packs of 20 timbres ($49 + IVA, $56.84 con IVA) and 100 ($149 + IVA, $172.84 con IVA). They're paid by card, OXXO or bank transfer; the 50,000 and 100,000 packs, by transfer (SPEI) only. Every purchase comes with its invoice. More than 50,000 a year? Write to hola@fiscalisto.com for a quote.

In live they use timbres, and each timbre costs what its pack does: from $0.42 + IVA ($0.49 con IVA) in the 100,000 pack to $0.58 + IVA ($0.67 con IVA) in the 500 pack.

WhatTimbresCost
Each stamped document: invoice, payment complement, credit note, advance, payroll receipt or withholding certificate1$0.42 to $0.58 + IVA ($0.49 to $0.67 con IVA) each
RFCs checked on SAT's lists1 per 10 a month$0.42 to $0.58 + IVA ($0.49 to $0.67 con IVA) per 10 RFCs
Customer data compared with their tax status certificate (cif_id in POST /v1/tax_ids/validate)1 per 10 certificates a month$0.42 to $0.58 + IVA ($0.49 to $0.67 con IVA) per 10 certificates
SAT downloads1 per 100 CFDI they bring, at least 1$0.42 to $0.58 + IVA ($0.49 to $0.67 con IVA) per 100 CFDI
The issuer's compliance opinion, tax status certificate and buzón tributario asked of SAT1 per lookup$0.42 to $0.58 + IVA ($0.49 to $0.67 con IVA) per lookup
The issuer's tax returns asked of SAT1 per lookup$0.42 to $0.58 + IVA ($0.49 to $0.67 con IVA) per lookup

How SAT lookups are counted is in Limits. For example, downloading 1,250 received invoices uses 13 timbres: with the 10,000 pack, about $6.23 + IVA ($7.23 con IVA).

These don't use timbres: anything in test, cancelling a document (neither the first request nor repeats; when replacing, only the new invoice uses its timbre), requests that fail the checks, ones SAT or the PAC reject, repeats with the same Idempotency-Key, validating a customer's data without cif_id (RFC, name, régimen, postal code and SAT's lists), verifying a document at SAT (POST /v1/cfdi_verifications), the same certificate compared again within 24 hours, seeing what was already brought from SAT (downloaded invoices, opinion, certificate, buzón and returns, with their PDFs), reading and listing, downloading PDF and XML, emailing invoices, webhooks, SAT catalogs, and saving customers, products, self-invoicing tickets or quotes.

When none are left, the API answers 402 with insufficient_balance and doesn't stamp. Buy a pack and repeat the request with the same Idempotency-Key.

So they never run out: with few timbres left, the balance.low event reaches your webhooks along with an email (you pick the amount in Desarrolladores › Timbres y pagos, 100 if you don't change it), and again when they run out. There you can also turn on Recarga automática (auto-recharge): we buy the pack you choose with your card when the number you say is left, up to the times a month you say. GET /v1/balance carries both in low_balance_at and auto_recharge (null with auto-recharge off), the timbres left this month in your empresa's plan in plan_timbres (your empresa's RFCs use them before available; null on Gratis), the same with test keys as with live ones, and where each pack comes from in packs[].type (welcome, the free ones, which don't expire: your empresa's 10 and, if you opened the API before November 15, 2026, the API's 20; purchase, bought or from auto-recharge; referral, from a referral). unlimited and use_plan_timbres are deprecated (always false and true): they still arrive for compatibility, but don't use them. Buying timbres can't be done with an API key, on purpose: a leaked key can't charge your card.

Was this page helpful?