Steps

Creating an approved Order is done through three distinct calls:

1

Create a new Purchase

2

Create a Commitment

3

Trigger the approval workflow

The order will eventually be created once the approval workflow succeeds, which corresponds to approving the purchase request.


1. Create a new Purchase

POST /cleemy-procurement/api/purchases HTTPS/2
Host: example.ilucca.net
Authorization: lucca application={API_KEY}
Content-Type: application/json

{
    "ownerId": 35, // Identifier of the user this purchase belongs to.
    "natureId": 1, // Identifier of the nature of this purchase.
    "costCenterId": 3,// Cost center identifier
    "establishmentId": 1, // Identifier of the business-establishment. Usually the one the owner of this purchase works in.
    "departmentId": 14, // Identifier of the department. Usually the one the owner of this purchase works in.
    "supplier": {
        "id": 6,
        "name": "Amazon",
        "territoryId": "FR"
    },
    "title": "Purchase entry test",
    "axisSectionIds": [361] // Optional, depends on client configuration.
}
Success is indicated by a 201 response status code. If so, the response contains a purchaseId which is the identifier of the created Purchase object.

File upload is done via the upload API of our file management system (lucca-files). Please refer to the dedicated documentation.


2. Create a Commitment

Pleas note a Commitment can be of type “one-time” (i.e. OneTimeCommitment) or “recurring” (i.e. SubscriptionCommitment). In which case the payload changes slightly.

POST /cleemy-procurement/api/purchases/{purchaseId}/commitment HTTPS/2
Host: example.ilucca.net
Authorization: lucca application={API_KEY}
Content-Type: application/json

{
    "costDate": "2025-04-14", // delivery date
    "invoiceDate": "2025-04-14", // invoice date
    "amountIncludingTaxes": { // amount, with an excluding taxes part and taxes (array by rate)
        "excludingTaxes": {
            "value": 120,
            "currency": "EUR"
        },
        "taxes": [] 
    },
    "type": "OneTimeCommitment", // purchase type, detailed below.
    "attachmentIds": [], // file attached to the purchase request detailed in the annex
    "state": "Created",
    "comment": "Comment",
    "paymentMethod": null // payment method: can be left empty.
}
Success is indicated by a 201 response status code. If so, the response contains a commitmentId which is the identifier of the created Commitment object.

3. Trigger the approval workflow

POST /cleemy-procurement/api/commitments/{commitmentId}/requests HTTPS/2
Host: example.ilucca.net
Authorization: lucca application={API_KEY}
Content-Length: 0
The request body is expected to be empty.

The system will configure auto-approval of requests so that the order is automatically created at the end of the workflow.


Addendum