Projects API
Projects API provides methods for handling projects and checkout for articles
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 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": 1163, "projects": [{ "createdByName": "createdByName", "cost": 8061.03841687276, "created": 2344, "description": "description", "customerName": "customerName", "stockValue": 8079.923779890655, "name": "name", "customerId": 15, "state": "0", "projectId": 4637, "responsibleUserId": 7307, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5439.364511864526, "batchSnBestBefore": 8021, "accountName": "accountName", "articleId": "articleId", "priceListId": 5483, "purchasePrice": 6407.929826883922, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 3827, "checkoutDate": 8028, "price": 5488.344009362595, "comment": "comment", "id": 3617, "projectId": 1399, "checkoutAmount": 3342.1987533384868, "events": [{ "date": 1774890083706, "amount": 8628.851056305515, "type": "type" }], "checkinConsumeDate": 1774890083706, "checkinAmount": 7859.457364097651, "consumedAmount": 9023.3784035971 }], "createdById": 9405, "responsibleUserName": "responsibleUserName" }], "pageSize": 6159, "page": 6318, "projectsCount": 8730 }
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": 3431, "projects": [{ "createdByName": "createdByName", "cost": 4203.9558598771955, "created": 3205, "description": "description", "customerName": "customerName", "stockValue": 7420.917672934436, "name": "name", "customerId": 661, "state": "0", "projectId": 4390, "responsibleUserId": 9249, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 1013.7015801264537, "batchSnBestBefore": 7241, "accountName": "accountName", "articleId": "articleId", "priceListId": 5413, "purchasePrice": 6321.516623926171, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 1099, "checkoutDate": 6417, "price": 9259.870660677916, "comment": "comment", "id": 6063, "projectId": 751, "checkoutAmount": 479.42642976382285, "events": [{ "date": 1774890083711, "amount": 8644.92305178834, "type": "type" }], "checkinConsumeDate": 1774890083711, "checkinAmount": 7143.8253939017595, "consumedAmount": 4960.950324876701 }], "createdById": 6810, "responsibleUserName": "responsibleUserName" }], "pageSize": 3520, "page": 367, "projectsCount": 4027 }
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": 1643.3546719602289, "articleName": "articleName", "pricelistId": 560, "endDate": 1774890083713, "rentalAmount": 7627.433117727232, "created": 1774890083713, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 5566, "price": 986.1023651643375, "isProcessed": false, "dataArticleId": 55, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 7366, "startDate": 1774890083713, "createdById": 6932 }], "pages": 1973, "pageSize": 1840, "draftsCount": 2471, "page": 216 }
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": 2600.258899910127, "created": 5089, "description": "description", "customerName": "customerName", "stockValue": 2403.2516324582843, "name": "name", "customerId": 1192, "state": "0", "projectId": 6640, "responsibleUserId": 9880, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2666.6196060379443, "batchSnBestBefore": 598, "accountName": "accountName", "articleId": "articleId", "priceListId": 8656, "purchasePrice": 3535.7173841856124, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 2382, "checkoutDate": 6237, "price": 9111.24887446479, "comment": "comment", "id": 2196, "projectId": 4951, "checkoutAmount": 5216.50380940372, "events": [{ "date": 1774890083714, "amount": 2347.302653823209, "type": "type" }], "checkinConsumeDate": 1774890083714, "checkinAmount": 5022.565029221219, "consumedAmount": 1458.8203614586137 }], "createdById": 847, "responsibleUserName": "responsibleUserName" }
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": 523, "pageSize": 9007, "page": 7518, "projectsCount": 6649, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 6280.35181105178, "batchSnBestBefore": 603, "accountName": "accountName", "articleId": "articleId", "priceListId": 3952, "purchasePrice": 3981.1104301544665, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 1151, "checkoutDate": 7766, "price": 5970.822824977518, "comment": "comment", "id": 1910, "projectId": 4790, "checkoutAmount": 368.50216823795745, "events": [{ "date": 1774890083715, "amount": 5625.819490367502, "type": "type" }], "checkinConsumeDate": 1774890083715, "checkinAmount": 6976.203952851797, "consumedAmount": 8781.590664575615 }] }
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": 57.88534055727435, "articleName": "articleName", "pricelistId": 9615, "endDate": 1774890083717, "rentalAmount": 7099.311611754144, "created": 1774890083717, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 5637, "price": 3995.6594243096124, "isProcessed": true, "dataArticleId": 162, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 4696, "startDate": 1774890083717, "createdById": 3930 }], "pages": 7162, "pageSize": 1409, "draftsCount": 6185, "page": 5361 }
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": 3466.9696515388005, "created": 3211, "description": "description", "customerName": "customerName", "stockValue": 9367.283484074003, "name": "name", "customerId": 8817, "state": "0", "responsibleUserId": 4948, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 7669.580892146109, "batchSnBestBefore": 6757, "accountName": "accountName", "articleId": "articleId", "priceListId": 5125, "purchasePrice": 4750.725822089525, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 1199, "checkoutDate": 4312, "price": 3501.146194419894, "comment": "comment", "id": 7756, "projectId": 7791, "checkoutAmount": 641.9444590010037, "events": [{ "date": 1774890083718, "amount": 6954.481327580678, "type": "type" }], "checkinConsumeDate": 1774890083718, "checkinAmount": 7398.7849015068205, "consumedAmount": 3212.2701578370993 }], "createdById": 6643, "responsibleUserName": "responsibleUserName" }
Successfull response:
{ "createdByName": "createdByName", "cost": 7541.635740290704, "created": 443, "description": "description", "customerName": "customerName", "stockValue": 8234.107949977248, "name": "name", "customerId": 8324, "state": "0", "projectId": 7750, "responsibleUserId": 1931, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5150.380544356071, "batchSnBestBefore": 1993, "accountName": "accountName", "articleId": "articleId", "priceListId": 4678, "purchasePrice": 1260.6770987401428, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 6800, "checkoutDate": 1209, "price": 702.4720770119308, "comment": "comment", "id": 4189, "projectId": 744, "checkoutAmount": 6187.4250083678935, "events": [{ "date": 1774890083720, "amount": 8222.972994643973, "type": "type" }], "checkinConsumeDate": 1774890083720, "checkinAmount": 835.1298220178471, "consumedAmount": 3104.4917349175107 }], "createdById": 985, "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": 5144}
Successfull response:
{ "createdByName": "createdByName", "cost": 7972.50181068706, "created": 5291, "description": "description", "customerName": "customerName", "stockValue": 2352.4505701693056, "name": "name", "customerId": 6499, "state": "0", "projectId": 1326, "responsibleUserId": 9995, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5368.811568009135, "batchSnBestBefore": 9697, "accountName": "accountName", "articleId": "articleId", "priceListId": 9605, "purchasePrice": 5330.24973707796, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 4732, "checkoutDate": 261, "price": 183.4319475319235, "comment": "comment", "id": 2374, "projectId": 5868, "checkoutAmount": 2519.872510288038, "events": [{ "date": 1774890083722, "amount": 1309.7026118699685, "type": "type" }], "checkinConsumeDate": 1774890083722, "checkinAmount": 2004.1173532757361, "consumedAmount": 8546.354247469451 }], "createdById": 9329, "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": 6245.674502657342, "batchSnBestBefore": 4457, "accountName": "accountName", "articleId": "articleId", "priceListId": 4997, "purchasePrice": 7340.7761044059225, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 8601, "checkoutDate": 1009, "price": 770.8512942657852, "comment": "comment", "id": 5693, "projectId": 4927, "checkoutAmount": 6844.147356578675, "events": [{ "date": 1774890083723, "amount": 7414.5778571587425, "type": "type" }], "checkinConsumeDate": 1774890083723, "checkinAmount": 7088.913965045172, "consumedAmount": 3177.9637611253406 }
Successfull response:
{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2759.724988716258, "batchSnBestBefore": 7422, "accountName": "accountName", "articleId": "articleId", "priceListId": 9247, "purchasePrice": 7329.688382380407, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 3700, "checkoutDate": 9138, "price": 2631.0187326998857, "comment": "comment", "id": 7388, "projectId": 5674, "checkoutAmount": 2670.9056016613963, "events": [{ "date": 1774890083723, "amount": 417.18075546366526, "type": "type" }], "checkinConsumeDate": 1774890083723, "checkinAmount": 2610.5302181776815, "consumedAmount": 4225.320672638758 }
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": 6810.852874945656, "created": 4387, "description": "description", "customerName": "customerName", "stockValue": 9415.010676169419, "name": "name", "customerId": 6179, "state": "0", "projectId": 7821, "responsibleUserId": 2297, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 288.3720963861458, "batchSnBestBefore": 6122, "accountName": "accountName", "articleId": "articleId", "priceListId": 2102, "purchasePrice": 8624.042153606484, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 9146, "checkoutDate": 575, "price": 8810.076529466573, "comment": "comment", "id": 6464, "projectId": 1845, "checkoutAmount": 2865.4465469503543, "events": [{ "date": 1774890083724, "amount": 2880.075014966541, "type": "type" }], "checkinConsumeDate": 1774890083724, "checkinAmount": 4182.113532691142, "consumedAmount": 4437.435500173047 }], "createdById": 6202, "responsibleUserName": "responsibleUserName" }
Successfull response:
{ "createdByName": "createdByName", "cost": 239.68789059746533, "created": 8368, "description": "description", "customerName": "customerName", "stockValue": 7859.254169706069, "name": "name", "customerId": 5018, "state": "0", "projectId": 9909, "responsibleUserId": 7601, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 3973.7623682180856, "batchSnBestBefore": 1921, "accountName": "accountName", "articleId": "articleId", "priceListId": 9782, "purchasePrice": 47.75034626148145, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 4498, "checkoutDate": 9448, "price": 2850.462388913173, "comment": "comment", "id": 6345, "projectId": 9122, "checkoutAmount": 7562.948973121415, "events": [{ "date": 1774890083724, "amount": 1318.8200036968833, "type": "type" }], "checkinConsumeDate": 1774890083724, "checkinAmount": 1239.666003191201, "consumedAmount": 7435.882649418491 }], "createdById": 9186, "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": 929.6960513215869, "batchSnBestBefore": 6707, "accountName": "accountName", "articleId": "articleId", "priceListId": 4051, "purchasePrice": 9487.997629237874, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 4364, "checkoutDate": 4693, "price": 5846.789190760531, "comment": "comment", "id": 2325, "projectId": 5151, "checkoutAmount": 1550.8867645649748, "events": [{ "date": 1774890083726, "amount": 5980.307995382682, "type": "type" }], "checkinConsumeDate": 1774890083726, "checkinAmount": 1377.4071832929103, "consumedAmount": 5257.960345294159 }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 1765.2629684625776, "articleName": "articleName", "pricelistId": 835, "endDate": 1774890083726, "rentalAmount": 7155.955127307505, "created": 1774890083726, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 4553, "price": 4761.148596290746, "isProcessed": true, "dataArticleId": 6444, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 5454, "startDate": 1774890083726, "createdById": 2821 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 9426.92812741946, "batchSnBestBefore": 2492, "accountName": "accountName", "articleId": "articleId", "priceListId": 5500, "purchasePrice": 6937.794421478267, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 4766, "checkoutDate": 7207, "price": 1145.1045216023315, "comment": "comment", "id": 3557, "projectId": 2110, "checkoutAmount": 6422.983175074416, "events": [{ "date": 1774890083726, "amount": 5370.321396905168, "type": "type" }], "checkinConsumeDate": 1774890083726, "checkinAmount": 4907.130111546264, "consumedAmount": 3351.709655561784 }] }
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": 6219, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 8784.930041447526, "batchSnBestBefore": 4068, "accountName": "accountName", "articleId": "articleId", "priceListId": 216, "purchasePrice": 9630.926308004377, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 7259, "checkoutDate": 9605, "price": 495.2524360672661, "comment": "comment", "id": 3161, "projectId": 7520, "checkoutAmount": 7138.354167237352, "events": [{ "date": 1774890083728, "amount": 4657.161434557944, "type": "type" }], "checkinConsumeDate": 1774890083728, "checkinAmount": 1184.123366690626, "consumedAmount": 8265.73327735927 }] }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 8323.701618834119, "articleName": "articleName", "pricelistId": 3836, "endDate": 1774890083729, "rentalAmount": 7299.2107904127115, "created": 1774890083729, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 8126, "price": 696.4415165788429, "isProcessed": false, "dataArticleId": 2107, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 881, "startDate": 1774890083729, "createdById": 1707 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 591.1030274904061, "batchSnBestBefore": 2315, "accountName": "accountName", "articleId": "articleId", "priceListId": 8708, "purchasePrice": 2757.2029469757385, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 1544, "checkoutDate": 7294, "price": 2901.662772951975, "comment": "comment", "id": 7563, "projectId": 5279, "checkoutAmount": 7541.98773293704, "events": [{ "date": 1774890083729, "amount": 4252.79168399462, "type": "type" }], "checkinConsumeDate": 1774890083729, "checkinAmount": 860.2206589324701, "consumedAmount": 9705.359948526531 }] }
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": 6470.478340830306, "articleName": "articleName", "pricelistId": 5802, "endDate": 1774890083730, "rentalAmount": 4129.81752750836, "created": 1774890083730, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 2633, "price": 1437.6843352098424, "isProcessed": true, "dataArticleId": 2622, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 1891, "startDate": 1774890083730, "createdById": 4679 }], "freeTexts": [{}], "customerId": 5435, "type": "type", "projectId": 5110 }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 9709.749996368848, "articleName": "articleName", "pricelistId": 6745, "endDate": 1774890083730, "rentalAmount": 4072.123578549275, "created": 1774890083730, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 1663, "price": 8041.743478687431, "isProcessed": true, "dataArticleId": 8803, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 9155, "startDate": 1774890083730, "createdById": 6675 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 7862.4624229729425, "batchSnBestBefore": 2228, "accountName": "accountName", "articleId": "articleId", "priceListId": 7229, "purchasePrice": 4974.588334132932, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 1788, "checkoutDate": 9647, "price": 7667.211570766953, "comment": "comment", "id": 2095, "projectId": 3385, "checkoutAmount": 7661.626709486211, "events": [{ "date": 1774890083730, "amount": 4194.676082116465, "type": "type" }], "checkinConsumeDate": 1774890083730, "checkinAmount": 4404.033723493526, "consumedAmount": 6321.482271812439 }] }
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": 5778.520191192249, "created": 5809, "description": "description", "customerName": "customerName", "stockValue": 3499.7367186992947, "name": "name", "customerId": 7739, "state": "0", "projectId": 1580, "responsibleUserId": 8147, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 6070.630498798887, "batchSnBestBefore": 3174, "accountName": "accountName", "articleId": "articleId", "priceListId": 6378, "purchasePrice": 2800.8100781513845, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 1931, "checkoutDate": 8275, "price": 7647.897907391962, "comment": "comment", "id": 5422, "projectId": 6106, "checkoutAmount": 1676.402528095189, "events": [{ "date": 1774890083731, "amount": 5766.432356086999, "type": "type" }], "checkinConsumeDate": 1774890083731, "checkinAmount": 2480.408887492235, "consumedAmount": 5236.3390849783 }], "createdById": 53, "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 |