> ## Documentation Index
> Fetch the complete documentation index at: https://www.bloxs.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a sales invoice service

> Create a new sales invoice service.

## OpenAPI

````json POST /api/v1/invoices/salesinvoiceservices
{
  "openapi": "3.0.4",
  "info": {
    "title": "Invoices V1",
    "description": "Welcome to BETA version of the new Invoices API - intended for client public testing before the launch of the final version. During this BETA phase, we'll be improving the API based on specific client's feedbacks.",
    "version": "v1"
  },
  "paths": {
    "/api/v1/invoices/salesinvoiceservices": {
      "post": {
        "tags": [
          "SalesInvoiceServices"
        ],
        "summary": "Create a sales invoice service",
        "description": "Create a new sales invoice service.",
        "operationId": "CreateSalesInvoiceService",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesInvoiceService"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sales invoice service was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoiceServiceDetail"
                }
              }
            }
          },
          "400": {
            "description": "The sales invoice service data has validation issues",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorMessageModel"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SalesInvoiceService": {
        "required": [
          "ownerReference",
          "paymentMethod",
          "relationReference"
        ],
        "type": "object",
        "properties": {
          "externalIdentifier": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "salesContractReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "ownerReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "relationReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "supplyDate": {
            "type": "string",
            "format": "date"
          },
          "paymentMethod": {
            "type": "integer",
            "description": "DirectDebit = 1\nBankTransfer = 2",
            "format": "int32",
            "x-enumNames": [
              "DirectDebit",
              "BankTransfer"
            ]
          },
          "automaticApprove": {
            "type": "boolean"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesInvoiceServiceLine"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SalesInvoiceServiceDetail": {
        "required": [
          "ownerReference",
          "paymentMethod",
          "reference",
          "relationReference"
        ],
        "type": "object",
        "properties": {
          "reference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "externalIdentifier": {
            "type": "string",
            "nullable": true
          },
          "salesContractReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "ownerReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "relationReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "supplyDate": {
            "type": "string",
            "format": "date"
          },
          "paymentMethod": {
            "maxLength": 256,
            "minLength": 0,
            "type": "integer",
            "description": "DirectDebit = 1\nBankTransfer = 2",
            "format": "int32",
            "x-enumNames": [
              "DirectDebit",
              "BankTransfer"
            ]
          },
          "workflowState": {
            "type": "integer",
            "description": "Draft = 1\nOnHold = 2\nCancelled = 3\nApprovalWorkflow = 4\nFinal = 7\nDisapproved = 9\nOwnerApprovalWorkflow = 10\nDisapprovedByOwner = 11",
            "format": "int32",
            "x-enumNames": [
              "Draft",
              "OnHold",
              "Cancelled",
              "ApprovalWorkflow",
              "Final",
              "Disapproved",
              "OwnerApprovalWorkflow",
              "DisapprovedByOwner"
            ]
          },
          "totalAmountExcl": {
            "type": "number",
            "format": "double"
          },
          "totalAmountVAT": {
            "type": "number",
            "format": "double"
          },
          "totalAmountIncl": {
            "type": "number",
            "format": "double"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesInvoiceServiceLineAPIDetailModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "APIErrorMessageModel": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "traceId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SalesInvoiceServiceLine": {
        "required": [
          "serviceItemName"
        ],
        "type": "object",
        "properties": {
          "description": {
            "maxLength": 512,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "numberOfItems": {
            "type": "integer",
            "format": "int32"
          },
          "serviceItemName": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string"
          },
          "realEstateObjectReference": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "amountExclPerItem": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "SalesInvoiceServiceLineAPIDetailModel": {
        "type": "object",
        "properties": {
          "lineIndex": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "numberOfItems": {
            "type": "integer",
            "format": "int32"
          },
          "amountExclPerItem": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountExcl": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountVAT": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountIncl": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "serviceItemName": {
            "type": "string",
            "nullable": true
          },
          "realEstateObjectReference": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}
````

