POST
/
cleemy-procurement
/
api
/
purchases
Create a Purchase
curl --request POST \
  --url https://{host}/cleemy-procurement/api/purchases \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ownerId": 35,
  "natureId": 1,
  "costCenterId": 3,
  "establishmentId": 1,
  "departmentId": 14,
  "supplier": {
    "id": 6
  },
  "title": "Purchase entry test",
  "axisSectionIds": [
    361
  ]
}'
{
  "id": 6655,
  "type": "Subscription",
  "commitment": {
    "id": 6233,
    "type": "SubscriptionCommitment",
    "owner": {
      "id": 416,
      "href": "https://example.ilucca.net/api/v3/users/416",
      "name": "John Doe",
      "firstName": "John",
      "lastName": "Doe",
      "pictureHref": "https://example.ilucca.net/directory/api/employees/416/picture"
    },
    "purchase": {
      "id": 6655,
      "href": "/cleemy-procurement/api/purchases/6655",
      "name": "AWS S3",
      "type": "Subscription"
    },
    "attachments": [
      {
        "id": 14810,
        "file": {
          "id": "a6dcc9e5-d251-4d3a-86a2-74d9b452b643",
          "href": "/cleemy-procurement/api/files/a6dcc9e5-d251-4d3a-86a2-74d9b452b643",
          "name": "mintlify.png",
          "displayHref": "/cleemy-procurement/api/files/a6dcc9e5-d251-4d3a-86a2-74d9b452b643/display"
        },
        "createdAt": "2024-09-24T10:02:02.4476765+00:00",
        "pages": {
          "displayHrefTemplate": "/cleemy-procurement/api/files/a6dcc9e5-d251-4d3a-86a2-74d9b452b643/display/pages/{pageNumber}",
          "count": 1
        }
      }
    ],
    "comment": "Renewal of our AWS S3 subscription.",
    "paymentMethod": "SingleUseCard",
    "state": "Provisioned",
    "startDate": "2024-09-24",
    "firstInvoiceDate": "2024-09-24",
    "invoicingFrequency": {
      "value": 12,
      "unit": "Month"
    },
    "subscriptionDuration": {
      "value": 12,
      "unit": "Month"
    },
    "subscriptionEndDate": "2025-09-23",
    "contractualEndDate": null,
    "periodsCount": 1,
    "amountIncludingTaxesPerPeriod": {
      "base": {
        "excludingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        },
        "taxes": [],
        "includingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        }
      },
      "counter": {
        "excludingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        },
        "taxes": [],
        "includingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        }
      },
      "rate": 1
    },
    "amountIncludingTaxes": {
      "base": {
        "excludingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        },
        "taxes": [],
        "includingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        }
      },
      "counter": {
        "excludingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        },
        "taxes": [],
        "includingTaxes": {
          "value": 3239.57,
          "currency": "EUR"
        }
      },
      "rate": 1
    },
    "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"
    }
  },
  "createdAt": "2024-09-24T10:02:01.7596447+00:00",
  "modifiedAt": "2024-10-30T10:57:03.4349936+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"
  },
  "modifier": {
    "name": "Gérôme Durand",
    "firstName": "Gérôme",
    "lastName": "Durand",
    "pictureHref": "https://example.ilucca.net/directory/api/employees/1383/picture",
    "id": 1383,
    "href": "https://example.ilucca.net/api/v3/users/1383"
  },
  "owner": {
    "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"
  },
  "nature": {
    "name": "Abonnement SAAS",
    "id": 1,
    "href": "/cleemy-procurement/api/natures/1"
  },
  "costCenter": {
    "name": "406_Product Ops",
    "code": "406_Product Ops",
    "id": 41,
    "href": "/cleemy-procurement/api/costcenters/41"
  },
  "establishment": {
    "name": "Lucca Marseille",
    "id": 13,
    "href": "https://example.ilucca.net/organization/structure/api/establishments/13"
  },
  "department": {
    "name": "Product Department",
    "id": 57,
    "href": "https://example.ilucca.net/organization/structure/api/departments/57"
  },
  "supplier": {
    "id": 952,
    "type": "Concrete",
    "href": "/cleemy-procurement/api/suppliers/952",
    "name": "Amazon",
    "territory": {
      "name": "United States of America",
      "id": "US",
      "href": "https://example.ilucca.net/organization/structure/api/countries?code=US"
    },
    "flag": "Unflagged"
  },
  "availableAmount": {
    "base": {
      "value": 0,
      "currency": "EUR"
    },
    "counter": {
      "value": 0,
      "currency": "EUR"
    },
    "rate": 1
  },
  "billedAmount": {
    "base": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "counter": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "rate": 1
  },
  "committedAmount": {
    "base": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "counter": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "rate": 1
  },
  "confirmedAmount": {
    "base": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "counter": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "rate": 1
  },
  "requestedAmount": {
    "base": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "counter": {
      "value": 3214.66,
      "currency": "EUR"
    },
    "rate": 1
  },
  "aggregatedStates": {
    "creditNotes": {
      "expected": 0,
      "toReview": 0,
      "partial": 0,
      "confirmed": 0,
      "pendingRetraction": 0,
      "removed": 0,
      "bypassed": 0
    },
    "invoices": {
      "expected": 0,
      "toReview": 0,
      "pendingBreakdown": 0,
      "confirmed": 0,
      "litigation": 0,
      "discarded": 0,
      "removed": 0,
      "bypassed": 1
    },
    "invoicesPayments": {
      "toPay": 0,
      "underReview": 0,
      "emitting": 0,
      "paid": 1,
      "onHold": 0
    },
    "creditNotesPayments": {
      "available": 0,
      "consumed": 0,
      "unavailable": 0
    }
  },
  "axisSections": [],
  "title": "AWS S3",
  "state": "Closed"
}

Headers

Authorization
string
required

API key. Value must be formatted like so: lucca application={api_key}.

Body

application/json

The purchase to create.

Purchase.

type
enum<string>

Type of purchase.

Available options:
Subscription,
OneTime
title
string

Title of the purchase.

commitment
object

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. Read-only. Commitment of the purchase. readOnly: true Commitment for a subscription.

ownerId
integer

ID of the user who is the owner of the purchase.

owner
object

Reference to a user. Owner of the purchase.

natureId
integer

ID of the nature to which the purchase belongs.

costCenterId
integer

ID of the cost-center to which the purchase belongs.

costCenter
object

Reference to a cost-center. Read-only. Cost-center to which the purchase belongs.

establishmentId
integer

ID of the establishment to which the purchase belongs.

establishment
object

Reference to an establishment. Read-only. Establishment to which the purchase belongs.

departmentId
integer

ID of the department to which the purchase belongs.

department
object

Reference to a department. Read-only. Department to which the purchase belongs.

supplier
object

Supplier of the purchase. Draft supplier.

availableAmount
object

Represents an amount of money in two different currencies. Read-only. Available amount of the purchase.

billedAmount
object

Represents an amount of money in two different currencies. Read-only. Billed amount of the purchase.

committedAmount
object

Represents an amount of money in two different currencies. Read-only. Committed amount of the purchase.

confirmedAmount
object

Represents an amount of money in two different currencies. Read-only. Confirmed amount of the purchase.

requestedAmount
object

Represents an amount of money in two different currencies. Read-only. Requested amount of the purchase.

axisSectionIds
integer[]

Write-only. IDs of the axis-sections to which the purchase belongs.

author
object

Read-only. User ID who is the author of the purchase. Reference to a user.

modifier
object

Read-only. User ID who is the modifier of the purchase. Reference to a user.

Response

201 - application/json

Created

Purchase.

id
integer
type
enum<string>

Type of purchase.

Available options:
Subscription,
OneTime
title
string

Title of the purchase.

state
enum<string>
Available options:
Created,
Processing,
Ongoing,
Denied,
Closed,
Cancelled
commitment
object

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. Read-only. Commitment of the purchase. readOnly: true Commitment for a subscription.

owner
object

Reference to a user. Owner of the purchase.

nature
object

Nature of the purchase.

costCenter
object

Reference to a cost-center. Read-only. Cost-center to which the purchase belongs.

establishment
object

Reference to an establishment. Read-only. Establishment to which the purchase belongs.

department
object

Reference to a department. Read-only. Department to which the purchase belongs.

supplier
object

Supplier of the purchase. Draft supplier.

availableAmount
object

Represents an amount of money in two different currencies. Read-only. Available amount of the purchase.

billedAmount
object

Represents an amount of money in two different currencies. Read-only. Billed amount of the purchase.

committedAmount
object

Represents an amount of money in two different currencies. Read-only. Committed amount of the purchase.

confirmedAmount
object

Represents an amount of money in two different currencies. Read-only. Confirmed amount of the purchase.

requestedAmount
object

Represents an amount of money in two different currencies. Read-only. Requested amount of the purchase.

aggregatedStates
object

Read-only. Aggregated states of the purchase.

axisSections
Reference to an axis-section · object[]

Read-only. Axis-sections to which the purchase belongs.

createdAt
string<date-time>

Read-only. Date of creation of the purchase

author
object

Read-only. User ID who is the author of the purchase. Reference to a user.

modifiedAt
string<date-time>

Read-only. Date of last modification of the purchase.

modifier
object

Read-only. User ID who is the modifier of the purchase. Reference to a user.