Description

If you want to create several cost centers through our API, you can use an endpoint made for it. It natively manages potential errors you might meet while making the import. Moreover, it allows you to choose between two solutions if an error is detected :

  • skip the process and import no data
  • import only the data correct

API call

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

{
    "mode": "AllOrNothing",
    "items": [
        {
            "name": "string", 
            "code": "string",
            "ownerId": 0, // userId Lucca
            "state": "Enabled", // possible values : enabled or disabled. Or enabled by default.
            "establishmentIds": [
                0 // establishmentId Lucca
            ]
        }
    ]
}
Success is indicated by a 200 response status code. If so, the response contains a purchaseId which is the identifier of the created Purchase object.