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

# Create a new ExpenseClaim

> When a user wants to declare his expenses, he creates an `ExpenseClaim`.

An `ExpenseClaim` is created by regrouping one or more `ExpenseTempItems` and converting them into ExpenseClaimItems.

Once created, an `ExpenseClaim` has to be approved by his manager.

Multiple `ExpenseClaims` can be created through a single request.



## OpenAPI

````yaml /openapi-specs/cleemy-expenses-v3.yaml post /api/v3/expenseClaims/creation
openapi: 3.1.0
info:
  title: Lucca Expenses
  version: '1.0'
  description: |
    Welcome on the documentation for the Lucca Expenses API.
  contact:
    name: API Support
    url: https://support.lucca.fr
    email: contact@luccasoftware.com
  license:
    name: Unlicensed
    url: https://www.luccasoftware.com
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: ExpenseTempItems
    description: Singular expenses.
  - name: ExpenseClaims
    description: Collection of expenses submitted for approval.
  - name: ExpenseClaimItems
    description: Expenses included in an expenseClaim
  - name: CreateExpenseAccountingExport
    description: Service used to create an export and retrieve the exported entry lines.
paths:
  /api/v3/expenseClaims/creation:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    post:
      tags:
        - ExpenseClaims
      summary: Create a new ExpenseClaim
      description: >-
        When a user wants to declare his expenses, he creates an `ExpenseClaim`.


        An `ExpenseClaim` is created by regrouping one or more
        `ExpenseTempItems` and converting them into ExpenseClaimItems.


        Once created, an `ExpenseClaim` has to be approved by his manager.


        Multiple `ExpenseClaims` can be created through a single request.
      operationId: get-api-v3-expenseClaims-creation
      requestBody:
        content:
          application/json:
            schema:
              type: array
              x-examples:
                example-1:
                  - title: Mars 2016
                    expenseTempItems:
                      - id: 4614
                      - id: 4630
              items:
                type: object
                properties:
                  title:
                    type: string
                    description: >-
                      Human readable name for this ExpenseClaim (eg: "May
                      2022").
                  expenseTempItems:
                    type: array
                    minItems: 1
                    description: >-
                      List of all temporary expenses identifiers that should be
                      included in this expense claim.
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                      required:
                        - id
                required:
                  - title
                  - expenseTempItems
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        createdExpenseClaim:
                          type: object
                          properties:
                            id:
                              type: integer
                            nextApprover:
                              type: object
                              properties:
                                firstName:
                                  type: string
                                lastName:
                                  type: string
                x-examples:
                  example-1:
                    createdExpenseClaim:
                      id: 369
                      nextApprover:
                        firstName: Will
                        lastName: Riker
        '400':
          $ref: '#/components/responses/ResponseProblem'
        '401':
          $ref: '#/components/responses/ResponseProblem'
        '403':
          $ref: '#/components/responses/ResponseProblem'
        '500':
          $ref: '#/components/responses/ResponseProblem'
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  responses:
    ResponseProblem:
      description: Problem
      content:
        application/json:
          schema:
            type: object
            properties:
              Status:
                type: integer
                description: HTTP status code.
                example: 401
              Message:
                type: string
                description: Human readable error message.
                example: Unauthorized

````