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

> Create a commitment.



## OpenAPI

````yaml /openapi-specs/lucca-invoices.yaml post /cleemy-procurement/api/purchases/{id}/commitment
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/api/purchases/{id}/commitment:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - name: id
        description: ID of the purchase you want to create a commitment for.
        in: path
        required: true
        schema:
          type: integer
          format: int32
    post:
      tags:
        - Purchases
      summary: Create a commitment
      description: Create a commitment.
      operationId: post-purchase-commitment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/commitment'
            examples:
              one-time:
                $ref: '#/components/examples/one-time-commitment.post'
              subscription:
                $ref: '#/components/examples/subscription-commitment.post'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/commitment'
              examples:
                commitment:
                  $ref: '#/components/examples/commitment.get'
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:
    commitment:
      title: commitment
      description: >-
        Represents a purchase commitment. Can be one of two types:
        `Subscription` or `OneTime`.


        A "subscription" typed commitment represents a purchase commitment that
        will be paid in installments over a given period, whereas a "one-time"
        commitment will be paid in full once.
      anyOf:
        - $ref: '#/components/schemas/subscription-commitment'
        - $ref: '#/components/schemas/one-time-commitment'
      discriminator:
        propertyName: type
    subscription-commitment:
      title: Subscription Commitment
      description: Commitment for a subscription.
      type: object
      required: []
      properties:
        id:
          description: ID of the commitment.
          type: integer
          format: int32
          readOnly: true
        type:
          description: Type of the commitment.
          type: string
          const: SubscriptionCommitment
        owner:
          description: Owner of the commitment.
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - description: User ID who is the owner of the commitment.
        purchase:
          description: Purchase of the commitment.
          allOf:
            - $ref: '#/components/schemas/purchase-reference'
            - description: Purchase of the subscription commitment.
              readOnly: true
        attachments:
          description: Attachments of the commitment.
          type: array
          minItems: 1
          maxItems: 3
          items:
            $ref: '#/components/schemas/attachment'
        comment:
          description: Comment of the commitment.
          type:
            - string
            - 'null'
        paymentMethod:
          description: Method of payment of the commitment.
          anyOf:
            - $ref: '#/components/schemas/payment-method'
            - type: 'null'
        state:
          $ref: '#/components/schemas/commitment-state'
          description: State of the commitment.
        startDate:
          description: Start date of the subscription.
          type: string
          format: date
        firstInvoiceDate:
          description: Date of the first invoice.
          type: string
          format: date
        invoicingFrequency:
          description: Invoicing frequency of the subscription.
          type: object
          required: []
          properties:
            value:
              type: integer
              format: int32
            unit:
              $ref: '#/components/schemas/time-unit'
        subscriptionDuration:
          description: Duration of the subscription.
          type: object
          required: []
          properties:
            value:
              type: integer
              format: int32
            unit:
              $ref: '#/components/schemas/time-unit'
        contractualObligation:
          description: Contractual obligation of the subscription.
          type: object
          required: []
          properties:
            value:
              type: integer
              format: int32
            unit:
              $ref: '#/components/schemas/time-unit'
        terminationNotice:
          description: Termination notice of the subscription.
          type: object
          required: []
          properties:
            value:
              type: integer
              format: int32
            unit:
              $ref: '#/components/schemas/time-unit'
        amountIncludingTaxesPerPeriod:
          allOf:
            - $ref: '#/components/schemas/dual-currency-taxed-amount'
            - description: Amount including taxes per period.
        amountIncludingTaxes:
          allOf:
            - $ref: '#/components/schemas/dual-currency-taxed-amount'
            - description: Amount including taxes.
        subscriptionEndDate:
          description: End date of the subscription.
          type: string
          format: date
        periodsCount:
          description: Number of periods.
          type: integer
          format: int32
        contractualEndDate:
          description: End date of the contractual obligation.
          type:
            - string
            - 'null'
          format: date
        createdAt:
          description: Date of creation of the commitment. Read-only.
          type: string
          format: date-time
          readOnly: true
        author:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - description: '**Read-only.** User ID who is the author of the commitment.'
              readOnly: true
        modifiedAt:
          description: '**Read-only.** Date of last modification of the commitment.'
          type: string
          format: date-time
          readOnly: true
        modifier:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - description: '**Read-only.** User ID who is the modifier of the commitment.'
              readOnly: true
    one-time-commitment:
      title: One-Time Commitment
      description: Commitment for a one-time purchase.
      type: object
      required: []
      properties:
        id:
          type: integer
          format: int32
          readOnly: true
        type:
          type: string
          const: OneTimeCommitment
        purchase:
          allOf:
            - $ref: '#/components/schemas/purchase-reference'
            - description: Purchase of the one-time commitment.
              readOnly: true
        owner:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
        attachmentIds:
          writeOnly: true
          type: array
          items:
            type: integer
        attachments:
          readOnly: true
          type: array
          minItems: 1
          maxItems: 3
          items:
            $ref: '#/components/schemas/attachment'
        comment:
          type:
            - string
            - 'null'
        paymentMethod:
          anyOf:
            - $ref: '#/components/schemas/payment-method'
            - type: 'null'
        state:
          $ref: '#/components/schemas/commitment-state'
        amountIncludingTaxes:
          $ref: '#/components/schemas/dual-currency-taxed-amount'
        costDate:
          type: string
          format: date
        invoiceDate:
          type: string
          format: date
        createdAt:
          type: string
          format: date-time
          readOnly: true
        author:
          allOf:
            - $ref: '#/components/schemas/user-reference'
            - readOnly: true
        modifiedAt:
          type: string
          format: date-time
          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-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.'
    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
    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
    commitment-state:
      title: State of Commitment (enum)
      description: >-
        Created: the commitment is created. UnderReview: the commitment's
        approval is pending'. Provisioned: the commitment is approved. Denied:
        the commitment is denied. Cancelled: the commitment is cancelled.
      type: string
      enum:
        - Created
        - UnderReview
        - Provisioned
        - Denied
        - Cancelled
    time-unit:
      title: Unit of Time (enum)
      description: 'Day: day. Week: week. Month: month. Year: year.'
      type: string
      enum:
        - Day
        - Week
        - Month
        - Year
    dual-currency-taxed-amount:
      title: Dual currency taxed amount
      description: >-
        Represents an amount of money with VAT taxes in two different
        currencies.
      type: object
      properties:
        base:
          $ref: '#/components/schemas/taxed-amount'
        counter:
          $ref: '#/components/schemas/taxed-amount'
        rate:
          type: number
          format: double
    purchase-type:
      title: purchase-type
      description: Type of purchase.
      type: string
      enum:
        - Subscription
        - OneTime
    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
    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'
    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
  examples:
    one-time-commitment.post:
      summary: POST commitment request example.
      description: POST commitment request example.
      value:
        costDate: '2025-04-14'
        invoiceDate: '2025-04-14'
        amountIncludingTaxes:
          excludingTaxes:
            value: 120
            currency: EUR
          taxes: []
        type: OneTimeCommitment
        attachmentIds: []
        state: Created
        comment: Comment
        paymentMethod: null
    subscription-commitment.post:
      summary: POST Subscription commitment request example.
      description: POST Subscription commitment request example.
      value:
        startDate: '2025-04-14'
        firstInvoiceDate: '2025-04-14'
        invoicingFrequency:
          value: 1
          unit: Month
        subscriptionDuration":
          value: 12
          unit: Month
        contractualObligation": null
        terminationNotice": null
        amountIncludingTaxesPerPeriod":
          excludingTaxes:
            value: 1000
            currency: EUR
          taxes: []
        type: SubscriptionCommitment
        attachmentIds: []
        state: Created
        comment: Comment
        paymentMethod: null
        createdAt: '2024-09-24T10:02:01.9244011+00:00'
        author:
          name: John Doe
          firstName: John
          lastName: Doe
          pictureHref: https://example.ilucca.net/directory/api/employees/416/picture
          id: 416
          href: https://example.ilucca.net/api/v3/users/416
        modifiedAt: '2024-09-24T13:52:40.3558953+00:00'
        modifier:
          name: Matt Bawss
          firstName: Matt
          lastName: Bawss
          pictureHref: https://example.ilucca.net/directory/api/employees/979/picture
          id: 979
          href: https://example.ilucca.net/api/v3/users/979
    commitment.get:
      summary: GET commitment response example.
      description: GET commitment response example.
      value:
        id: 54635
        costDate: '2025-04-14'
        invoiceDate: '2025-04-14'
        amountIncludingTaxes:
          excludingTaxes:
            value: 120
            currency: EUR
          taxes: []
        type: OneTimeCommitment
        attachmentIds: []
        state: Created
        comment: Comment
        paymentMethod: null
        createdAt: '2024-09-24T10:02:01.9244011+00:00'
        author:
          name: John Doe
          firstName: John
          lastName: Doe
          pictureHref: https://example.ilucca.net/directory/api/employees/416/picture
          id: 416
          href: https://example.ilucca.net/api/v3/users/416
        modifiedAt: '2024-09-24T13:52:40.3558953+00:00'
        modifier:
          name: Matt Bawss
          firstName: Matt
          lastName: Bawss
          pictureHref: https://example.ilucca.net/directory/api/employees/979/picture
          id: 979
          href: https://example.ilucca.net/api/v3/users/979

````