> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timbrix.mx/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Default Series

Sets which series Timbrix uses for a CFDI type when you create an invoice or a payment without sending `series`. Each type has exactly one default series.

## Authentication

This endpoint requires authentication with a **user session** (Bearer token). API keys are not accepted on series routes.

* **Authorization**: `Bearer <token>`

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `organizationId` | string (UUID) | Yes | Organization ID |

## Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `type` | string | Yes | CFDI type: `I` (Ingreso), `E` (Egreso), `T` (Traslado) or `P` (Pago) |
| `series` | string | Yes | Name of an existing series of the organization |

## Permissions

Only **OWNERS** and **ADMINS** can change defaults. Writes on a closed organization return `403 ORGANIZATION_CLOSED`.

## Example Request

```bash theme={null}
curl -X PUT https://api.timbrix.mx/organizations/550e8400-e29b-41d4-a716-446655440000/default-series \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "I",
    "series": "FAC"
  }'
```

```typescript theme={null}
import { Timbrix } from "@timbrix/sdk"

const client = new Timbrix({ bearerToken: "<your_token>" })

const series = await client.series.setDefault(
  "550e8400-e29b-41d4-a716-446655440000",
  { type: "I", series: "FAC" }
)
console.log(series)
```

## Example Response

Returns the updated list of series of the organization.

```json theme={null}
[
  {
    "series": "A",
    "nextFolio": 16,
    "nextFolioTest": 4,
    "defaultFor": ["T"]
  },
  {
    "series": "FAC",
    "nextFolio": 1501,
    "nextFolioTest": 1,
    "defaultFor": ["I"]
  }
]
```

## Common Errors

### 400 Bad Request

`type` is not one of `I`, `E`, `T` or `P`.

### 401 Unauthorized

Authentication required.

### 403 Forbidden

Only owners and admins can change defaults, or the organization is closed (`ORGANIZATION_CLOSED`).

### 404 Not Found — `SERIES_NOT_FOUND`

The organization has no series with that name.

```json theme={null}
{
  "statusCode": 404,
  "message": "La serie FAC no existe. Créala en Configuración → Series y folios o manda el folio.",
  "error": "SERIES_NOT_FOUND"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.