---
title: "Guardar configuración"
description: "Crea o actualiza una sucursal, categoría de gastos o campo de recibo de la organización."
language: es-MX
canonical_url: "https://exac.mx/docs/mcp/tools/save_configuration"
md_url: "https://exac.mx/docs/mcp/tools/save_configuration.md"
---

# Guardar configuración

Crea o actualiza una sucursal, categoría de gastos o campo de recibo de la organización.

Herramienta: `save_configuration`

## Propósito

Crea o actualiza una sucursal, categoría de gastos o campo de recibo de la organización.

### Úsala cuando

Debe agregarse o cambiarse configuración de la organización.

### No la uses cuando

Necesitas eliminar configuración o editar un producto.

| Detalle | Valor |
| --- | --- |
| Permisos | Según input.kind: location → receiptLocations:manage; expense_category → expenses:manage; sales_receipt_field → receiptFields:manage |
| Efectos secundarios | Modifica datos |
| Idempotencia | Idempotente |

## Esquema de entrada

```json
{
  "type": "object",
  "properties": {
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Unique retry key for this exact operation. Reuse it only when retrying the same request."
    },
    "input": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create"
            },
            "kind": {
              "type": "string",
              "const": "location"
            },
            "name": {
              "$ref": "#/definitions/__schema0"
            },
            "folioPrefix": {
              "$ref": "#/definitions/__schema1"
            },
            "timeZone": {
              "$ref": "#/definitions/__schema3"
            }
          },
          "required": [
            "operation",
            "kind",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "update"
            },
            "kind": {
              "type": "string",
              "const": "location"
            },
            "entryId": {
              "type": "string"
            },
            "name": {
              "$ref": "#/definitions/__schema0"
            },
            "folioPrefix": {
              "$ref": "#/definitions/__schema1"
            },
            "timeZone": {
              "$ref": "#/definitions/__schema3"
            }
          },
          "required": [
            "operation",
            "kind",
            "entryId",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create"
            },
            "kind": {
              "type": "string",
              "const": "expense_category"
            },
            "name": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "operation",
            "kind",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "update"
            },
            "kind": {
              "type": "string",
              "const": "expense_category"
            },
            "entryId": {
              "type": "string"
            },
            "name": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "operation",
            "kind",
            "entryId",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "$ref": "#/definitions/__schema5"
            },
            "kind": {
              "$ref": "#/definitions/__schema6"
            },
            "name": {
              "$ref": "#/definitions/__schema7"
            },
            "fieldType": {
              "$ref": "#/definitions/__schema8"
            },
            "required": {
              "$ref": "#/definitions/__schema9"
            },
            "values": {
              "$ref": "#/definitions/__schema10"
            }
          },
          "required": [
            "operation",
            "kind",
            "name",
            "fieldType",
            "required"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "$ref": "#/definitions/__schema11"
            },
            "kind": {
              "$ref": "#/definitions/__schema12"
            },
            "entryId": {
              "$ref": "#/definitions/__schema13"
            },
            "name": {
              "$ref": "#/definitions/__schema7"
            },
            "fieldType": {
              "$ref": "#/definitions/__schema8"
            },
            "required": {
              "$ref": "#/definitions/__schema9"
            },
            "values": {
              "$ref": "#/definitions/__schema10"
            }
          },
          "required": [
            "operation",
            "kind",
            "entryId",
            "name",
            "fieldType",
            "required"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "idempotencyKey",
    "input"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "type": "string",
      "minLength": 1
    },
    "__schema1": {
      "description": "Location-only receipt folio prefix",
      "allOf": [
        {
          "$ref": "#/definitions/__schema2"
        }
      ]
    },
    "__schema2": {
      "type": "string"
    },
    "__schema3": {
      "description": "Location-only IANA time zone; null clears it",
      "allOf": [
        {
          "$ref": "#/definitions/__schema4"
        }
      ]
    },
    "__schema4": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema5": {
      "type": "string",
      "const": "create"
    },
    "__schema6": {
      "type": "string",
      "const": "sales_receipt_field"
    },
    "__schema7": {
      "type": "string",
      "minLength": 1
    },
    "__schema8": {
      "type": "string",
      "enum": [
        "select",
        "checkbox"
      ]
    },
    "__schema9": {
      "type": "boolean"
    },
    "__schema10": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "__schema11": {
      "type": "string",
      "const": "update"
    },
    "__schema12": {
      "type": "string",
      "const": "sales_receipt_field"
    },
    "__schema13": {
      "type": "string"
    }
  }
}
```

## Esquema de salida

```json
{
  "type": "object",
  "properties": {
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "locationId": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string"
            },
            "folioPrefix": {
              "type": "string"
            },
            "timeZone": {
              "type": "string"
            },
            "address": {
              "type": "object",
              "properties": {
                "formattedAddress": {
                  "type": "string"
                },
                "street": {
                  "type": "string"
                },
                "exterior": {
                  "type": "string"
                },
                "interior": {
                  "type": "string"
                },
                "neighborhood": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "municipality": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "zip": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                },
                "placeId": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "pin": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "longitude": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              },
              "required": [
                "latitude",
                "longitude"
              ],
              "additionalProperties": false
            },
            "radiusMeters": {
              "type": "number",
              "minimum": 0
            },
            "updatedAt": {
              "$ref": "#/definitions/__schema0"
            }
          },
          "required": [
            "locationId",
            "name",
            "updatedAt"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "categoryId": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string"
            },
            "updatedAt": {
              "$ref": "#/definitions/__schema0"
            }
          },
          "required": [
            "categoryId",
            "name",
            "updatedAt"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "fieldId": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "select",
                "checkbox"
              ]
            },
            "required": {
              "type": "boolean"
            },
            "order": {
              "type": "number"
            },
            "values": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "fieldId",
            "name",
            "type",
            "required",
            "order",
            "values"
          ],
          "additionalProperties": false
        }
      ]
    },
    "error": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "validation_error",
            "unauthenticated",
            "forbidden",
            "not_found",
            "method_not_allowed",
            "conflict",
            "idempotency_conflict",
            "operation_in_progress",
            "recovery_required",
            "rate_limited",
            "provider_unavailable",
            "internal"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "properties": {
            "issues": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  },
                  "message": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "message"
                ],
                "additionalProperties": false
              }
            },
            "retryable": {
              "type": "boolean"
            },
            "retryAfterSeconds": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "type": "string",
      "format": "date-time"
    }
  },
  "oneOf": [
    {
      "required": [
        "data"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
```

## Herramientas relacionadas

- [`get_configuration`](/docs/mcp/tools/get_configuration.md) — **Leer configuración**: Busca o recupera sucursales, categorías de gastos y campos de recibos de la organización.

## Flujo relacionado

[Consulta los flujos canónicos en la introducción](/docs.md)

## Operaciones REST equivalentes

- [`POST /v1/settings/locations`](/docs/api/catalog/locations/create-location.md)

- [`PATCH /v1/settings/locations/{locationId}`](/docs/api/catalog/locations/update-location.md)

- [`POST /v1/settings/expense-categories`](/docs/api/catalog/settings/create-expense-category.md)

- [`PATCH /v1/settings/expense-categories/{categoryId}`](/docs/api/catalog/settings/update-expense-category.md)

- [`POST /v1/settings/receipt-fields`](/docs/api/catalog/settings/create-sales-receipt-field.md)

- [`PATCH /v1/settings/receipt-fields/{fieldId}`](/docs/api/catalog/settings/update-sales-receipt-field.md)

Documentación completa: https://exac.mx/docs.md
Índice para agentes: https://exac.mx/docs/llms.txt
