Skip to content

upsertDimension

DESTRUCTIVE

Upsert dimension.

POST /api/v1/accounting/upsertDimension
curl -X POST '<your-host>/api/v1/accounting/upsertDimension' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "dimension": "string",
    "_operation": "create"
  }'
Response
{
  "id": "string",
  "companyGroupId": "string"
}

Parameters

ParameterType

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

"create""update"

Input schema

schema
{
  "type": "object",
  "properties": {
    "dimension": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "entityType": {
              "type": "string",
              "enum": [
                "CostCenter",
                "Custom",
                "Customer",
                "CustomerType",
                "Department",
                "Employee",
                "FixedAssetClass",
                "Item",
                "ItemPostingGroup",
                "Location",
                "Process",
                "Project",
                "ScrapReason",
                "Supplier",
                "SupplierType",
                "WorkCenter"
              ]
            },
            "active": {
              "type": "boolean"
            },
            "required": {
              "type": "boolean"
            }
          },
          "required": [
            "name",
            "entityType"
          ]
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "entityType": {
              "type": "string",
              "enum": [
                "CostCenter",
                "Custom",
                "Customer",
                "CustomerType",
                "Department",
                "Employee",
                "FixedAssetClass",
                "Item",
                "ItemPostingGroup",
                "Location",
                "Process",
                "Project",
                "ScrapReason",
                "Supplier",
                "SupplierType",
                "WorkCenter"
              ]
            },
            "active": {
              "type": "boolean"
            },
            "required": {
              "type": "boolean"
            },
            "id": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "entityType",
            "id"
          ]
        }
      ]
    },
    "dimensionValues": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "_operation": {
      "type": "string",
      "enum": [
        "create",
        "update"
      ],
      "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."
    }
  },
  "required": [
    "dimension",
    "_operation"
  ]
}