---
updatedAt: 2026-07-03T13:14:11.000Z
agentTools:
  projectIndex: https://developer.xentral.com/llms.txt
---

# Create product calculation line item V3

This endpoint requires the following scopes: `productCalculation:create`.

Create a product calculation line item

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Xentral Business Documents API v3",
    "description": "The Xentral Business Documents API v3 for working with sales orders, offers, invoices, credit notes, delivery notes, return orders, purchase orders, proforma invoices and productions.\n\nIndividual endpoints marked as *Beta* may still change without prior notice — see the respective endpoint descriptions.\n\nRequest payloads may contain properties that an endpoint does not define; these are ignored rather than rejected. Nothing is stored for them and no error is returned, so check the response body to confirm which values were actually applied.",
    "contact": {
      "name": "API Support",
      "url": "https://xentral.com",
      "email": "api@xentral.com"
    },
    "version": "0.2.0"
  },
  "servers": [
    {
      "url": "https://{xentralId}.xentral.biz",
      "description": "Your xentral instance",
      "variables": {
        "xentralId": {
          "default": "my-company",
          "description": "Your Xentral instance ID"
        }
      }
    },
    {
      "url": "https://{domain}",
      "description": "Xentral with a custom domain",
      "variables": {
        "domain": {
          "default": "demo.xentral.com",
          "description": "Your Xentral custom domain"
        }
      }
    }
  ],
  "components": {
    "schemas": {
      "CreateProductCalculationLineItemData": {
        "description": "Payload to create a product calculation line item",
        "required": [
          "designation",
          "date",
          "costType",
          "totalCost"
        ],
        "properties": {
          "designation": {
            "description": "Designation of the line item.",
            "example": "purchaseCosts",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "string",
                "enum": [
                  "additionalCosts",
                  "productionCosts",
                  "purchaseCosts",
                  "additionalParts",
                  "freightCosts",
                  "additionalFreightCosts"
                ]
              }
            ]
          },
          "date": {
            "description": "Date of the cost.",
            "type": "string",
            "format": "date",
            "example": "2026-01-01"
          },
          "costType": {
            "description": "Type of the cost.",
            "type": "string",
            "enum": [
              "oneTime",
              "perPiece",
              "perLot",
              "purchase",
              "oldMovingAverage"
            ],
            "example": "purchase"
          },
          "includeInCalculation": {
            "description": "Includes the line item into the calculation of the purchase price.",
            "type": "boolean",
            "example": true
          },
          "totalCost": {
            "description": "Total cost of the line item.",
            "required": [
              "amount",
              "currency"
            ],
            "properties": {
              "amount": {
                "description": "Total cost amount of the line item.",
                "type": "string",
                "format": "decimal",
                "example": "100.00"
              },
              "currency": {
                "description": "Total cost currency of the line item.",
                "type": "string",
                "example": "EUR"
              }
            },
            "type": "object"
          },
          "forQuantity": {
            "description": "Quantity for the total cost of the line item.",
            "type": "integer",
            "example": 10
          },
          "archived": {
            "description": "Marks a calculation line item as archived. Archived line items will not be used for further calculations.",
            "type": "boolean",
            "example": false
          },
          "internalComment": {
            "description": "Internal comment. Intended to be used for company-internal notes.",
            "type": "string",
            "example": "this is an internal comment"
          }
        },
        "type": "object"
      },
      "Money": {
        "description": "Money",
        "properties": {
          "amount": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "currency": {
            "description": "Currency",
            "type": "string",
            "example": "EUR"
          }
        },
        "type": "object",
        "example": {
          "amount": "13.37",
          "currency": "EUR"
        },
        "additionalProperties": false
      },
      "ProductCalculationLineItemResource": {
        "description": "A product calculation line item",
        "required": [
          "id",
          "designation",
          "costType",
          "includeInCalculation",
          "totalCost",
          "archived"
        ],
        "properties": {
          "id": {
            "description": "ID of the line item.",
            "type": "string",
            "example": "33"
          },
          "designation": {
            "description": "Designation of the line item. Free text, but commonly one of the known standard designations.",
            "example": "purchaseCosts",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string",
                "enum": [
                  "additionalCosts",
                  "productionCosts",
                  "purchaseCosts",
                  "additionalParts",
                  "freightCosts",
                  "additionalFreightCosts"
                ]
              }
            ]
          },
          "date": {
            "description": "Date of the cost.",
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-01-01"
          },
          "costType": {
            "description": "Type of the cost.",
            "type": "string",
            "enum": [
              "oneTime",
              "perPiece",
              "perLot",
              "purchase",
              "oldMovingAverage"
            ],
            "example": "purchase"
          },
          "includeInCalculation": {
            "description": "Whether the line item is included in the purchase price calculation.",
            "type": "boolean",
            "example": true
          },
          "totalCost": {
            "$ref": "#/components/schemas/Money",
            "description": "Total cost of the line item."
          },
          "forQuantity": {
            "description": "Quantity for the total cost.",
            "type": [
              "integer",
              "null"
            ],
            "example": 10
          },
          "costPerUnit": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Money",
                "description": "Cost per unit."
              },
              {
                "type": "null"
              }
            ],
            "description": "Cost per unit."
          },
          "purchaseOrder": {
            "description": "The purchase order connected to this line item.",
            "properties": {
              "id": {
                "description": "Purchase order ID.",
                "type": "string",
                "example": "1234"
              }
            },
            "type": [
              "object",
              "null"
            ],
            "example": {
              "id": "1234"
            }
          },
          "archived": {
            "description": "Whether the line item is archived.",
            "type": "boolean",
            "example": false
          },
          "editor": {
            "description": "The editor who created/modified the line item. Null when the line item was created without a user (e.g. by a system process).",
            "properties": {
              "id": {
                "description": "User ID of the editor.",
                "type": "string",
                "example": "17"
              },
              "name": {
                "description": "Username of the editor.",
                "type": "string",
                "example": "JohnDoe"
              }
            },
            "type": [
              "object",
              "null"
            ],
            "example": {
              "id": "17",
              "name": "JohnDoe"
            }
          },
          "internalComment": {
            "description": "Internal comment. Intended to be used for company-internal notes.",
            "type": [
              "string",
              "null"
            ],
            "example": "this is an internal comment"
          }
        },
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "ProductCalculation",
      "description": "ProductCalculation"
    }
  ],
  "paths": {
    "/api/v3/products/{id}/calculationItems": {
      "post": {
        "tags": [
          "ProductCalculation"
        ],
        "summary": "Create product calculation line item V3",
        "description": "This endpoint requires the following scopes: `productCalculation:create`.\n\nCreate a product calculation line item",
        "operationId": "POST::api-v3-products-id-calculationitems",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductCalculationLineItemData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create a product calculation line item",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductCalculationLineItemResource"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Failed validation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "properties": {
                    "type": {
                      "description": "Error messages",
                      "type": "string",
                      "example": "https://api.xentral.biz/problems/request-validation"
                    },
                    "title": {
                      "description": "Error messages",
                      "type": "string",
                      "example": "Request payload validation failed."
                    },
                    "violations": {
                      "description": "Error messages",
                      "type": "object",
                      "example": {
                        "designation": [
                          "The designation field is required."
                        ],
                        "date": [
                          "The date field is required."
                        ],
                        "costType": [
                          "The selected cost type is invalid."
                        ]
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "description": "Too Many Requests",
                      "type": "string",
                      "example": "Too Many Requests"
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "x-scopes": [
          "productCalculation:create"
        ]
      }
    }
  }
}
```