Preliminary description of integration with BAS via HTTP
BAS Accounting Configuration: Business automation software for accounting, edition 2.1 (2.1.31.1)
## 1. Outgoing request from the CRM system Bitrix → BAS (during invoice issuance)
During the issuance of an invoice to the client and its sending, we trigger the integration with one request and transfer data to BAS.
This request includes a complete package of information, including:
(Bitrix ID is transmitted and recorded in separate fields)
- Counterparty (client) //if it already exists, we check by guid 1c or (if not transmitted): "Individual" - TIN; "Legal entity" - EDRPOU) (determine which mandatory fields must be transmitted)
- Bank details of the counterparty //if it already exists, we check by guid 1c or by IBAN//(determine which mandatory fields must be transmitted)
- Contract of the counterparty /if it already exists, we check by guid 1c or by CONTRACT NUMBER//(determine which mandatory fields must be transmitted)
- link to the annex to the contract/invoice, invoice (multiple) (new text field)
- Invoice //invoice fields// (determine which mandatory fields must be transmitted)
- link to the annex to the contract/invoice (new text field)
- CMR international waybill number /or waybill in Ukraine number (new text field)
- link to the waybill to the invoice (new text field)
Invoice body - name(s) (guid 1c) and content(s) of services
Also, for all attached/related documents in the data we send to BAS, internal IDs from Bitrix are transmitted.
## 2. Processing logic on the BAS side
After receiving the request, BAS checks for the presence of the required entities and:
- creates missing data if they do not exist yet, in order to correctly issue the invoice in BAS;
- in the case of duplicates, BAS processes them independently (deduplication logic is on the BAS side).
## 3. Response from BAS → our system (after successful creation)
After successfully creating/updating data in BAS, BAS returns its internal IDs of created/related objects (for further synchronization and linking).
## 4. Reverse events from BAS → our system (upon receipt of funds)
From BAS back to our system, only cash receipt orders (fact of money receipt) are sent to our endpoint.
In this webhook / callback, 1C transmits:
- amount
- currency
- date of receipt
- ID of the CRM invoice for which the payment is recorded
The invoice ID is known to us, as it is taken from the data we previously transmitted to BAS (and/or from the internal IDs received in the response).
## update of the counterparty (and other directories) from (and to) the CRM system is planned for the future