Skip to content

upsertAccount

WRITE

Upsert account.

POST /api/v1/accounting/upsertAccount
curl -X POST '<your-host>/api/v1/accounting/upsertAccount' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "incomeBalance": "Balance Sheet",
    "class": "Asset",
    "consolidatedRate": "Average",
    "_operation": "create"
  }'
Response
{
  "id": "string"
}

Parameters

ParameterType

Required. 'create' inserts a new record, 'update' modifies the existing record with this id.

"create""update"
"Asset""Liability""Equity""Revenue""Expense"
"Average""Current""Historical"
"Balance Sheet""Income Statement"
min length 1
"Bank""Cash""Accounts Receivable""Accounts Payable""Inventory""Fixed Asset""Accumulated Depreciation""Other Current Asset""Other Asset""Other Current Liability""Long Term Liability""Equity - No Close""Equity - Close""Retained Earnings""Income""Cost of Goods Sold""Expense""Other Income""Other Expense""Tax""Investments"

Input schema

schema
{
  "type": "object",
  "properties": {
    "number": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "parentId": {
      "type": "string"
    },
    "isGroup": {
      "type": "boolean"
    },
    "accountType": {
      "type": "string",
      "enum": [
        "Bank",
        "Cash",
        "Accounts Receivable",
        "Accounts Payable",
        "Inventory",
        "Fixed Asset",
        "Accumulated Depreciation",
        "Other Current Asset",
        "Other Asset",
        "Other Current Liability",
        "Long Term Liability",
        "Equity - No Close",
        "Equity - Close",
        "Retained Earnings",
        "Income",
        "Cost of Goods Sold",
        "Expense",
        "Other Income",
        "Other Expense",
        "Tax",
        "Investments"
      ]
    },
    "incomeBalance": {
      "type": "string",
      "enum": [
        "Balance Sheet",
        "Income Statement"
      ]
    },
    "class": {
      "type": "string",
      "enum": [
        "Asset",
        "Liability",
        "Equity",
        "Revenue",
        "Expense"
      ]
    },
    "consolidatedRate": {
      "type": "string",
      "enum": [
        "Average",
        "Current",
        "Historical"
      ]
    },
    "customFields": {},
    "id": {
      "type": "string"
    },
    "_operation": {
      "type": "string",
      "enum": [
        "create",
        "update"
      ],
      "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."
    }
  },
  "required": [
    "name",
    "incomeBalance",
    "class",
    "consolidatedRate",
    "_operation"
  ]
}