---
updatedAt: 2026-08-19T12:11:23.000Z
agentTools:
  projectIndex: https://developer.xentral.com/llms.txt
---

# 🔒 Complete production V3

This endpoint is currently in Beta and available for testing. It may contain bugs, and breaking changes can occur at any time without prior notice. We do not recommend using Beta endpoints in production environments. Should you choose to use it in production, you assume full responsibility for any resulting issues.

This endpoint requires the following scopes: `production:complete`.

Complete a production. The produced goods are booked into the given storage location and the production is closed and write protected. Only released or started productions whose materials have been fully retrieved from stock can be completed. `productionEndDate` is set to the current date when it is still empty.

# 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": {
      "CompleteProductionData": {
        "properties": {
          "quantitySuccessful": {
            "description": "Quantity that was produced successfully and is booked into stock. Defaults to the quantity of the production that is still outstanding, and is capped at it.",
            "type": "number",
            "format": "float",
            "example": 8
          },
          "quantityScrap": {
            "description": "Quantity that was scrapped. This is recorded on the production only - scrapped goods are never booked into stock and are therefore no longer traceable. To keep them traceable, book them as `quantitySuccessful` into a dedicated blocked storage location instead.",
            "type": "number",
            "format": "float",
            "example": 2
          },
          "autoStore": {
            "description": "Whether the produced goods are booked into `storageLocation`. Defaults to true. When false the production is completed without any stock movement, for example when the goods were already received through a purchase order.",
            "type": "boolean",
            "example": true
          },
          "storageLocation": {
            "$ref": "#/components/schemas/StorageLocationReferenceData",
            "description": "Storage location the produced goods are booked into. Required when `autoStore` is true."
          },
          "storeAsProduct": {
            "$ref": "#/components/schemas/ProductReferenceData",
            "description": "Product the produced goods are booked on. Defaults to the product the production produces."
          },
          "batch": {
            "description": "Batch number created by this production. Defaults to the batch recorded on the production. Only booked into the batch stock when the stored product is managed in batches.",
            "type": "string",
            "example": "CH-2026-07"
          },
          "bestBeforeDate": {
            "description": "Best-before date of the produced goods. Defaults to the best-before date recorded on the production. Only booked when the stored product carries a best-before date.",
            "type": "string",
            "format": "date",
            "example": "2027-01-31"
          },
          "completionComment": {
            "description": "Free-text note stored on the production together with the completion.",
            "type": "string",
            "example": "Completed after the second function test."
          }
        },
        "type": "object"
      },
      "ProductReferenceData": {
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "description": "ID of the product",
            "type": "string",
            "example": "13"
          }
        },
        "type": "object"
      },
      "StorageLocationReferenceData": {
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "description": "ID of the storage location",
            "type": "string",
            "example": "13"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Production",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v3/productions/{id}/actions/complete": {
      "patch": {
        "tags": [
          "Production"
        ],
        "summary": "🔒 Complete production V3",
        "description": "This endpoint is currently in Beta and available for testing. It may contain bugs, and breaking changes can occur at any time without prior notice. We do not recommend using Beta endpoints in production environments. Should you choose to use it in production, you assume full responsibility for any resulting issues.\n\nThis endpoint requires the following scopes: `production:complete`.\n\nComplete a production. The produced goods are booked into the given storage location and the production is closed and write protected. Only released or started productions whose materials have been fully retrieved from stock can be completed. `productionEndDate` is set to the current date when it is still empty.",
        "operationId": "PATCH::api-v3-productions-id-actions-complete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteProductionData"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "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": {
                        "quantitySuccessful": [
                          "The quantity successful field must be a number."
                        ],
                        "quantityScrap": [
                          "The quantity scrap field must be a number."
                        ],
                        "autoStore": [
                          "The auto store field must be true or false."
                        ]
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Problem occurred",
            "content": {
              "application/problem+json": {
                "schema": {
                  "properties": {
                    "type": {
                      "description": "A URI reference that identifies the problem type.",
                      "type": "string",
                      "example": "https://api.xentral.biz/problems/invalid-status"
                    },
                    "title": {
                      "description": "A short, human-readable summary of the problem type.",
                      "type": "string",
                      "example": "The resource cannot be modified in its current status."
                    },
                    "detail": {
                      "description": "A human-readable explanation specific to this occurrence of the problem.",
                      "type": "string",
                      "example": "Only a draft BusinessDocument can be deleted."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "description": "Too Many Requests",
                      "type": "string",
                      "example": "Too Many Requests"
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "x-beta": true,
        "x-scopes": [
          "production:complete"
        ]
      }
    }
  }
}
```