---
title: "Update accounting script V1"
method: PATCH
path: "/v1/accounting-scripts/{accountingScriptId}"
tags: ["Accounting scripts V1"]
---

# Update accounting script V1

`PATCH /v1/accounting-scripts/{accountingScriptId}`

## Request

- Base URL: `https://sandbox.pismolabs.io/accounting`
- URL: `https://sandbox.pismolabs.io/accounting/v1/accounting-scripts/{accountingScriptId}`
- Auth: HTTP bearer

Update accounting script.

## Path parameters

- `accountingScriptId` integer, required

## Request body

- AccountingScriptPatch: 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). Unknown JSON fields are silently ignored by the decoder, so a body composed exclusively of unknown fields is treated as "no changes provided".
  - `debit_accounting_account_id` integer: Debit accounting account ID
  - `credit_accounting_account_id` integer: Credit accounting account ID
  - `debit_cost` string: Debit cost center
  - `credit_cost` string: Credit cost center
  - `entry_name` string: New entry name (e.g., "amount", "interest", "iof"). Must match the allow-list from `POST /v1/accounting-scripts`.

## Response `200`

OK

- AccountingScriptSinglePatchResponse
  - `new_id` integer: Unique identifier of the newly created accounting script. (The old one will be deactivated)

## Other responses

- `400`: Bad request — validation failure (invalid entry name, missing/deactivated debit or credit account, invalid company, or no changes provided in the payload — PISMO-376794). A JSON field type mismatch in the body returns the shared `V1BindTypeMismatchError` shape (`error`, `cid`, `invalid_field`).
- `404`: Accounting Script not found or already deactivated
- `500`: Internal server error (client receives generic "something went wrong")

---

[API](https://skmtc.dev/pismo/apis/core-platform-accounting.md) - [All operations](https://skmtc.dev/pismo/apis/core-platform-accounting/llms.txt) - [OpenAPI document](https://skmtc.dev/pismo/apis/core-platform-accounting/revisions/fdb645c3e65c?raw)
