---
title: "Correct expense settlement"
description: "Set whether an expense is paid or remains on supplier credit. Paid expenses cannot use payment form 99; credit expenses must use 99."
language: en
canonical_url: "https://exac.mx/docs/en/mcp/tools/correct_expense_settlement"
md_url: "https://exac.mx/docs/en/mcp/tools/correct_expense_settlement.md"
---

# Correct expense settlement

Set whether an expense is paid or remains on supplier credit. Paid expenses cannot use payment form 99; credit expenses must use 99.

Tool: `correct_expense_settlement`

## Purpose

Set the settlement mode and payment form for an expense.

### Use when

An expense changed from credit to paid or vice versa.

### Do not use when

You need to change the expense amount, supplier, or description.

| Detail | Value |
| --- | --- |
| Permissions | expenses:manage |
| Side effects | Writes data |
| Idempotency | Idempotent |

## Input schema

```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": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "documentRef": {
              "type": "string",
              "pattern": "^expense:.+$"
            },
            "settlementMode": {
              "type": "string",
              "const": "paid"
            },
            "paymentForm": {
              "type": "string",
              "enum": [
                "12",
                "13",
                "14",
                "15",
                "17",
                "23",
                "24",
                "25",
                "26",
                "27",
                "28",
                "29",
                "30",
                "31",
                "99",
                "02",
                "06",
                "01",
                "05",
                "04",
                "03",
                "08"
              ],
              "description": "Active SAT payment-form code.",
              "x-exac-sat-catalog": "payment-forms"
            }
          },
          "required": [
            "documentRef",
            "settlementMode",
            "paymentForm"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "documentRef": {
              "type": "string",
              "pattern": "^expense:.+$"
            },
            "settlementMode": {
              "type": "string",
              "const": "credit"
            },
            "paymentForm": {
              "type": "string",
              "const": "99"
            }
          },
          "required": [
            "documentRef",
            "settlementMode",
            "paymentForm"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "idempotencyKey",
    "input"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
```

## Output schema

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "documentRef": {
          "type": "string",
          "pattern": "^expense:.+$"
        },
        "settlementMode": {
          "type": "string",
          "enum": [
            "credit",
            "paid"
          ]
        }
      },
      "required": [
        "documentRef",
        "settlementMode"
      ],
      "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"
      ]
    }
  ]
}
```

## Related tools

- [`get_document`](/docs/en/mcp/tools/get_document.md) — **Get document**: Retrieve one document by its public documentRef. Sales receipt details include stable lineRef values and remaining refundable amounts for sales receipt refunds.

- [`record_payment`](/docs/en/mcp/tools/record_payment.md) — **Record payment**: Record money received from a customer or paid to a supplier and allocate it to open balances. Use the same idempotencyKey when retrying the exact payment.

- [`create_expense`](/docs/en/mcp/tools/create_expense.md) — **Create expense**: Create an operational expense. Credit expenses require supplierId, paymentForm 99, and settlement terms; pay supplier-linked credit expenses with record_payment.

## Related workflow

[See the canonical workflows in the introduction](/docs/en.md)

## Equivalent REST operations

- [`PUT /v1/expenses/{documentRef}/settlement`](/docs/en/api/documents/expenses/set-expense-settlement.md)

Complete documentation: https://exac.mx/docs/en.md
Agent documentation index: https://exac.mx/docs/en/llms.txt
