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 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": 5358.1184081180245, "articleName": "articleName", "pricelistId": 6002, "endDate": 1772868762666, "rentalAmount": 829.05018287875, "created": 1772868762666, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 9755, "price": 4486.604839481625, "isProcessed": true, "dataArticleId": 5622, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 6555, "startDate": 1772868762666, "createdById": 865 }], "pages": 1858, "pageSize": 9920, "draftsCount": 6679, "page": 2487 }
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": 2518.354223296647, "created": 1386, "description": "description", "customerName": "customerName", "stockValue": 4922.500976133743, "name": "name", "customerId": 1068, "state": "0", "projectId": 6568, "responsibleUserId": 9840, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 499.5168625788604, "batchSnBestBefore": 5040, "accountName": "accountName", "articleId": "articleId", "priceListId": 7171, "purchasePrice": 2667.4829486100084, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 5747, "checkoutDate": 839, "price": 5955.329143801698, "comment": "comment", "id": 726, "projectId": 3425, "checkoutAmount": 4864.56571714486, "events": [{ "date": 1772868762667, "amount": 3042.409884320868, "type": "type" }], "checkinConsumeDate": 1772868762667, "checkinAmount": 65.6338230234299, "consumedAmount": 4372.963755711068 }], "createdById": 8714, "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": 1884, "projects": [{ "createdByName": "createdByName", "cost": 9881.822859892714, "created": 8182, "description": "description", "customerName": "customerName", "stockValue": 7040.439054045801, "name": "name", "customerId": 4541, "state": "0", "projectId": 4240, "responsibleUserId": 1308, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 4102.418889990251, "batchSnBestBefore": 3577, "accountName": "accountName", "articleId": "articleId", "priceListId": 4956, "purchasePrice": 4195.406087492308, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 5431, "checkoutDate": 7235, "price": 1712.068320666521, "comment": "comment", "id": 4001, "projectId": 676, "checkoutAmount": 7610.21779677997, "events": [{ "date": 1772868762667, "amount": 8067.405976592899, "type": "type" }], "checkinConsumeDate": 1772868762667, "checkinAmount": 5848.212003682077, "consumedAmount": 8582.936384636701 }], "createdById": 9156, "responsibleUserName": "responsibleUserName" }], "pageSize": 7973, "page": 8333, "projectsCount": 7977 }
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": 418, "projects": [{ "createdByName": "createdByName", "cost": 4534.308729615854, "created": 1776, "description": "description", "customerName": "customerName", "stockValue": 3418.202865739843, "name": "name", "customerId": 7175, "state": "0", "projectId": 554, "responsibleUserId": 4401, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 9389.772674007285, "batchSnBestBefore": 8630, "accountName": "accountName", "articleId": "articleId", "priceListId": 2550, "purchasePrice": 3411.346744181859, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 1111, "checkoutDate": 5496, "price": 7585.751040022709, "comment": "comment", "id": 3064, "projectId": 9655, "checkoutAmount": 3214.020111210656, "events": [{ "date": 1772868762668, "amount": 3475.8113243866683, "type": "type" }], "checkinConsumeDate": 1772868762668, "checkinAmount": 7141.968266519497, "consumedAmount": 4884.055396899911 }], "createdById": 6933, "responsibleUserName": "responsibleUserName" }], "pageSize": 3947, "page": 7021, "projectsCount": 8685 }
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": 6697, "pageSize": 3166, "page": 2005, "projectsCount": 3806, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 4481.529335493903, "batchSnBestBefore": 5191, "accountName": "accountName", "articleId": "articleId", "priceListId": 2732, "purchasePrice": 200.40813887971188, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 9517, "checkoutDate": 6803, "price": 951.0391524898675, "comment": "comment", "id": 447, "projectId": 10, "checkoutAmount": 6295.7031011144445, "events": [{ "date": 1772868762668, "amount": 7533.7948825611165, "type": "type" }], "checkinConsumeDate": 1772868762668, "checkinAmount": 6155.866196364853, "consumedAmount": 3582.877292613431 }] }
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": 812.8147523362084, "articleName": "articleName", "pricelistId": 7071, "endDate": 1772868762669, "rentalAmount": 4054.779038988996, "created": 1772868762669, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 7259, "price": 2641.43491404761, "isProcessed": true, "dataArticleId": 4634, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 7960, "startDate": 1772868762669, "createdById": 1029 }], "pages": 8645, "pageSize": 2199, "draftsCount": 9167, "page": 3759 }
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": 3996.564131176261, "created": 7221, "description": "description", "customerName": "customerName", "stockValue": 1361.0178661020566, "name": "name", "customerId": 8737, "state": "0", "responsibleUserId": 2163, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5426.480566884248, "batchSnBestBefore": 2672, "accountName": "accountName", "articleId": "articleId", "priceListId": 6154, "purchasePrice": 2163.111517966898, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 4442, "checkoutDate": 881, "price": 8410.118919859135, "comment": "comment", "id": 7720, "projectId": 6954, "checkoutAmount": 5862.52906730408, "events": [{ "date": 1772868762669, "amount": 5232.7040209659535, "type": "type" }], "checkinConsumeDate": 1772868762669, "checkinAmount": 8373.339130796083, "consumedAmount": 3193.274472788814 }], "createdById": 8486, "responsibleUserName": "responsibleUserName" }
Successfull response:
{ "createdByName": "createdByName", "cost": 4575.718779929848, "created": 18, "description": "description", "customerName": "customerName", "stockValue": 854.4907956018777, "name": "name", "customerId": 1179, "state": "0", "projectId": 1815, "responsibleUserId": 1369, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5408.539928636239, "batchSnBestBefore": 5096, "accountName": "accountName", "articleId": "articleId", "priceListId": 5840, "purchasePrice": 6277.8568462462035, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 258, "checkoutDate": 1462, "price": 4551.902045528043, "comment": "comment", "id": 1078, "projectId": 9846, "checkoutAmount": 4805.811727054381, "events": [{ "date": 1772868762669, "amount": 7558.18574051694, "type": "type" }], "checkinConsumeDate": 1772868762669, "checkinAmount": 7490.08358290013, "consumedAmount": 1104.5728282571542 }], "createdById": 78, "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": 3787}
Successfull response:
{ "createdByName": "createdByName", "cost": 982.5764364852351, "created": 6250, "description": "description", "customerName": "customerName", "stockValue": 6353.87589367723, "name": "name", "customerId": 8269, "state": "0", "projectId": 4017, "responsibleUserId": 9139, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 498.3800083458045, "batchSnBestBefore": 6990, "accountName": "accountName", "articleId": "articleId", "priceListId": 1720, "purchasePrice": 8257.614678852493, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 7359, "checkoutDate": 5209, "price": 5459.774822957702, "comment": "comment", "id": 5778, "projectId": 7691, "checkoutAmount": 2499.6894772077794, "events": [{ "date": 1772868762669, "amount": 2734.245789932105, "type": "type" }], "checkinConsumeDate": 1772868762669, "checkinAmount": 3375.847361498352, "consumedAmount": 9646.607591167074 }], "createdById": 6128, "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": 8258.902519400515, "batchSnBestBefore": 7819, "accountName": "accountName", "articleId": "articleId", "priceListId": 967, "purchasePrice": 8842.269067784971, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 8681, "checkoutDate": 141, "price": 2175.79009680135, "comment": "comment", "id": 5048, "projectId": 4742, "checkoutAmount": 5197.105750538322, "events": [{ "date": 1772868762670, "amount": 1991.909032001552, "type": "type" }], "checkinConsumeDate": 1772868762670, "checkinAmount": 9810.911530042997, "consumedAmount": 7322.979342734159 }
Successfull response:
{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 9811.030879812972, "batchSnBestBefore": 7449, "accountName": "accountName", "articleId": "articleId", "priceListId": 1870, "purchasePrice": 3091.6109905762155, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 3231, "checkoutDate": 7453, "price": 4464.481846745354, "comment": "comment", "id": 5737, "projectId": 888, "checkoutAmount": 4488.956773989035, "events": [{ "date": 1772868762670, "amount": 4401.89572388626, "type": "type" }], "checkinConsumeDate": 1772868762670, "checkinAmount": 4708.842659695999, "consumedAmount": 3379.21768652534 }
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": 7597.015970284961, "created": 4278, "description": "description", "customerName": "customerName", "stockValue": 951.1338859633256, "name": "name", "customerId": 8877, "state": "0", "projectId": 4755, "responsibleUserId": 2473, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 2991.586963815227, "batchSnBestBefore": 5972, "accountName": "accountName", "articleId": "articleId", "priceListId": 7734, "purchasePrice": 1857.40439466763, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 392, "checkoutDate": 412, "price": 9509.335633978377, "comment": "comment", "id": 3246, "projectId": 492, "checkoutAmount": 2753.945373655569, "events": [{ "date": 1772868762670, "amount": 5135.536251832742, "type": "type" }], "checkinConsumeDate": 1772868762670, "checkinAmount": 3675.7029336380156, "consumedAmount": 9224.10347313357 }], "createdById": 4657, "responsibleUserName": "responsibleUserName" }
Successfull response:
{ "createdByName": "createdByName", "cost": 6498.782685219228, "created": 3866, "description": "description", "customerName": "customerName", "stockValue": 5514.914628946341, "name": "name", "customerId": 1413, "state": "0", "projectId": 557, "responsibleUserId": 6353, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 1500.624691248057, "batchSnBestBefore": 6962, "accountName": "accountName", "articleId": "articleId", "priceListId": 1001, "purchasePrice": 4563.866145077022, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 7758, "checkoutDate": 5054, "price": 4774.073202241489, "comment": "comment", "id": 3262, "projectId": 9624, "checkoutAmount": 7769.867416960715, "events": [{ "date": 1772868762670, "amount": 6902.618223594012, "type": "type" }], "checkinConsumeDate": 1772868762670, "checkinAmount": 9346.060026681984, "consumedAmount": 6379.190185904086 }], "createdById": 3002, "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": 2002.1075060935534, "batchSnBestBefore": 6039, "accountName": "accountName", "articleId": "articleId", "priceListId": 9712, "purchasePrice": 6959.849491077573, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 8117, "checkoutDate": 3908, "price": 1583.0960435448794, "comment": "comment", "id": 4999, "projectId": 9205, "checkoutAmount": 4119.782241706838, "events": [{ "date": 1772868762670, "amount": 9744.69831345984, "type": "type" }], "checkinConsumeDate": 1772868762670, "checkinAmount": 2318.565400298659, "consumedAmount": 928.4448021837843 }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 9416.365529188506, "articleName": "articleName", "pricelistId": 1119, "endDate": 1772868762670, "rentalAmount": 2554.109436619315, "created": 1772868762670, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 6651, "price": 7148.221054048578, "isProcessed": true, "dataArticleId": 1757, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 2287, "startDate": 1772868762670, "createdById": 7857 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 6367.210939939832, "batchSnBestBefore": 4434, "accountName": "accountName", "articleId": "articleId", "priceListId": 8398, "purchasePrice": 1165.9311452026056, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 8305, "checkoutDate": 2886, "price": 669.7916367145418, "comment": "comment", "id": 9113, "projectId": 9412, "checkoutAmount": 5512.781238887956, "events": [{ "date": 1772868762670, "amount": 9134.269773425187, "type": "type" }], "checkinConsumeDate": 1772868762670, "checkinAmount": 5140.116143883279, "consumedAmount": 4724.131932513853 }] }
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": 1266, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 955.2917473595102, "batchSnBestBefore": 4838, "accountName": "accountName", "articleId": "articleId", "priceListId": 7244, "purchasePrice": 4953.740706463291, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 5912, "checkoutDate": 6933, "price": 648.8265345481436, "comment": "comment", "id": 7659, "projectId": 8512, "checkoutAmount": 6174.509910819868, "events": [{ "date": 1772868762671, "amount": 5896.141520434418, "type": "type" }], "checkinConsumeDate": 1772868762671, "checkinAmount": 4150.0843512226475, "consumedAmount": 7796.864125922018 }] }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 6013.558255138361, "articleName": "articleName", "pricelistId": 4434, "endDate": 1772868762671, "rentalAmount": 1736.2262681341178, "created": 1772868762671, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 1108, "price": 4598.294705194211, "isProcessed": true, "dataArticleId": 1670, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 7244, "startDate": 1772868762671, "createdById": 6220 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 6377.988986364134, "batchSnBestBefore": 5680, "accountName": "accountName", "articleId": "articleId", "priceListId": 5069, "purchasePrice": 7572.452105613653, "batchId": "batchId", "rental": true, "rentalCurrency": "rentalCurrency", "accountId": 2551, "checkoutDate": 6328, "price": 3922.261368504749, "comment": "comment", "id": 1689, "projectId": 7425, "checkoutAmount": 3207.241888374861, "events": [{ "date": 1772868762671, "amount": 5595.300493361258, "type": "type" }], "checkinConsumeDate": 1772868762671, "checkinAmount": 3189.5980055677674, "consumedAmount": 5137.930700386172 }] }
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": 786.7388514773799, "articleName": "articleName", "pricelistId": 5514, "endDate": 1772868762671, "rentalAmount": 9005.376915447387, "created": 1772868762671, "dataType": "dataType", "articleId": "articleId", "isInvoiced": true, "rentalCurrency": "rentalCurrency", "dataId": 6909, "price": 9220.29529940278, "isProcessed": true, "dataArticleId": 4003, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 865, "startDate": 1772868762671, "createdById": 6462 }], "freeTexts": [{}], "customerId": 1047, "type": "type", "projectId": 6986 }
Successfull response:
{ "invoiceDrafts": [{ "createdByName": "createdByName", "amount": 4919.289740647308, "articleName": "articleName", "pricelistId": 5280, "endDate": 1772868762671, "rentalAmount": 739.2121726172252, "created": 1772868762671, "dataType": "dataType", "articleId": "articleId", "isInvoiced": false, "rentalCurrency": "rentalCurrency", "dataId": 6454, "price": 6536.989283200407, "isProcessed": false, "dataArticleId": 7122, "currency": "currency", "comment": "comment", "invoiceId": "invoiceId", "id": 5263, "startDate": 1772868762671, "createdById": 5481 }], "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 8231.66981544471, "batchSnBestBefore": 9437, "accountName": "accountName", "articleId": "articleId", "priceListId": 9768, "purchasePrice": 9293.993194905235, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 3295, "checkoutDate": 6413, "price": 7219.499406885779, "comment": "comment", "id": 7256, "projectId": 727, "checkoutAmount": 2485.1135378551126, "events": [{ "date": 1772868762671, "amount": 1390.2455943850832, "type": "type" }], "checkinConsumeDate": 1772868762671, "checkinAmount": 2349.460296509198, "consumedAmount": 929.6329100687739 }] }
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": 5324.802878920527, "created": 5461, "description": "description", "customerName": "customerName", "stockValue": 9602.338626453738, "name": "name", "customerId": 7828, "state": "0", "projectId": 3170, "responsibleUserId": 8025, "articles": [{ "articleName": "articleName", "snId": "snId", "invoicedAmount": 5895.544842013091, "batchSnBestBefore": 4662, "accountName": "accountName", "articleId": "articleId", "priceListId": 710, "purchasePrice": 2243.562703856502, "batchId": "batchId", "rental": false, "rentalCurrency": "rentalCurrency", "accountId": 5321, "checkoutDate": 9397, "price": 8638.066605373706, "comment": "comment", "id": 7771, "projectId": 2856, "checkoutAmount": 862.665031090294, "events": [{ "date": 1772868762671, "amount": 3114.760140373173, "type": "type" }], "checkinConsumeDate": 1772868762671, "checkinAmount": 8073.308594776585, "consumedAmount": 2380.595234682079 }], "createdById": 9861, "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 |