> ## 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.

# Update Inbox Document

> Update an inbox document and optionally attach or create a purchase.



## OpenAPI

````yaml /openapi-specs/lucca-invoices.yaml put /cleemy-procurement/services/inbox-documents/{id}
openapi: 3.1.0
info:
  title: Lucca.Invoices
  version: '1.0'
  description: |
    Welcome on the documentation for the Lucca Invoices 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: Purchases
    description: Purchases.
  - name: Cost-Centers
    description: Cost-Centers.
  - name: Approval
    description: Approval.
  - name: VAT
    description: VAT Rates.
  - name: Booked-Documents
    description: Booked-Documents.
  - name: Suppliers
    description: Suppliers.
  - name: Natures
    description: Natures.
  - name: Invoices
    description: Invoices.
  - name: Inbox
    description: Inbox.
  - name: Documents
    description: Documents.
paths:
  /cleemy-procurement/services/inbox-documents/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - name: id
        description: ID of the inbox document.
        in: path
        required: true
        schema:
          type: integer
          format: int32
    put:
      tags:
        - Inbox
      summary: Update Inbox Document
      description: Update an inbox document and optionally attach or create a purchase.
      operationId: put-inbox-document
      requestBody:
        description: Inbox document data to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/inbox-document-edition'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inbox-document'
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
  schemas:
    inbox-document-edition:
      title: inbox-document-edition
      description: Payload for updating an inbox document.
      type: object
      properties:
        document:
          type: object
          description: Document fields to update.
          properties:
            ownerId:
              type: integer
              format: int32
              description: ID of the owner user.
            type:
              description: 'Type of document: Invoice or CreditNote.'
              type: string
              enum:
                - Invoice
                - CreditNote
            context:
              type:
                - object
                - 'null'
              description: Context data for the document.
              properties:
                purchase:
                  $ref: '#/components/schemas/purchase-reference'
            documentDate:
              type:
                - string
                - 'null'
              format: date
            documentNumber:
              type:
                - string
                - 'null'
            amountIncludingTaxes:
              $ref: '#/components/schemas/taxed-amount'
            accountingLabel:
              type:
                - string
                - 'null'
            comment:
              type:
                - string
                - 'null'
            intraCommunityTaxes:
              type: boolean
            dueDate:
              type:
                - string
                - 'null'
              format: date
            paymentDetails:
              type:
                - object
                - 'null'
              properties:
                paymentMethod:
                  $ref: '#/components/schemas/payment-method'
                bankAccount:
                  type:
                    - object
                    - 'null'
                  properties:
                    iban:
                      type:
                        - string
                        - 'null'
                    bic:
                      type:
                        - string
                        - 'null'
        action:
          description: Optional action to perform (attach or create a purchase).
          type:
            - object
            - 'null'
          oneOf:
            - title: AttachPurchase
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - AttachPurchase
                purchaseId:
                  type: integer
                  format: int32
                paymentId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                installmentId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                disputeId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                autoConfirmation:
                  type: boolean
            - title: CreatePurchase
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - CreatePurchase
                title:
                  type:
                    - string
                    - 'null'
                ownerId:
                  type: integer
                  format: int32
                establishmentId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                departmentId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                natureId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                costCenterId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                paymentId:
                  type:
                    - integer
                    - 'null'
                  format: int32
                autoConfirmation:
                  type: boolean
    inbox-document:
      title: inbox-document
      description: A document in the inbox, pending processing.
      type: object
      properties:
        id:
          type: integer
          format: int32
          readOnly: true
        document:
          $ref: '#/components/schemas/document'
        source:
          description: Source of the document (e.g. email, upload).
          type: object
          properties:
            type:
              type: string
        action:
          description: Available action on this inbox document.
          type:
            - object
            - 'null'
        createdAt:
          type: string
          format: date-time
          readOnly: true
        modifiedAt:
          type: string
          format: date-time
          readOnly: true
        author:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
        modifier:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
    purchase-reference:
      title: Reference to a purchase
      description: Reference to a purchase.
      type: object
      required: []
      properties:
        id:
          type: integer
          format: int32
        href:
          type: string
          readOnly: true
        name:
          type: string
          readOnly: true
        type:
          allOf:
            - $ref: '#/components/schemas/purchase-type'
            - readOnly: true
              description: '**Read-only.** Type of the purchase.'
    taxed-amount:
      title: taxed-amount
      description: Represents an amount of money with VAT taxes.
      type: object
      properties:
        excludingTaxes:
          $ref: '#/components/schemas/amount'
        taxes:
          type: array
          items:
            type: object
            required: []
            properties:
              rateTypeId:
                type: integer
                format: int32
              value:
                type: number
                format: double
              currency:
                $ref: '#/components/schemas/currency'
        includingTaxes:
          $ref: '#/components/schemas/amount'
    payment-method:
      title: Method of Payment (enum)
      description: >-
        BankTransfer: bank transfer. PhysicalCard: physical card. Check: check.
        DirectDebit: direct debit. SingleUseCard: single use card.
      type: string
      enum:
        - BankTransfer
        - PhysicalCard
        - Check
        - DirectDebit
        - SingleUseCard
    document:
      title: document
      description: An invoice document (before booking).
      type: object
      properties:
        id:
          type: integer
          format: int32
          readOnly: true
        owner:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
        type:
          description: 'Type of document: Invoice or CreditNote.'
          type: string
          enum:
            - Invoice
            - CreditNote
        context:
          type:
            - object
            - 'null'
          description: Context data for the document.
          properties:
            purchase:
              $ref: '#/components/schemas/purchase-reference'
        documentBreakdown:
          $ref: '#/components/schemas/document-breakdown-reference'
        documentDate:
          type:
            - string
            - 'null'
          format: date
        documentNumber:
          type:
            - string
            - 'null'
        amountIncludingTaxes:
          $ref: '#/components/schemas/taxed-amount'
        accountingLabel:
          type:
            - string
            - 'null'
        comment:
          type:
            - string
            - 'null'
        intraCommunityTaxes:
          type: boolean
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/attachment'
        ocrStatus:
          description: Status of OCR processing.
          type: string
          enum:
            - Pending
            - Processing
            - Processed
            - Failed
            - NotApplicable
          readOnly: true
        dueDate:
          type:
            - string
            - 'null'
          format: date
        paymentDetails:
          type:
            - object
            - 'null'
          properties:
            paymentMethod:
              $ref: '#/components/schemas/payment-method'
            bankAccount:
              type:
                - object
                - 'null'
              properties:
                iban:
                  type:
                    - string
                    - 'null'
                bic:
                  type:
                    - string
                    - 'null'
        createdAt:
          type: string
          format: date-time
          readOnly: true
        modifiedAt:
          type: string
          format: date-time
          readOnly: true
        author:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
        modifier:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
    user-reference:
      title: Reference to a user
      description: Reference to a user.
      type: object
      required: []
      properties:
        id:
          type: integer
          format: int32
        href:
          type: string
          format: uri
          readOnly: true
        name:
          type: string
          readOnly: true
        firstName:
          type: string
          readOnly: true
        lastName:
          type: string
          readOnly: true
        pictureHref:
          description: '**Read-only.** URL to this user picture image file.'
          type:
            - string
            - 'null'
          format: uri
          readOnly: true
    purchase-type:
      title: purchase-type
      description: Type of purchase.
      type: string
      enum:
        - Subscription
        - OneTime
    amount:
      title: amount
      description: Represents an amount of money.
      type: object
      properties:
        value:
          type: number
          format: double
        currency:
          $ref: '#/components/schemas/currency'
    currency:
      title: currency
      description: ISO-4217 currency code.
      type: string
      minLength: 3
      enum:
        - Invalid
        - ALL
        - DZD
        - ARS
        - AUD
        - BSD
        - BHD
        - BDT
        - AMD
        - BBD
        - BMD
        - BTN
        - BOB
        - BWP
        - BZD
        - SBD
        - BND
        - MMK
        - BIF
        - KHR
        - CAD
        - CVE
        - KYD
        - LKR
        - CLP
        - CNY
        - COP
        - KMF
        - CRC
        - HRK
        - CUP
        - CZK
        - DKK
        - DOP
        - SVC
        - ETB
        - ERN
        - FKP
        - FJD
        - DJF
        - GMD
        - GIP
        - GTQ
        - GNF
        - GYD
        - HTG
        - HNL
        - HKD
        - HUF
        - ISK
        - INR
        - IDR
        - IRR
        - IQD
        - ILS
        - JMD
        - JPY
        - KZT
        - JOD
        - KES
        - KPW
        - KRW
        - KWD
        - KGS
        - LAK
        - LBP
        - LSL
        - LVL
        - LRD
        - LYD
        - LTL
        - MOP
        - MWK
        - MYR
        - MVR
        - MRO
        - MUR
        - MXN
        - MNT
        - MDL
        - MAD
        - OMR
        - NAD
        - NPR
        - ANG
        - AWG
        - VUV
        - NZD
        - NIO
        - NGN
        - NOK
        - PKR
        - PAB
        - PGK
        - PYG
        - PEN
        - PHP
        - QAR
        - RUB
        - RWF
        - SHP
        - STD
        - SAR
        - SCR
        - SLL
        - SGD
        - VND
        - SOS
        - ZAR
        - SSP
        - SZL
        - SEK
        - CHF
        - SYP
        - THB
        - TOP
        - TTD
        - AED
        - TND
        - UGX
        - MKD
        - EGP
        - GBP
        - TZS
        - USD
        - UYU
        - UZS
        - WST
        - YER
        - ZMK
        - TWD
        - UYW
        - VES
        - MRU
        - STN
        - CUC
        - ZWL
        - BYN
        - TMT
        - GHS
        - VEF
        - SDG
        - UYI
        - RSD
        - MZN
        - AZN
        - RON
        - CHE
        - CHW
        - TRY
        - XAF
        - XCD
        - XOF
        - XPF
        - XBA
        - XBB
        - XBC
        - XBD
        - XAU
        - XDR
        - XAG
        - XPT
        - XTS
        - XPD
        - XUA
        - ZMW
        - SRD
        - MGA
        - COU
        - AFN
        - TJS
        - AOA
        - BYR
        - BGN
        - CDF
        - BAM
        - EUR
        - MXV
        - UAH
        - GEL
        - BOV
        - PLN
        - BRL
        - CLF
        - XSU
        - USN
        - XXX
    document-breakdown-reference:
      title: Reference to a document-breakdown.
      type: object
      required: []
      properties:
        id:
          type: integer
          format: int32
          minimum: 1
        href:
          type: string
        name:
          type: string
    attachment:
      title: attachment
      description: File attached to this object.
      type: object
      required: []
      properties:
        id:
          type: integer
          format: int32
        file:
          $ref: '#/components/schemas/file'
        createdAt:
          type: string
          format: date-time
        pages:
          type: object
          properties:
            displayHrefTemplate:
              type: string
            count:
              type: integer
              format: int32
    file:
      title: file
      description: Reference to a file.
      type: object
      required: []
      properties:
        id:
          type: string
          format: uuid
        href:
          type: string
        name:
          type: string
        displayHref:
          type: string

````