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

# Set the project on selected sales invoices

> Requires the projects entitlement. Sets the same project on every selected sales
invoice header and line item in a single transaction.




## OpenAPI

````yaml /openapi/openapi.json post /invoices/projects
openapi: 3.1.0
info:
  title: OpenAPI
  version: '1.0'
  summary: OpenApi
  contact:
    name: Altera Support
    url: https://altera.co
    email: wsparcie@altera.co
  description: ''
  license:
    url: https://altera.co/regulamin
    name: Terms of services for Altera.app
servers:
  - url: https://api.altera.co
    description: Production endpoint (proxied)
security:
  - Authorization: []
tags:
  - name: Configuration
  - name: Data export
  - name: Expenses
  - name: Sales
paths:
  /invoices/projects:
    post:
      tags:
        - Sales
      summary: Set the project on selected sales invoices
      description: >
        Requires the projects entitlement. Sets the same project on every
        selected sales

        invoice header and line item in a single transaction.
      operationId: updateSalesInvoiceProjects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectBatchUpdate'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceBatchUpdated'
        '400':
          description: >-
            Invalid input or a project outside the company's active catalog. The
            entire batch is rejected.
        '401':
          $ref: '#/components/responses/OpenApiAuthorizationRequired'
        '402':
          description: The company's subscription does not include projects.
        '403':
          $ref: '#/components/responses/OpenApiAccessDenied'
        '404':
          description: >-
            At least one ID does not identify an undeleted sales invoice in the
            API key's company.
components:
  schemas:
    ProjectBatchUpdate:
      type: object
      additionalProperties: false
      required:
        - invoiceIds
        - tag
      properties:
        invoiceIds:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: integer
            minimum: 1
            maximum: 9007199254740991
        tag:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Active project ID from GET /company/projects?onlyActive=1. Set to
            null to clear the project.
      example:
        invoiceIds:
          - 101
          - 102
        tag: 9
    InvoiceBatchResult:
      type: object
      required:
        - result
        - data
      properties:
        result:
          type: string
          enum:
            - OK
        data:
          type: object
          required:
            - processed
            - rejected
          properties:
            processed:
              type: array
              description: >-
                Each processed invoice ID appears once, in the order of its
                first occurrence in the request.
              uniqueItems: true
              items:
                type: integer
                minimum: 1
            rejected:
              type: array
              maxItems: 0
              items:
                type: object
  responses:
    InvoiceBatchUpdated:
      description: Every selected document was updated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceBatchResult'
    OpenApiAuthorizationRequired:
      description: >-
        The Authorization header is missing, or a verified key has expired
        (KEY_EXPIRED).
    OpenApiAccessDenied:
      description: The API key is invalid or the company does not have OpenAPI access.
  securitySchemes:
    Authorization:
      name: Authorization
      type: apiKey
      in: header
      description: OpenApi Key created within Altera.app for a certain company

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.