---
title: "Create accounting script V2"
method: POST
path: "/v2/accounting-scripts"
tags: ["Accounting scripts V2"]
---

# Create accounting script V2

`POST /v2/accounting-scripts`

Create an accounting script. 

Refer to the [How to create accounting script](https://developers.pismo.io/pismo-docs/docs/create-an-accounting-script) guide for more information.

## Request body

- AccountingScriptPostV2
  - `credit_accounting` AccountingAccountAccountSctiptPost, required
    - `description` string, required — Description that helps to identify the accounting account. Can be `0` or any value if there's no corresponding account.
    - `account` string, required — Accounting account number. Can be `0` or any value if there's no corresponding account.
  - `debit_accounting` AccountingAccountAccountSctiptPost, required
    - `description` string, required — Description that helps to identify the accounting account. Can be `0` or any value if there's no corresponding account.
    - `account` string, required — Accounting account number. Can be `0` or any value if there's no corresponding account.
  - `entry_type_id` EntryTypePost, required
    - `id` integer, required — Entry type ID
    - `description` string, required — Entry type description.
    - `type` 'DUE_DATE' | 'CREATION', required — Set the entry type: * `CREATION`: Default value for new entries. Also, this value is assumed when type is not provided. * `DUE_DATE`: Used only with a credit program to indicate a due date entry.
    - `reason` string, required — Reason for the operation.
    - `responsible` string — User name or ID of the person performing the operation.
  - `expression` string, required — Expression to calculate the value of the accounting entry. It can be a simple mathematical expression or a more complex one using functions.
  - `cash_in_bucket` AccountingScriptBucket
    - `name` string — Bucket name
    - `account` integer — Account ID
  - `cash_out_bucket` AccountingScriptBucket
    - `name` string — Bucket name
    - `account` integer — Account ID
  - `cost_center` CostCenterAccountingScriptPost
    - `debit_org` string, required — Number of your Org’s debit accounting account
    - `credit_org` string, required — Number of your Org’s credit accounting account
    - `debit_cost` string, required — Number of the cost center of the debit accounting account
    - `credit_cost` string, required — Number of the cost center of the credit accounting account
  - `event_type_id` integer — Event type ID
  - `except_program_ids` integer[]
  - `fee_information` object — Information about the fee applied to the accounting entry. It can include details such as fee type, amount, and currency.
  - `is_database_stage` string — Is this accounting script for database staging? If yes, the script is used for testing purposes and does not affect production data.
  - `max_days_due` integer — Maximum number of days for the due date
  - `min_days_due` integer — Minimum number of days for the due date
  - `parameters` AccountingScriptParameters
    - `name` string, required — Parameter name [pismo:timing or bacen:classification]
    - `value` string, required — Parameter value [REGULAR, DUEDATE, TRUE, or 3]
  - `processing_code` string — Processing code
  - `program_id` integer — Program ID
  - `program_list_id` integer[]
  - `program_types` string[]
  - `reason` string — Reason for the operation.
  - `responsible` string — User name or ID of the person performing the operation.

## Response `201`

Created

- AccountingScriptV2[]
  - `id` integer — Accounting script ID
  - `program_id` integer — Program ID
  - `event_type_id` integer — Event type ID
  - `entry_type_id` integer — Entry type ID
  - `debit_accounting` AccountingAccountAccountSctiptPost
    - `description` string, required — Description that helps to identify the accounting account. Can be `0` or any value if there's no corresponding account.
    - `account` string, required — Accounting account number. Can be `0` or any value if there's no corresponding account.
  - `credit_accounting` AccountingAccountAccountSctiptPost
    - `description` string, required — Description that helps to identify the accounting account. Can be `0` or any value if there's no corresponding account.
    - `account` string, required — Accounting account number. Can be `0` or any value if there's no corresponding account.
  - `cost_center` CostCenterAccountingScriptPost
    - `debit_org` string, required — Number of your Org’s debit accounting account
    - `credit_org` string, required — Number of your Org’s credit accounting account
    - `debit_cost` string, required — Number of the cost center of the debit accounting account
    - `credit_cost` string, required — Number of the cost center of the credit accounting account
  - `processing_code` string — Processing code
  - `expression` string — Expression to calculate the value of the accounting entry. It can be a simple mathematical expression or a more complex one using functions.
  - `fee_information` object — Information about the fee applied to the accounting entry. It can include details such as fee type, amount, and currency.
  - `parameters` AccountingScriptParameters
    - `name` string, required — Parameter name [pismo:timing or bacen:classification]
    - `value` string, required — Parameter value [REGULAR, DUEDATE, TRUE, or 3]
  - `cash_in_bucket` AccountingScriptBucket
    - `name` string — Bucket name
    - `account` integer — Account ID
  - `cash_out_bucket` AccountingScriptBucket
    - `name` string — Bucket name
    - `account` integer — Account ID
  - `is_database_stage` string — Indicates if the accounting script is for a database stage. If yes, the script is used for testing purposes and does not affect production data.
  - `min_days_due` integer — Minimum number of days for the due date
  - `max_days_due` integer — Maximum number of days for the due date
  - `history` History — Historical information for auditing the entity.
    - `org_id` string — Organization ID
    - `action` string — Action performed on the entity.
    - `reason` string — Reason for the operation.
    - `responsible` string — User name or ID of the person performing the operation.
    - `version` integer — Entity version.
    - `jsonb` string — JSON representation of the request body.
    - `created_at` string, date-time — Date and time when the history was created (ISO 8601). Format: YYYY-MM-DDThh:mm:ssZ.

## Other responses

- `400` — Bad request
- `409` — Conflict

---

[API](https://skmtc.net/pismo/apis/platform-authentication.md) · [All operations](https://skmtc.net/pismo/apis/platform-authentication/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pismo/platform-authentication/revisions/935b62e16de4/schema)
