Projects API
General:
Basics:
Base-URL: https://capi.lagerkoll.com/v1/projects/
Parameters in the url should all be encoded and all data sent should be UTF-8
MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.
Headers:
There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>> user_id: <<USER_ID>> user_token: <<USER_TOKEN>> api_key: <<API_KEY>> Accept: application/json Content-Type: application/json
Errors:
| Code | Description |
|---|---|
| 900001 | Credentials don't match |
| 900101 | Common error |
| 900429 | Too many requests |
| 906001 | Error when getting project |
| 906002 | Error when getting customer |
| 906003 | Error when getting user |
| 906004 | Error when getting article |
| 906005 | Error when getting invoice draft |
| 906011 | Error when creating a project |
| 906012 | Error when creating a project article |
| 906013 | Error when creating invoice draft from articles |
| 906014 | Error when creating invoice from invoice drafts |
| 906021 | Error when updating a project |
| 906022 | Error when updating a project article |
| 906023 | Error when updating an invoice draft |
| 906031 | To large amount for the artcile |
| 906032 | Project still has articles with amount in them |
{
"errorCode" : 900101,
"errorMessage" : "Something went wrong on the server",
"errorField" : null,
"errorData" : null
}
Projects API:
Export
Create export
POSTUrl: /export
Headers:
Accept: application/json or application/xml
Create export file for articles in open projects
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| save_document | If true, the document will be saved in the feature extension. If false, a mail will be sent to all admins of the store | false |
Body:
Successfull response:
Projects
Get invoice drafts
GETUrl: /{project_id}/articles/invoice
Headers:
Accept: application/json or application/xml
Get a list of invoice drafts for a project
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| state | 0-invoice drafts that are not invoiced or in processed, 1-invoice drafts that are in process but not yet invoiced 2-invoice drafts which are invoiced and processed | 0 | 0, 1, 2 |
| page | 0 | ||
| limit | 50 | ||
| sort_column | created | article_id, article_name, user, created | |
| sort_order | desc | asc,desc |
Body:
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 5275.6364592637065, "articleName": "articleName", "pricelistId": 1504, "endDate": 1765847356883, "rentalAmount": 8710.604982253431, "created": 1765847356883, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 1543, "price": 1217.7719890748451, "isProcessed": true, "dataArticleId": 9186, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 6078, "startDate": 1765847356883, "createdById": 3238 }], "pages": 4797, "pageSize": 1397, "draftsCount": 1825, "page": 6284 }
Get project for id
GETUrl: /{project_id}
Headers:
Accept: application/json or application/xml
Get project based on id
Body:
Successfull response:
{ "createdByName": "createdByName", "cost": 2343.524920776837, "created": 1346, "description": "description", "customerName": "customerName", "stockValue": 5857.052107949275, "name": "name", "customerId": 9675, "state": "0", "projectId": 3447, "responsibleUserId": 6939, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2269.2514477131085, "batchSnBestBefore": 4539, "accountName": "accountName", "articleId": "articleId", "priceListId": 9396, "purchasePrice": 7863.651845250663, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 8816, "checkoutDate": 6965, "price": 3632.906111625038, "comment": "comment", "id": 294, "projectId": 3946, "checkoutAmount": 2765.0612452081878, "events": [{ "date": 1765847356884, "amount": 4852.148976959008, "type": "type" }], "checkinConsumeDate": 1765847356884, "checkinAmount": 3357.311146357478, "consumedAmount": 1697.7621236127661 }], "createdById": 8544, "responsibleUserName": "responsibleUserName" }
Get projects
GETUrl:
Headers:
Accept: application/json or application/xml
Get a list of projects
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| state | -1 | 0,1 | |
| from | 0 | ||
| to | 0 | ||
| page | 0 | ||
| limit | 50 | ||
| query | |||
| cost | false | ||
| sort_column | start_date | start_date,end_date | |
| order | desc | asc,desc |
Body:
Successfull response:
{ "pages": 3261, "projects": [{ "createdByName": "createdByName", "cost": 6432.9238105393915, "created": 9046, "description": "description", "customerName": "customerName", "stockValue": 6840.188216001832, "name": "name", "customerId": 8152, "state": "0", "projectId": 2610, "responsibleUserId": 1683, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 3014.8852277642677, "batchSnBestBefore": 9967, "accountName": "accountName", "articleId": "articleId", "priceListId": 9984, "purchasePrice": 7843.585414580218, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 7200, "checkoutDate": 9143, "price": 9658.465119531427, "comment": "comment", "id": 8373, "projectId": 3036, "checkoutAmount": 5751.737244768268, "events": [{ "date": 1765847356884, "amount": 2681.185252748206, "type": "type" }], "checkinConsumeDate": 1765847356884, "checkinAmount": 631.9982462399144, "consumedAmount": 6324.028334208703 }], "createdById": 5892, "responsibleUserName": "responsibleUserName" }], "pageSize": 7897, "page": 4460, "projectsCount": 5433 }
Get changed projects
GETUrl: /events
Headers:
Accept: application/json or application/xml
Get a list of open projects where articles have been checked out, checked in, consumed or invoiced between a start date and end date
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start_date | Start date of when events can occur. Format is yyyy-MM-dd and defaults to previous month | ||
| end_date | End date of when events can occur. Format is yyyy-MM-dd and defaults to end of start date's month | ||
| page | 0 | ||
| limit | 50 | ||
| sort_column | created | name, customer, created_by, created | |
| order | desc | asc,desc |
Body:
Successfull response:
{ "pages": 9420, "projects": [{ "createdByName": "createdByName", "cost": 838.4572493999365, "created": 7050, "description": "description", "customerName": "customerName", "stockValue": 6369.063947275967, "name": "name", "customerId": 3905, "state": "0", "projectId": 5608, "responsibleUserId": 6342, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 1727.5728671000113, "batchSnBestBefore": 5808, "accountName": "accountName", "articleId": "articleId", "priceListId": 2476, "purchasePrice": 2866.3549868094174, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 9216, "checkoutDate": 5147, "price": 3011.6602518359746, "comment": "comment", "id": 2276, "projectId": 17, "checkoutAmount": 7299.270581413973, "events": [{ "date": 1765847356884, "amount": 982.6578203785085, "type": "type" }], "checkinConsumeDate": 1765847356884, "checkinAmount": 8555.556282456086, "consumedAmount": 6399.169483194353 }], "createdById": 4251, "responsibleUserName": "responsibleUserName" }], "pageSize": 9580, "page": 7312, "projectsCount": 2148 }
Get project articles
GETUrl: /{project_id}/articles
Headers:
Accept: application/json or application/xml
Get a list of project articles
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| query | |||
| state | 0-all articles, 1-only checked out articles with available value, 2-checked out and rental articles with available value | 0 | 0,1,2 |
| page | 0 | ||
| limit | 50 | ||
| sort_column | checkout_date | article_id, article_name, user, checkout_date | |
| sort_order | desc | asc,desc |
Body:
Successfull response:
{ "pages": 5656, "pageSize": 1584, "page": 790, "projectsCount": 7177, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 970.0494277426396, "batchSnBestBefore": 6868, "accountName": "accountName", "articleId": "articleId", "priceListId": 2356, "purchasePrice": 4498.386577345499, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 9628, "checkoutDate": 2891, "price": 5071.164663387355, "comment": "comment", "id": 8830, "projectId": 646, "checkoutAmount": 5662.379298135429, "events": [{ "date": 1765847356885, "amount": 7535.076350600571, "type": "type" }], "checkinConsumeDate": 1765847356885, "checkinAmount": 6503.868624139321, "consumedAmount": 2515.588504901124 }] }
Get cost for project
GETUrl: /{project_id}/cost
Headers:
Accept: application/json or application/xml
Get total cost for a project
Body:
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 6631.983127816772, "articleName": "articleName", "pricelistId": 9006, "endDate": 1765847356885, "rentalAmount": 9281.316516610488, "created": 1765847356885, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 6492, "price": 1995.0470872407823, "isProcessed": false, "dataArticleId": 776, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 9591, "startDate": 1765847356885, "createdById": 2317 }], "pages": 3833, "pageSize": 9243, "draftsCount": 8522, "page": 8471 }
Add project
POSTUrl:
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Add a new project
Body:
{ "createdByName": "createdByName", "cost": 155.67397048400156, "created": 5112, "description": "description", "customerName": "customerName", "stockValue": 1846.3155244155216, "name": "name", "customerId": 3041, "state": "0", "responsibleUserId": 6479, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2476.421913764307, "batchSnBestBefore": 4015, "accountName": "accountName", "articleId": "articleId", "priceListId": 8113, "purchasePrice": 1377.1885237935567, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 4173, "checkoutDate": 6442, "price": 7145.122547710409, "comment": "comment", "id": 4688, "projectId": 6577, "checkoutAmount": 1280.136409984829, "events": [{ "date": 1765847356886, "amount": 5483.283075547749, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 528.3316528508641, "consumedAmount": 7478.578558654994 }], "createdById": 7070, "responsibleUserName": "responsibleUserName" }
Successfull response:
{ "createdByName": "createdByName", "cost": 428.92746287453986, "created": 35, "description": "description", "customerName": "customerName", "stockValue": 9444.250418376261, "name": "name", "customerId": 3978, "state": "0", "projectId": 5813, "responsibleUserId": 6672, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 1778.080405842153, "batchSnBestBefore": 1072, "accountName": "accountName", "articleId": "articleId", "priceListId": 7765, "purchasePrice": 4566.116202673234, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 5609, "checkoutDate": 144, "price": 4461.330075413476, "comment": "comment", "id": 6990, "projectId": 7733, "checkoutAmount": 761.8531140375973, "events": [{ "date": 1765847356886, "amount": 9029.610393107494, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 9887.735432320462, "consumedAmount": 1929.8664890707862 }], "createdById": 7726, "responsibleUserName": "responsibleUserName" }
Add project
POSTUrl: /customer_order/{customer_order_id}
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Add a new project
Body:
{"projectId": 7105}
Successfull response:
{ "createdByName": "createdByName", "cost": 1991.3856402929175, "created": 7741, "description": "description", "customerName": "customerName", "stockValue": 1949.91869787539, "name": "name", "customerId": 6858, "state": "0", "projectId": 3910, "responsibleUserId": 1018, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 7875.306796977504, "batchSnBestBefore": 8894, "accountName": "accountName", "articleId": "articleId", "priceListId": 9706, "purchasePrice": 8893.33645561563, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 7472, "checkoutDate": 4349, "price": 4797.48507266527, "comment": "comment", "id": 6219, "projectId": 1485, "checkoutAmount": 9228.57554081335, "events": [{ "date": 1765847356886, "amount": 9281.765280499118, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 9786.980515868308, "consumedAmount": 1417.9563736668433 }], "createdById": 7393, "responsibleUserName": "responsibleUserName" }
Add project article
POSTUrl: /{id}/article
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Add a new article to a project
Body:
{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2193.3306965933953, "batchSnBestBefore": 5774, "accountName": "accountName", "articleId": "articleId", "priceListId": 7974, "purchasePrice": 5630.5211350790005, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 458, "checkoutDate": 7725, "price": 4193.293253752617, "comment": "comment", "id": 2714, "projectId": 900, "checkoutAmount": 6509.808587691413, "events": [{ "date": 1765847356886, "amount": 9803.258736869453, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 860.8333685250136, "consumedAmount": 5506.790821722998 }
Successfull response:
{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 8400.429970678468, "batchSnBestBefore": 5999, "accountName": "accountName", "articleId": "articleId", "priceListId": 8937, "purchasePrice": 4216.231728486926, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 4822, "checkoutDate": 3933, "price": 2562.580195751271, "comment": "comment", "id": 9720, "projectId": 9422, "checkoutAmount": 3071.268110694101, "events": [{ "date": 1765847356886, "amount": 5076.578832744864, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 216.07606423113324, "consumedAmount": 8230.695648192175 }
Update project
PUTUrl: /{id}
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Update an existing project
Body:
{ "createdByName": "createdByName", "cost": 4023.3957251399866, "created": 1895, "description": "description", "customerName": "customerName", "stockValue": 890.0015220106261, "name": "name", "customerId": 3953, "state": "0", "projectId": 3480, "responsibleUserId": 2241, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 1751.0412280635624, "batchSnBestBefore": 5010, "accountName": "accountName", "articleId": "articleId", "priceListId": 4706, "purchasePrice": 1706.1113976441122, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 547, "checkoutDate": 8948, "price": 4167.205848841298, "comment": "comment", "id": 3791, "projectId": 3789, "checkoutAmount": 5273.557989198942, "events": [{ "date": 1765847356886, "amount": 5985.47146403981, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 4012.2793201991403, "consumedAmount": 2566.0112269703095 }], "createdById": 5296, "responsibleUserName": "responsibleUserName" }
Successfull response:
{ "createdByName": "createdByName", "cost": 1724.115482976065, "created": 2123, "description": "description", "customerName": "customerName", "stockValue": 8067.485515063611, "name": "name", "customerId": 533, "state": "0", "projectId": 3450, "responsibleUserId": 1737, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2920.144783596588, "batchSnBestBefore": 8230, "accountName": "accountName", "articleId": "articleId", "priceListId": 5968, "purchasePrice": 29.881524370736212, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 714, "checkoutDate": 4909, "price": 3918.284485475092, "comment": "comment", "id": 5717, "projectId": 3158, "checkoutAmount": 9498.286088039615, "events": [{ "date": 1765847356886, "amount": 6528.995309867623, "type": "type" }], "checkinConsumeDate": 1765847356886, "checkinAmount": 6469.304964747024, "consumedAmount": 3060.067487627394 }], "createdById": 1167, "responsibleUserName": "responsibleUserName" }
Update project article
PUTUrl: /{id}/article/{article_id}
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Update an existing project article
Body:
{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5530.92943733899, "batchSnBestBefore": 2453, "accountName": "accountName", "articleId": "articleId", "priceListId": 8254, "purchasePrice": 8145.031083634238, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 1032, "checkoutDate": 6720, "price": 2223.0433937726034, "comment": "comment", "id": 5972, "projectId": 422, "checkoutAmount": 6143.986409518695, "events": [{ "date": 1765847356887, "amount": 9736.046447265226, "type": "type" }], "checkinConsumeDate": 1765847356887, "checkinAmount": 8493.86464261633, "consumedAmount": 430.8250316096407 }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 4716.043347305466, "articleName": "articleName", "pricelistId": 3312, "endDate": 1765847356887, "rentalAmount": 7968.76689520026, "created": 1765847356887, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 918, "price": 8384.501955448928, "isProcessed": true, "dataArticleId": 5964, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 6267, "startDate": 1765847356887, "createdById": 784 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 8769.592485937223, "batchSnBestBefore": 1581, "accountName": "accountName", "articleId": "articleId", "priceListId": 596, "purchasePrice": 3836.091552599824, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 9385, "checkoutDate": 3769, "price": 1037.8260655364159, "comment": "comment", "id": 7244, "projectId": 9240, "checkoutAmount": 2889.906586103966, "events": [{ "date": 1765847356887, "amount": 5672.827446272963, "type": "type" }], "checkinConsumeDate": 1765847356887, "checkinAmount": 3487.146618822081, "consumedAmount": 3004.538482953918 }] }
Create invoice drafts
PUTUrl: /{id}/invoice/draft
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Create invoice drafts for articles in a project
Body:
{ "projectId": 8518, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5409.646441714279, "batchSnBestBefore": 1572, "accountName": "accountName", "articleId": "articleId", "priceListId": 6902, "purchasePrice": 8553.285273306543, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 7058, "checkoutDate": 6434, "price": 7167.416483942672, "comment": "comment", "id": 1935, "projectId": 581, "checkoutAmount": 81.09615698855488, "events": [{ "date": 1765847356887, "amount": 951.1737703104761, "type": "type" }], "checkinConsumeDate": 1765847356887, "checkinAmount": 3714.774029612493, "consumedAmount": 7373.729419353721 }] }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 6518.107668963332, "articleName": "articleName", "pricelistId": 8844, "endDate": 1765847356887, "rentalAmount": 2792.5141218395834, "created": 1765847356887, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 5148, "price": 5523.761477344255, "isProcessed": true, "dataArticleId": 8804, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 6531, "startDate": 1765847356887, "createdById": 5593 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 3073.3007913296706, "batchSnBestBefore": 8328, "accountName": "accountName", "articleId": "articleId", "priceListId": 1024, "purchasePrice": 6916.390028726046, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 8296, "checkoutDate": 4619, "price": 7269.813112785616, "comment": "comment", "id": 4030, "projectId": 9016, "checkoutAmount": 1918.7001742868736, "events": [{ "date": 1765847356887, "amount": 8724.429814580712, "type": "type" }], "checkinConsumeDate": 1765847356887, "checkinAmount": 4378.141312177838, "consumedAmount": 3921.4452663571565 }] }
Send invoice drafts to external integrations
PUTUrl: /{id}/invoice
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Send existing invoice drafts to external integrations and sets the draft to invoiced
Body:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 2826.841026816076, "articleName": "articleName", "pricelistId": 2983, "endDate": 1765847356888, "rentalAmount": 7884.488141454088, "created": 1765847356888, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 1609, "price": 2350.942541723268, "isProcessed": false, "dataArticleId": 6768, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 248, "startDate": 1765847356888, "createdById": 315 }], "freeTexts": [{}], "customerId": 9465, "type": "type", "projectId": 651 }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 3344.079308467528, "articleName": "articleName", "pricelistId": 517, "endDate": 1765847356888, "rentalAmount": 3775.495284147715, "created": 1765847356888, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 6918, "price": 5244.515754869614, "isProcessed": false, "dataArticleId": 8576, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 8809, "startDate": 1765847356888, "createdById": 9759 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 8434.342651357007, "batchSnBestBefore": 5730, "accountName": "accountName", "articleId": "articleId", "priceListId": 7582, "purchasePrice": 6118.903991788203, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 1496, "checkoutDate": 563, "price": 6448.22777718899, "comment": "comment", "id": 2360, "projectId": 1913, "checkoutAmount": 8586.672525989445, "events": [{ "date": 1765847356888, "amount": 7400.206951587135, "type": "type" }], "checkinConsumeDate": 1765847356888, "checkinAmount": 6104.659261258205, "consumedAmount": 2624.7465545321234 }] }
Close project
PUTUrl: /{id}/close
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Close an existing project
Body:
{"closeArticles": {}}
Successfull response:
{ "createdByName": "createdByName", "cost": 8357.563236838852, "created": 9707, "description": "description", "customerName": "customerName", "stockValue": 9072.987860410512, "name": "name", "customerId": 4558, "state": "0", "projectId": 903, "responsibleUserId": 4002, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 231.27063339935972, "batchSnBestBefore": 9737, "accountName": "accountName", "articleId": "articleId", "priceListId": 8027, "purchasePrice": 8441.156122985754, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 6425, "checkoutDate": 6489, "price": 1235.6776653518775, "comment": "comment", "id": 274, "projectId": 1941, "checkoutAmount": 5501.793111652831, "events": [{ "date": 1765847356888, "amount": 5327.469759410503, "type": "type" }], "checkinConsumeDate": 1765847356888, "checkinAmount": 1079.9571157287025, "consumedAmount": 92.40818917128135 }], "createdById": 2281, "responsibleUserName": "responsibleUserName" }
Classes:
CloseProjectRequestDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| closeArticles | HashMap | Map containing articles that should be handled when closing a project. Key in map is project-article id and value is from enum set | Value in map can be either checkin, consume, end_rent | R,W |
InvoiceDraftDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| id | long | R | |||||
| dataType | String | R | |||||
| dataId | Long | R | |||||
| dataArticleId | Long | R | |||||
| articleId | String | R | |||||
| articleName | String | R | |||||
| amount | Double | R | |||||
| price | Double | R | |||||
| pricelistId | long | R | |||||
| currency | String | R | |||||
| rentalCurrency | String | R | |||||
| startDate | Date | R | |||||
| endDate | Date | R | |||||
| rentalAmount | Double | R | |||||
| comment | String | R | |||||
| isInvoiced | boolean | Indicates if row has been marked as invoiced | R | ||||
| isProcessed | boolean | Indicates if row has been completely processed as invoiced | R | ||||
| invoiceId | String | If row has been invoiced, this is id of the created invoice | R | ||||
| createdById | Long | R | |||||
| createdByName | String | R | |||||
| created | Date | R |
InvoiceDraftProjectArticlesRequestDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| projectId | long | R | |||||
| articles | List | R |
InvoiceProjectArticlesRequestDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| projectId | long | R | |||||
| customerId | Long | R | |||||
| type | String | invoice, cash, card, ag | R | ||||
| invoiceDrafts | List | R | |||||
| freeTexts | List | R,W |
InvoiceProjectArticlesResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| articles | List | R | |||||
| invoiceDrafts | List | R |
ProjectArticleDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| id | long | R,W | |||||
| projectId | long | R,W | |||||
| articleId | String | R,W | |||||
| articleName | String | R,W | |||||
| batchId | String | R,W | |||||
| snId | String | R,W | |||||
| batchSnBestBefore | Long | R,W | |||||
| checkoutAmount | Double | R,W | |||||
| checkinAmount | Double | R,W | |||||
| consumedAmount | Double | R,W | |||||
| invoicedAmount | Double | R,W | |||||
| priceListId | long | R,W | |||||
| rental | boolean | R,W | |||||
| price | double | R,W | |||||
| rentalCurrency | String | R,W | |||||
| comment | String | R,W | |||||
| purchasePrice | Double | R,W | |||||
| events | List | R,W | |||||
| accountId | long | R,W | |||||
| accountName | String | R,W | |||||
| checkoutDate | Long | R,W | |||||
| checkinConsumeDate | Date | R,W |
ProjectArticleEventDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| type | String | R,W | |||||
| amount | double | R,W | |||||
| date | Date | R,W |
ProjectArticlesResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| page | int | R | |||||
| pages | int | R | |||||
| pageSize | int | R | |||||
| projectsCount | int | R | |||||
| articles | List | R |
ProjectCustomerOrderRequestDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| projectId | Long | A new project will be created if the id is null or -1 | R,W |
ProjectDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| projectId | long | R | |||||
| name | String | R,W | |||||
| customerId | Long | R,W | |||||
| customerName | String | R,W | |||||
| description | String | R,W | |||||
| state | Integer | Write only with POST | 0 | NEW = 0, DEVELOPING = 1, FINISHED = 2, CANCELLED = 3 |
R,W | ||
| responsibleUserId | Long | R,W | |||||
| responsibleUserName | String | R,W | |||||
| createdById | Long | R,W | |||||
| createdByName | String | R,W | |||||
| created | long | R,W | |||||
| articles | List | R,W | |||||
| cost | Double | R,W | |||||
| stockValue | Double | R,W |
ProjectInvoiceDraftsResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| page | int | R | |||||
| pages | int | R | |||||
| pageSize | int | R | |||||
| draftsCount | int | R | |||||
| invoiceDrafts | List | R |
ProjectsResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| page | int | R | |||||
| pages | int | R | |||||
| pageSize | int | R | |||||
| projectsCount | int | R | |||||
| projects | List | R |