# Versions

> Each account uses an API version, named by date. A change that isn't compatible comes as a new version, and you decide when to move.

The API is versioned by date, like Stripe. Every answer says in the `Fiscalisto-Version` header which version it was written in:

```http
HTTP/1.1 200 OK
Fiscalisto-Version: 2026-10-24
```

Today there's a single version, `2026-10-24`.

## What a new version is

Whatever **doesn't** break anything arrives without a new version, in the one you already use: new routes, fields, events, optional parameters and error codes. Write your integration to ignore fields it doesn't know (the SDKs already do).

A new version is for what would change something that already works: a field that changes name or meaning, or stops existing. Each one is announced in the [changelog](https://fiscalisto.com/en/docs/api/cambios) and by email in [Avisos por correo](/avisos?tema=cambios), with what changed and how to adapt.

## Which version you get

1. **The request's**, if you send the `Fiscalisto-Version` header. The SDKs send the version they were made for, so an SDK always gets what it expects.
2. **Your account's**, if you don't (for example with `curl`). Your account stays on the latest version of the day you created it, and doesn't move by itself.

A version that doesn't exist answers `400` with `api_version_invalid` and the list of those that do.

```bash
curl https://api.fiscalisto.com/v1/account \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Fiscalisto-Version: 2026-10-24"
```

`GET /v1/account` says your account's (`api_version`) and the latest (`latest_api_version`).

## Moving to a new version

1. Read in the [changelog](https://fiscalisto.com/en/docs/api/cambios) what changed.
2. Try it in test mode sending `Fiscalisto-Version` with the new date (or update the SDK).
3. When everything works, move your account: what calls without the header and webhooks without their own version switch to the new one.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/account \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -d '{ "api_version": "2026-10-24" }' \
  -H "Content-Type: application/json"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const account = await fiscalisto.account.update({ api_version: "2026-10-24" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

account = fiscalisto.account.update({"api_version": "2026-10-24"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$account = $fiscalisto->account->update(['api_version' => '2026-10-24']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	account, err := client.Account.Update(ctx, &fiscalisto.UpdateAccountParams{APIVersion: "2026-10-24"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(account.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UpdateAccountParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var account = fiscalisto.account().update(new UpdateAccountParams().setApiVersion("2026-10-24"));
System.out.println(account.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var account = await fiscalisto.Account.UpdateAsync(new UpdateAccountParams { ApiVersion = "2026-10-24" });
```

It's changed with an account key with all permissions (not a read-only one, one restricted to issuers or one from a test environment), and it's logged in **Desarrolladores › Actividad**. You can go back to the previous one the same way.

## Webhooks

Every event carries `api_version`, the version its `data.object` was written in. An endpoint receives its events in your account's version, or in its own if it has one (`api_version` when creating or changing it with `POST /v1/webhook_endpoints/{id}`; `null` goes back to the account's).

To move webhooks without downtime: create a second endpoint with the new version, adapt your code to receive both, and delete the old one.

## In the SDKs

Each SDK carries the version it was made for and sends it on every request. To ask for another, or none (the account's):

```ts
const fiscalisto = new Fiscalisto("fk_test_…", { apiVersion: "2026-10-24" }); // null: la de la cuenta
```

```python
fiscalisto = Fiscalisto("fk_test_…", api_version="2026-10-24")  # None: la de la cuenta
```

```php
$fiscalisto = new Fiscalisto('fk_test_…', ['api_version' => '2026-10-24']); // null: la de la cuenta
```

```go
client, err := fiscalisto.NewClient("fk_test_…", fiscalisto.WithAPIVersion("2026-10-24")) // "": la de la cuenta
```

```java
var client = new FiscalistoClient(ClientOptions.builder().apiKey("fk_test_…").apiVersion("2026-10-24").build());
```

```csharp
var client = new FiscalistoClient("fk_test_…", new FiscalistoClientOptions { ApiVersion = "2026-10-24" });
```

An answer kept by [idempotency](https://fiscalisto.com/en/docs/api/idempotencia) is repeated exactly as it was first answered, in that version.
