# Test environments

A separate test mode for each person on the team, with its own issuer, keys, webhooks and events.

## Endpoints

- [Create a test environment](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/create-sandbox.md): `POST /v1/sandboxes`
- [List test environments](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/list-sandboxes.md): `GET /v1/sandboxes`
- [Get a test environment](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/get-sandbox.md): `GET /v1/sandboxes/{id}`
- [Delete a test environment](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/delete-sandbox.md): `DELETE /v1/sandboxes/{id}`
- [Create a test clock](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/create-test-clock.md): `POST /v1/issuers/{id}/test_clock`
- [Get the test clock](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/get-test-clock.md): `GET /v1/issuers/{id}/test_clock`
- [Delete the test clock](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/delete-test-clock.md): `DELETE /v1/issuers/{id}/test_clock`
- [Advance the test clock](https://fiscalisto.com/en/docs/api/referencia/entornos-de-prueba/advance-test-clock.md): `POST /v1/issuers/{id}/test_clock/advance`

## The Sandbox object

A sandbox: a person's own test mode, with its own issuer, keys, webhooks and events.

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `object` | `"sandbox"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | `false` | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `name` | string | yes | Name. |
| `issuers` | integer | yes | Active issuers in the sandbox. (from -9007199254740991 to 9007199254740991) |
| `issuer` | object or null |  | The SAT test issuer it starts with (only when created). |
| `issuer.id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `issuer.livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer.object` | `"issuer"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer.source` | `api`, `empresa` | yes | api if you created it with the API or in Desarrolladores; empresa if it is an app empresa connected to your account (Desarrolladores › Emisores › Conectar una empresa): with it only its Portal de proveedores and, if they were turned on, its supplier payouts are used, and status is always active. |
| `issuer.type` | `own`, `connected`, `portal` | yes | own: an RFC of this API's empresa (the empresa adds it in the app; it isn't archived through the API). connected: a connected issuer, which your platform added with POST /v1/issuers. portal: another Fiscalisto empresa connected through your Portal de proveedores. |
| `issuer.tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `issuer.legal_name` | string or null | yes | Name or razón social exactly as on the constancia de situación fiscal, without the capital regime (without «S.A. de C.V.»). |
| `issuer.tax_system` | string or null | yes | Tax regime (RegimenFiscal), a c_RegimenFiscal key: 601, 612, 626… |
| `issuer.zip` | string or null | yes | Postal code of the tax address, 5 digits, as on the constancia de situación fiscal. An issuer's is the place of issue (LugarExpedicion) of its CFDIs. |
| `issuer.status` | `active`, `needs_certificate`, `certificate_expired`, `needs_efirma`, `archived` | yes | active: it can stamp. needs_certificate: its CSD is missing. needs_efirma: it still has to sign the contract with the PAC once with its e.firma (production only). certificate_expired: its CSD expired. archived: archived. |
| `issuer.requirement` | string or null | yes | What the issuer is missing to stamp, and how to provide it. |
| `issuer.certificate` | object or null | yes | The uploaded digital seal (CSD): serial number and expiry. |
| `issuer.certificate.serial_number` | string or null | yes | Serial number (NoCertificado). |
| `issuer.certificate.expires_at` | string (date-time) or null | yes | When it expires. |
| `issuer.sat_downloads` | object | yes | Whether it can ask the SAT for its invoices (POST /v1/sat_downloads): available is true in test mode, and in production while its saved e.firma is valid (efirma_expires_at); an RFC of your empresa (type own) uses the one the empresa saved in the app. In test mode, efirma_expires_at shows the one for the same RFC in production, or the one you send in test mode. |
| `issuer.sat_downloads.available` | boolean | yes | true if it can request downloads from the SAT now: always in test mode; in production with its e.firma saved and valid (the app's, for an RFC of your empresa). |
| `issuer.sat_downloads.efirma_expires_at` | string (date-time) or null | yes | When the e.firma saved for downloads expires, or null if there isn't one. In test mode, the one you sent in test mode or, otherwise, the one saved in production for the same RFC. |
| `issuer.employer_registration` | string or null | yes | Employer registration with IMSS (RegistroPatronal), 11 characters. Required to stamp payroll. |
| `issuer.curp` | string or null | yes | CURP, 18 characters. |
| `issuer.donation_authorization` | object or null | yes | Authorized donee (regime 603): SAT's letter that authorizes it to receive deductible donations (or its renewal). It goes on each donation receipt (`donation` in POST /v1/invoices); null removes it. The issuer must have tax_system 603. In test mode any number and a past date work. |
| `issuer.donation_authorization.number` | string | yes | Number of the authorization letter, up to 100 characters. |
| `issuer.donation_authorization.date` | string or null | yes | Date of the letter, YYYY-MM-DD; it can't be in the future. |
| `issuer.stamps_as` | string | yes | RFC it stamps with: the issuer's in production and, in test mode, the SAT test taxpayer of its type: EKU9003173C9 for a persona moral, CACX7605101P8 for a persona física (with its CURP on payroll). It stamps with the issuer's tax regime and postal code. |
| `issuer.sandbox` | string or null | yes | The sandbox (sbx_…) it belongs to, or null if it belongs to the account. See /v1/sandboxes. |
| `issuer.test_clock` | object or null | yes | Its test clock (test issuers only): the time that is «today» for it, or null if it follows real time. See POST /v1/issuers/{id}/test_clock. |
| `issuer.test_clock.frozen_time` | string (date-time) | yes | The clock's time. |
| `issuer.created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `issuer.archived_at` | string (date-time) or null | yes | When it was archived (it no longer stamps), or null. |
| `issuer.metadata` | object | yes | Your own data: up to 50 keys of 40 characters with text values of up to 500. They don't go into the CFDI; they come back in the object and in webhooks. |
| `key` | object |  | Only when created. |
| `key.id` | string | yes | Key id. |
| `key.secret` | string | yes | The sandbox's fk_test_… key. It is shown only this once: save it. |
| `created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `deleted` | boolean |  | Always true. |

Example:

```json
{
  "id": "sbx_4kQm8ZtR2wLp9XbN",
  "object": "sandbox",
  "livemode": false,
  "name": "Ana",
  "issuers": 1,
  "created_at": "2026-10-25T09:40:00-06:00"
}
```

## The TestClock object

A test issuer's test clock: its «today», which only moves when you move it forward, doing day by day what is due.

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | clk_ and the issuer's id. |
| `object` | `"test_clock"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | `false` | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The test issuer living at this time. |
| `frozen_time` | string (date-time) | yes | The clock's time: the issuer's «today» for its recurring invoices, quotes, receivables and tickets. |
| `status` | `ready`, `advancing` | yes | advancing while a request moves it forward; ready at any other time. |
| `created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `advanced` | object |  | When moved forward: what was done along the way. |
| `advanced.recurring_invoices` | integer | yes | Recurring invoices stamped along the way. (from -9007199254740991 to 9007199254740991) |
| `advanced.quotes_expired` | integer | yes | Quotes that expired along the way. (from -9007199254740991 to 9007199254740991) |
| `advanced.global_invoices` | integer | yes | Global invoices for tickets stamped along the way. (from -9007199254740991 to 9007199254740991) |
| `stopped_early` | boolean |  | true if it stopped before requested_time because it already stamped 25 receipts in this request: move it forward again to continue. |
| `requested_time` | string (date-time) |  | Where it was asked to move to (with stopped_early). |
| `deleted` | boolean |  | Always true. |

Example:

```json
{
  "id": "clk_0q1Vmmw52sbD",
  "object": "test_clock",
  "livemode": false,
  "issuer": "iss_0q1Vmmw52sbD",
  "frozen_time": "2027-01-04T09:00:00-06:00",
  "status": "ready",
  "created_at": "2026-10-25T09:40:00-06:00"
}
```
