Docs
Servidor MCPHerramientas disponibles

Ajustar saldo de cuenta

Corrige un saldo por cobrar o por pagar con un motivo auditable.

Herramienta MCPadjust_account_balance

Propósito

Corrige un saldo por cobrar o por pagar con un motivo auditable.

Usar cuando
Se requiere una corrección contable documentada.
No usar cuando
El cambio representa un pago, venta, gasto u operación normal.
Permisos requeridos
Según input.kind: receivable → receivables:manage; payable → payables:manage
Efectos secundarios
Destructivo
Idempotencia
Idempotente

Esquema de entrada

JSON Schema
{  "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": {            "kind": {              "type": "string",              "const": "receivable"            },            "balanceType": {              "type": "string",              "const": "operational"            },            "customerId": {              "type": "string"            },            "documentRef": {              "type": "string",              "pattern": "^sales_receipt:.+$"            },            "targetBalance": {              "type": "number",              "minimum": 0            },            "reason": {              "type": "string",              "minLength": 1,              "maxLength": 500            }          },          "required": [            "kind",            "balanceType",            "customerId",            "documentRef",            "targetBalance",            "reason"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "kind": {              "type": "string",              "const": "receivable"            },            "balanceType": {              "type": "string",              "const": "fiscalPpd"            },            "customerId": {              "type": "string"            },            "documentRef": {              "type": "string",              "pattern": "^cfdi:.+$"            },            "targetBalance": {              "type": "number",              "minimum": 0            },            "reason": {              "type": "string",              "minLength": 1,              "maxLength": 500            }          },          "required": [            "kind",            "balanceType",            "customerId",            "documentRef",            "targetBalance",            "reason"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "kind": {              "type": "string",              "const": "payable"            },            "balanceType": {              "type": "string",              "const": "operational"            },            "supplierId": {              "type": "string"            },            "documentRef": {              "type": "string",              "pattern": "^expense:.+$"            },            "targetBalance": {              "type": "number",              "minimum": 0            },            "reason": {              "type": "string",              "minLength": 1,              "maxLength": 500            }          },          "required": [            "kind",            "balanceType",            "supplierId",            "documentRef",            "targetBalance",            "reason"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "kind": {              "type": "string",              "const": "payable"            },            "balanceType": {              "type": "string",              "const": "fiscalPpd"            },            "supplierId": {              "type": "string"            },            "documentRef": {              "type": "string",              "pattern": "^cfdi:.+$"            },            "targetBalance": {              "type": "number",              "minimum": 0            },            "reason": {              "type": "string",              "minLength": 1,              "maxLength": 500            }          },          "required": [            "kind",            "balanceType",            "supplierId",            "documentRef",            "targetBalance",            "reason"          ],          "additionalProperties": false        }      ]    }  },  "required": [    "idempotencyKey",    "input"  ],  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false}

Esquema de salida

JSON Schema
{  "type": "object",  "properties": {    "data": {      "anyOf": [        {          "type": "object",          "properties": {            "previousBalance": {              "type": "number"            },            "previousDocumentBalance": {              "type": "number"            },            "adjustmentAmount": {              "type": "number"            },            "newBalance": {              "type": "number"            },            "newDocumentBalance": {              "type": "number"            }          },          "required": [            "previousBalance",            "previousDocumentBalance",            "adjustmentAmount",            "newBalance",            "newDocumentBalance"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "previousBalance": {              "type": "number"            },            "previousDocumentBalance": {              "type": "number"            },            "adjustmentAmount": {              "type": "number"            },            "newBalance": {              "type": "number"            },            "newDocumentBalance": {              "type": "number"            }          },          "required": [            "previousBalance",            "previousDocumentBalance",            "adjustmentAmount",            "newBalance",            "newDocumentBalance"          ],          "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,  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Flujo relacionado

Consulta los flujos canónicos en la introducción

Herramientas relacionadas