# Crawler Import Service #### Description This service is used to simplify importing data to ATOLLON. In ATOLLON, it's possible to add more complex business logic based on request type and it's parameters. External developers are let go of understanding ATOLLON's blackbox. #### Request `POST https:///crab/crawler/?instance=` ## Contact Create contact (person or company) with (optionally) contact folder identified by context category (FPATypeCategory). ##### Request POST `https:///crab/crawler/contact?instance=` Data in JSON format: ```JSON { "person": { "firstName": "", "lastName": "", "prefixTitle": "", "postfixTitle": "", "companyPersonRelation": [{ "companyExternalId": [{ "system": "", "id": "" }], "positionDesc": "", "companyName": "", "departmentName": "" }] }, "company": { "companyName": "", "companyCompanyRelation": [{ "companyExternalId": [{ "system": "", "id": "" }], "relationType": "" }] }, "address": [{ "street": "", "city": "", "zip": "", "region": "", "country": "", "addressType": "
" }, { "street": "", "city": "", "zip": "", "region": "", "country": "", "addressType": "
" } ], "contacts": { "email": [{ "contact": "", "contactInfoTypeName": "" }, { "contact": "", "contactInfoTypeName": "" }], "phone": [{ "contact": "", "contactInfoTypeName": "" }, { "contact": "", "contactInfoTypeName": "" }], "mobile": [{ "contact": "", "contactInfoTypeName": "" }, { "contact": "", "contactInfoTypeName": "" }], "web": [{ "contact": "", "contactInfoTypeName": "" }, { "contact": "", "contactInfoTypeName": "" }] }, "description": "", "contactGroup": [{ "name": "", "description": "" }, { "name": "", "description": "" }], "contactFolder": [{ "category": "", "refId": "", "parentFolder": { "category": "", "refId": "", "contactExternalId": [{ "system": "", "id": "" }] }, "responsibleUser": [{ "userName": "", "userRoleName": "", "primary": true }] }], "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "regNo": "", "vatNo": "", "trackingCode": "", "source": "", "industries": [{ "name": "", "description": "" }] } ``` ##### Response on SUCESS - contactId - folderId - contact.externalId #### Function progress - Person is filled? => contact is "**Person contact**" (and the person is representative of the company), otherwise it's "**Company contact**" (either company or person surname is required) ##### Company contact - Check whether company is existing (company name matches some record in DB) // see: [https://help.atollon.com/books/backend-development/page/modcontact#bkmrk-%C2%A0](https://help.atollon.com/books/backend-development/page/modcontact#bkmrk-%C2%A0) - If company does not exist, create new contact (company) - Contact info and address is stored with company contact - With company contact id, check whether contact has the **desired contact folder.** Desired contact folder is folder with FPATypeCategory (see list below)c. If the lead folder does not exist, it is created. - If contactFolderCategory is not filled-in, the contact folder is not created. - contactGroup - find the contact group with the same name. If the contact group does not exist, create it. Assign the contact to the group ##### Person contact - Check whether person is existing (based on e-mail, mobile / if these are not filled-in, the person is created anyway). E-mail and mobile is stored with person contact - Contact info and address is stored with person contact - With person contact id, check whether contact has the **desired contact folder.** Desired contact folder is folder with FPATypeCategory of the client, lead, supplier, partner, etc. folder types. If the lead folder does not exist, it is created. - If contactFolderCategory is not filled-in, the contact folder is not created. - contactGroup - find the contact group with the same name. If the contact group does not exist, create it. Assign the contact to the group - employer - if company oldId is found in companyPersonRelation, make binding, otherwise if companyName is filled-in in companyPersonRelation, company based on it's name or create new company contact and create binding After the request is imported successfully, change the TIF status to "2". ##### Creating contact folder (client, supplier, etc.) Contact folders is main building block in contact relations (ATOLLON's context). Some useful context categories for contact folders used:
Clientcom.atollon.project.fpatypecategory.client
Suppliercom.atollon.project.fpatypecategory.supplier
Lead (potential client)com.atollon.leads.fpatypecategory.lead
Partnercom.atollon.project.fpatypecategory.partner
##### ExternalId Please note that within Contact service, the system + externalId must be unique key. ## Product `https:///crab/crawler/product?instance=` POST data in JSON format: ```JSON { "name": "", "refId": "", "description": "", "typeName": "", "defaultQuantity": 1.0000, "unitPrice": 4990.00, "unitPriceCurrencyName": "", "statusName": "", "unitsName": "", "vatRateName": "<15 %, 21%, etc.>", "openingBalanceQty": 0.0000, "openingBalanceDate": "<2022-09-09T10:10>" // datetime is default, if not provided, "externalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] } ``` ##### Response on SUCCESS - productId - productName - productRefid - product.externalId ##### Function progress - Find product based on it's externalId OR code + product name, if this does not match, create product - If existing product is found, values are updated, ie openingBalanceQty ### Billing > > To export service activities that include billing items, get the following resource: ##### Request GET `https:///crab/crawler/billing?billingStatus=ToBeInvoiced&instance=` ##### Response ```JSON [{ "activity": { "id": "0123000", "name": "", "refId": "", "statusName": "", "description": "", "created": "<2022-09-01T00:00>", "modified": "<2022-09-14T10:00>" }, "project": { "id": "", "name": "", "refId": "", "statusName": "", "description": "", "created": "<2022-09-01T00:00>", "modified": "<2022-09-14T10:00>" }, "folder": { "name": "", "refId": "" }, "contact": { "person": { "firstName": "", "lastName": "" }, "company": { "companyName": "" }, "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "regNo": "", "vatNo": "" }, "customer": { "name": "", "refId": "" }, "customerContact": { "person": { "firstName": "", "lastName": "" }, "company": { "companyName": "" }, "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "regNo": "", "vatNo": "" }, "billingItems": [{ "id": "123456", "productName": "", "productRefid": "", "name": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "currency": "", "billingDate": "<2022-09-14T10:00>", "billingStatus": "ToBeInvoiced", "billingType": 1, "productExternalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] }, { "id": "123457", "productName": "", "productRefid": "", "name": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "currency": "", "billingDate": "<2022-09-14T10:00>", "billingStatus": "ToBeInvoiced", "billingType": 2, "productExternalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] }], "documents": [{ "name": "", "id": "123" }, { "name": "", "id": "456" }] }] ``` #### Download documents GET `https:///crab/crawler/download_document?docId=123123&instance=` You get file in response. #### Update billing status of billing items Run after you have processed the billing items from activity. You can change status of each of the billing items. If billing items are marked as Invoiced, you can change either activity or project status. Activity status will be changed only if there are no remaining billing items to be invoiced. ##### Request PUT `https:///crab/crawler/billing?instance=` DATA: ```JSON [{ "activity": { "id": "0123000", "statusName": "" }, "project": { "id": "", "statusName": "" }, "billingItems": [{ "id": "123456", "billingStatus": "Billed" }, { "id": "123457", "billingStatus": "Cancelled" }] }] ``` Billing states:
0
SalesItems
1
Pending
2
ForApproval
3
ToBeInvoiced
4
Billed
5
ApprovedByClient
6
Postponed
7
Cancelled
Billing types:
1
BillingItems
2
TimeSheetItems
## Folder ##### Request GET `https:///crab/crawler/folder_sample?instance=&id=` ##### Response ``` { "folder": { "refId": "", "name": "", "typeName": " Klient, ...", }, "contact": { "externalId": [ { "system": "test", "id": "123" } ], "company": { "name": "ABC studio 2 s.r.o.", "regNumber": "", "VATNumber": "" } "form": { "": "", "": "" } } ``` ##### Request Create new folder: POST `https:///crab/crawler/folder?instance=` ``` { "folder": { "refId": "", "name": "", "typeName": " Klient, ...", }, "contact": { "externalId": [ { "system": "test", "id": "123" } ], "company": { "name": "ABC studio 2 s.r.o.", "regNumber": "", "VATNumber": "" } "form": { "": "", "": "" } } ``` ## Project ##### Request GET `https:///crab/crawler/project?instance=&id=` GET `https:///crab/crawler/project?instance=&externalSystem=&externalId=` ##### Response ``` { "project": { "aclh": "TREE000000216556", "created": "2023-01-25T12:47:34.678428", "createdByName": "admin@pioneer", "customState": 132541101, "defaultMessageContainer": 723389101, "defaultMessageContainerPath": "Root > pioneer > Pioneer CRM Demo > ABC studio 2 s.r.o. > project test 1 > Activity > Unsorted", "defaultMessageGroup": 723388101, "folder": 673304101, "folderName": "ABC studio 2 s.r.o.", "folderTypeName": "Klient", "formValues": 723392101, "id": 723387101, "isMasterProject": true, "modified": "2023-01-25T14:42:04.329141", "name": "project test 1", "projectType": 149482101, "provider": 132307101, "providerName": "Pioneer CRM Demo", "refId": "00005 - SUPPORT", "state": 2, "priority": 1.0, "externalId": [ { "externalSystem": "test", "externalId": "project_test_1" } ] }, "contact": { "person": { "firstName": "", "lastName": "" }, "company": { "companyName": "" }, "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] } } ``` ##### Request Create new project and add technology items: POST `https:///crab/crawler/project?instance=` ``` { "project": { "id": "", "name": "", "refId": "", "statusName": "", "description": "", "created": "<2022-09-01T00:00>", "modified": "<2022-09-14T10:00>", "category": "anyProjectCategory", "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "dimension1Name": "", "dimension2Name": "", "dimension3Name": "", "customer": { "contactExternalId": [{ "system": "", "id": "" }], "contextCategory": "anyFolderCategory" } }, "folder": { "name": "", "refId": "", "category": "anyFolderCategory" }, "contact": { "person": { "firstName": "", "lastName": "" }, "company": { "companyName": "" }, "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "regNo": "", "vatNo": "" }, "technologyItems": [{ "id": "123456", "productName": "", "productRefid": "", "name": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "currency": "", "billingDate": "<2022-09-14T10:00>", "refId":"", "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "supplier": { "contactExternalId": [{ "system": "test", "id": "123" }] } }, { "id": "123457", "productName": "", "productRefid": "", "name": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "currency": "", "billingDate": "<2022-09-14T10:00>", "refId":"", "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] }], "formValues": [{ "fieldIdent": "", "fieldValue": "" }, { "fieldIdent": "", "fieldValue": 22 }, { "fieldIdent": "", "fieldValue": "<2023-05-23T00:00:00>" }] } ``` #### Internal Procedure - Based on given contact external id, find existing contact, if no contact is found, say ERR - Based on folder.category, find whether folder for given contact is found, if not, create new contact folder - Create new project into given category - Load new technologyItems into the new project (technology items are projectItems with type = 3) ##### Request Update project status: PUT `https:///crab/crawler/project?instance=` ```JSON { "project": { "id": "", "name": "", "refId": "", "statusName": "", "description": "", "created": "<2022-09-01T00:00>", "modified": "<2022-09-14T10:00>", "category": "anyProjectCategory", "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }], "dimension1Name": "", "dimension2Name": "", "dimension3Name": "", "customer": { "contactExternalId": [{ "system": "", "id": "" }], "contextCategory": "anyFolderCategory" } }, "technologyItems": [], "formValues": [] } ``` ## Activity ### GetActivity ##### Request GET `https:///crab/crawler/activity?instance=&id=` Optional url param `billingStatus` for activity including billing items ##### Response ``` { "acl": "TREE000000228302", "aclh": "TREE000000228302", "activityType": 449312101, "activityTypeName": "Pravideln\\u00fd servis", "created": "2023-08-01T16:53:14.198186", "createdByName": "admin@pioneer", "customState": 132412101, "defaultMessageContainer": 773533101, "defaultMessageContainerPath": "ABC DESIGN Branch > Servisn\\u00ed projekt > Activity > Pravideln\\u00fd servis", "defaultMessageGroup": 773226101, "folder": 773157101, "folderName": "ABC DESIGN Branch", "folderTypeName": "Company Branch", "customer": { "contactExternalId": [ { "system": "", "id": "" } ] }, "supplier": { "contactExternalId": [ { "system": "", "id": "" } ] }, "formId": 449320101, "formName": "Service Activity", "formValues": 773535101, "id": 773533101, "modified": "2023-08-01T17:30:14.828457", "modifiedByName": "admin@pioneer", "name": "Pravideln\\u00fd servis", "project": 773225101, "projectName": "Servisn\\u00ed projekt", 'projectExternalId': [ { "system": "", "id": "" } ], "refId": "0348", "state": 1, "requestHash": "NULL", "startDate": "2024-09-01T00:00:00.000000", "finalDate": "2026-01-31T00:00:00.000000", "dimension1Name": "China", "dimension2Name": "Mobile", "dimension3Name": "Internal", "EXTERNAL_CONTACTS": { "count": 0, "EXTERNAL_CONTACT": [] } "documents": [{ "name": "", "id": "123" }, { "name": "", "id": "456" }] } ``` ### ListActivity ##### Request GET `https:///crab/crawler/activity?instance=&category=&createdFrom=&statusName="Initial"&dimension1Name="Organization Unit A"` ##### Response ```JSON [ { "id": 773460101, "name": "Pravideln\u00fd servis", "type": 449312101, "typeName": "Pravideln\u00fd servis", "state": 3, "customState": 132416101, "customStateName": "Closed", "created": "2023-08-01T15:55:56.385675", "createdBy": 131750101, "createdByName": "admin@pioneer", "modified": "2023-08-01T16:53:11.718562", "modifiedBy": 131750101, "modifiedByName": "admin@pioneer", "organization": 130946101, "folder": 773157101, "folderName": "ABC DESIGN Branch", "folderParentId": 700827101, "folderParentName": "ABC DESIGN", "project": 773225101, "projectName": "Servisn\u00ed projekt", "refId": "0347", "requestHash": "NULL", "defaultMessageContainer": 773460101, "defaultMessageGroup": 773226101, "formId": 449320101, "formValues": 773462101, "startDate": "2023-04-01T00:00:00.000000", "finalDate": "2024-08-31T00:00:00.000000", "dimension1Name":"China", "dimension2Name":"Mobile", "dimension3Name":"Internal", }, { "id": 773533101, "name": "Pravideln\u00fd servis", "type": 449312101, "typeName": "Pravideln\u00fd servis", "state": 1, "customState": 132412101, "customStateName": "Initial", "created": "2023-08-01T16:53:14.198186", "createdBy": 131750101, "createdByName": "admin@pioneer", "modified": "2023-08-01T17:30:14.828457", "modifiedBy": 131750101, "modifiedByName": "admin@pioneer", "organization": 130946101, "folder": 773157101, "folderName": "ABC DESIGN Branch", "folderParentId": 700827101, "folderParentName": "ABC DESIGN", "project": 773225101, "projectName": "Servisn\u00ed projekt", "refId": "0348", "requestHash": "NULL", "defaultMessageContainer": 773533101, "defaultMessageGroup": 773226101, "formId": 449320101, "formValues": 773535101, "startDate": "2024-09-01T00:00:00.000000", "finalDate": "2026-01-31T00:00:00.000000", "dimension1Name":"China", "dimension2Name":"Mobile", "dimension3Name":"Internal", } ] ``` ### CreateActivity ##### Request POST `https:///crab/crawler/activity?instance=` ```json { "activity": { "name": "Pravidelný servis", "refId": "0348", "category": "", "typeName": "Pravidelný servis", "statusName": "In Progress", "requestHash": "NULL", "startDate": "2024-09-01T00:00:00.000000", "finalDate": "2026-01-31T00:00:00.000000" }, "project": { "id": "", "name": "", "refId": "", "typeName": "", "externalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] }, "servicedItems": [ { "productName": "", "productRefid": "", "name": "", "refId": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "vatValue": 21.0, "currency": "", "billingDate": "<2022-09-14T10:00>", "productExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] }, { "productName": "", "productRefid": "", "name": "", "refId": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "vatValue": 21.0, "currency": "", "billingDate": "<2022-09-14T10:00>", "productExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] } ], "formValues": {} } ``` ### UpdateActivity ##### Request PUT `https:///crab/crawler/activity?instance=` ``` { "activity": { "id": "", "name": "Pravideln\u00fd servis", "refId": "0348", "statusName": "In Progress", "requestHash": "NULL", "startDate": "2024-09-01T00:00:00.000000", "finalDate": "2026-01-31T00:00:00.000000", "EXTERNAL_CONTACTS": { "count": 0, "EXTERNAL_CONTACT": [] } }, "billingItems": [{ "id": "123456", "productName": "", "productRefid": "", "name": "", "refId": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "vatValue": 21.0, "currency": "", "billingDate": "<2022-09-14T10:00>", "billingStatus": "ToBeInvoiced", "productExternalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] }, { "id": "123457", "productName": "", "productRefid": "", "name": "", "refId": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "vatValue": 21.0, "currency": "", "billingDate": "<2022-09-14T10:00>", "billingStatus": "ToBeInvoiced", "productExternalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] }], "servicedItems": [ { "productName": "", "productRefid": "", "name": "", "refId": "", "description": "", "quantity": 1.0000, "unitPrice": 1000.00, "vatValue": 21.0, "currency": "", "billingDate": "<2022-09-14T10:00>", "productExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] } ] } ``` ## Tracking code ##### Request POST `https:///crab/crawler/tracking_code?instance=` ```JSON { "code": "ABC", "userName": "<-- username@workspace -->", "trackingCodeTypeName": "<-- Dealer -->", "contactFolder": { "id": "", "name": "", "refId": "", "category": "anyFolderCategory", "contact": { "person": { "firstName": "", "lastName": "" }, "company": { "companyName": "" }, "externalId": [{ "system": "", "id": "" }, { "system": "", "id": "" }] } } } ``` ##### Internal process The service calls service for creating tracking code. The aim is to file new trackingCode with type "Dealer" or "Partner" with rerefence to folderId having contact's externalId previously entered by **contact** service. ## Sales Order and Invoice Received ### Get Sales Order ##### Request GET `https:///crab/crawler/order-received?instance=&id=` ##### Response ```json { "created": "2024-04-26T00:00:00", "createdBy": 131841101, "createdByName": "admin@cime", "externalNumber": null, "externalReferenceNumber": null, "id": 133683101, "internalDescription": null, "invoiceNumber": "232410001", "issuedDate": "2024-04-26", "journal": "132877101", "journalName": "Sales Order", "journalTreeHandle": null, "modified": "2024-04-26T00:00:00", "modifiedBy": 131841101, "modifiedByName": "admin@cime", "state": 132606101, "stateName": "Schv\u00e1leno", "taxationDate": "2024-04-26", "treeHandle": 131252101, "dateTransaction": "26.04.2024", "customId": null, "supplier": { "provider": 132419101, "providerCity": null, "providerCountry": null, "providerName": "CIME, s.r.o.", "providerRegion": null, "providerStreet": null, "providerZIP": null, "userId": 131841101, "userName": "admin@cime", "providerExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] }, "customer": { "customer": 133349101, "customerCity": null, "customerContact": 133634101, "customerContactName": "Nov\u00e1k Jind\u0159ich", "customerCountry": null, "customerName": "AGRO s.r.o.", "customerRegId": "0", "customerRegion": null, "customerStreet": null, "customerVATId": "0", "customerZIP": null, "customerExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "contactExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] }, "shipTo": { "shipTo": null, "shipToCity": null, "shipToCountry": null, "shipToCustomer": true, "shipToName": null, "shipToRegion": null, "shipToStreet": null, "shipToZIP": null, "shipToExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] }, "rows": [ { "account": 132855101, "accountCode": "602000", "accountName": "Sales", "created": "2024-04-26T00:00:00", "createdBy": 131841101, "createdByName": "admin@cime", "customId": null, "transactionDate": "26.04.2024", "description": "Nejv\u00edc vychytan\u00fd popis \nk traktoru Lindner Geotrac.", "childKey": null, "id": 133685101, "modified": "2024-04-26T00:00:00", "modifiedBy": 131841101, "modifiedByName": "admin@cime", "parent": null, "parentId": null, "parentKey": null, "recordId": null, "treeHandle": 131244101, "userId": 131841101, "userName": "admin@cime", "voucher": null, "orderIndex": 0, "value": { "netTotal": 650000, "currency": "CZK", "unitPrice": 650000, "unitQuantity": 1, "VAT": "DPH 21%", "VATPercent": 21, "VATValue": 136500 }, "product": { "catalogPrice": 800000, "item": 133445101, "itemName": "Lindner Geotrac", "itemcat": null, "itemcat_name": null, "itemDescription": "1. Lindner Geotrac", "itemSerial": null, "productExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ] }, "attributes": { "attrib0": null, "attrib0_id": null, "attrib1": null, "attrib1_id": null, "attrib2": null, "attrib2_id": null, "attrib3": null, "attrib3_id": null, "attrib4": null, "attrib4_id": null, "attrib5": null, "attrib5_id": null, "attrib6": null, "attrib6_id": null, "attrib7": null, "attrib7_id": null, "attrib8": null, "attrib8_id": null, "attrib9": null, "attrib9_id": null }, "context": { "folder": 133349101, "folderName": "AGRO s.r.o.", "folderContactExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "project": 133621101, "projectName": "Prodej Merlo Turbofarmer", "projectExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "activity": null, "activityExternalId": [] # NOT SUPPORTED }, "trackingCategories": { "dimension1": null, "dimension1Name": null, "dimension2": null, "dimension2Name": null, "dimension3": null, "dimension3Name": null }, "SHARES": [ { "id": 133708101, "recordId": null, "share": null, "userId": 131841101, "userName": "admin@cime", "folder": 133349101, "folderContactExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "project": 133621101, "projectExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "activity": null, "activityExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "isRemaining": 1, "units": 1, "shareUnits": 0, "percentage": 100, "total": 650000, "dimension1": null, "dimension2": null, "dimension3": null, "dimension1Name": null, "dimension2Name": null, "dimension3Name": null } ] } ], "totals": { "currency": "CZK", "currencyRate": 1, "total": 786500, "totalWithVAT": 786500 }, "payment": { "bankAccount": null, "bankCode": null, "bankIBAN": null, "bankBic": null, "bankNoteDomestic": null, "bankNoteForeign": null, "constantSymbol": null, "dueDate": "10.05.2024", "overdue": null, "paidSync": 0, "paidManual": 0, "paymentMethod": null, "paymentMethodName": null, "paymentReference": null, "paymentStatus": 8, "toBePaid": 786500, "toBePaidDate": "01.01.1", "valueRestraint": null, "valueAuthorized": null }, "customFields": { "field0": null, "field0Id": null, "field0Txt": null, "field1": null, "field1Id": null, "field1Txt": null, "field2": null, "field2Id": null, "field2Txt": null, "field3": null, "field3Id": null, "field3Txt": null, "field4": null, "field4Id": null, "field4Txt": null, "field5": null, "field5Id": null, "field5Txt": null, "field6": null, "field6Id": null, "field6Txt": null, "field7": null, "field7Id": null, "field7Txt": null, "field8": null, "field8Id": null, "field8Txt": null, "field9": null, "field9Id": null, "field9Txt": null }, "context": { "folder": 133349101, "folderName": "AGRO s.r.o.", "folderRefId": "UF1", "folderContactExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "project": 133621101, "projectName": "Prodej Merlo Turbofarmer", "projectRefId": null, "projectExternalId": [ { "system": "", "id": "" }, { "system": "", "id": "" } ], "activity": null, "activityName": null, "activityRefId": null, "activityExternalId": [] # NOT SUPPORTED }, "documents": [], "texts": { "description": null, "headerText": null, "footerText": null, "summaryText": null, "periodFrom": "2024-04-26", "periodTo": null }, "trackingCategories": { "dimension1": null, "dimension1Name": null, "dimension2": null, "dimension2Name": null, "dimension3": null, "dimension3Name": null } } ``` ### Create Invoice ##### Request // Structure is the same as Sales Order example above POST `https:///crab/crawler/invoice-issued?instance=` ### Update Invoice ##### Request // Structure is the same as Sales Order example above PUT `https:///crab/crawler/invoice-issued?instance=&id=` ### List Invoice Status Service for listing invoice states. ##### Request GET `https:///crab/crawler/invoice_status?instance=` ##### Success Response ```json [     {       "stateId": "89342000",       "name": "Issued",       "priority": 99,       "enabled": 3,       "acl": "INVS000000002410",       "treeHandle": "60430000"     },     {       "stateId": "89342001",       "name": "Pending",       "priority": 50,       "enabled": 12,       "acl": "INVS000000002411",       "treeHandle": "60430001"     },     {       "stateId": "89342002",       "name": "Paid",       "priority": 10,       "enabled": 1,       "acl": "INVS000000002412",       "treeHandle": "60430002"     } ] ``` ##### Error Response ```json { "result": "FAIL", "message": "" } ```