---
updatedAt: 2026-04-30T22:53:04.000Z
agentTools:
  siteIndex: https://developers.pismo.io/llms.txt
  projectIndex: https://developers.pismo.io/pismo-docs/llms.txt
---

# Update accounting scripts V1

Update accounting scripts.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Core platform - Accounting",
    "version": "1.0.0",
    "description": "API used to manage the accounting context.",
    "contact": {
      "name": "API Support",
      "url": "https://developers.pismo.io/support/"
    },
    "license": {
      "name": "Copyright Pismo"
    }
  },
  "servers": [
    {
      "url": "https://sandbox.pismolabs.io/accounting",
      "description": "Sandbox API server for testing"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "AccountingScriptPatch": {
        "type": "object",
        "description": "Fields to update on an accounting script. At least one recognized field with a non-zero/non-empty value MUST be provided; otherwise the API returns 400 with `ErrNoChangesProvided` (PISMO-376794 silent-clone guard).\nUnknown JSON fields are silently ignored by the decoder, so a body composed exclusively of unknown fields is treated as \"no changes provided\".\n",
        "properties": {
          "debit_accounting_account_id": {
            "type": "integer",
            "format": "int64",
            "description": "Debit accounting account ID"
          },
          "credit_accounting_account_id": {
            "type": "integer",
            "format": "int64",
            "description": "Credit accounting account ID"
          },
          "debit_cost": {
            "type": "string",
            "description": "Debit cost center"
          },
          "credit_cost": {
            "type": "string",
            "description": "Credit cost center"
          },
          "entry_name": {
            "type": "string",
            "description": "New entry name (e.g., \"amount\", \"interest\", \"iof\"). Must match the allow-list from `POST /v1/accounting-scripts`."
          }
        }
      },
      "AccountingScriptPatchResponse": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "properties": {
            "has_error": {
              "description": "Indicates whether an error occurred during the update process.",
              "type": "boolean"
            },
            "error_message": {
              "description": "Provides a detailed description of the error encountered, if any.",
              "type": "string"
            },
            "new_id": {
              "type": "integer",
              "format": "int64",
              "description": "Unique identifier of the newly created accounting script. (The old one will be deactivated)"
            }
          }
        }
      },
      "BatchAccountingScriptPatch": {
        "type": "object",
        "properties": {
          "operations": {
            "type": "array",
            "items": {
              "properties": {
                "accounting_script_id": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Accounting script ID"
                },
                "set": {
                  "$ref": "#/components/schemas/AccountingScriptPatch"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Account access token. Tokens can expire quickly, which can result in an \"Unauthorized\" error.",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Accounting scripts V1",
      "description": "Endpoints to manage accounting scripts V1"
    }
  ],
  "paths": {
    "/v1/accounting-scripts/batch": {
      "patch": {
        "operationId": "BatchUpdateAccountingScript",
        "summary": "Update accounting scripts V1",
        "description": "Update accounting scripts.\n",
        "tags": [
          "Accounting scripts V1"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchAccountingScriptPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountingScriptPatchResponse"
                },
                "example": {
                  "393028": {
                    "has_error": false,
                    "new_id": 403948
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request — validation failure, any operation error other than not-found/deactivated,\nor no changes provided in any operation payload (PISMO-376794). When the body itself fails\nto deserialize because a field was sent with the wrong JSON type, the response is the\nshared `V1BindTypeMismatchError` shape (`error`, `cid`, `invalid_field`) instead of the\nper-item map below.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountingScriptPatchResponse"
                },
                "example": {
                  "393028": {
                    "has_error": true,
                    "error_message": "Debit account not found"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Every failing operation targets a missing or deactivated accounting script",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountingScriptPatchResponse"
                },
                "example": {
                  "393028": {
                    "has_error": true,
                    "error_message": "Accounting Script doesn't exist, impossible to update"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error (client receives generic \"something went wrong\")"
          }
        }
      }
    }
  }
}
```