[31588f42] feat: implement SuperOffice Sales API prototype and fix auth docs

This commit is contained in:
2026-02-28 18:06:12 +00:00
parent 670b901248
commit 4ea4b3b193
3 changed files with 214 additions and 0 deletions

View File

@@ -273,6 +273,29 @@ python3 connector-superoffice/create_email_test.py 193036
* `POST /Document`: Creates the email body and metadata.
* `POST /Appointment`: Creates the activity record linked to the document.
### 17. Sales & Opportunities Implementation (Feb 28, 2026)
We have successfully prototyped the creation of "Sales" (Opportunities) via the API. This allows the AI to not only enrich contacts but also create tangible pipeline objects for sales representatives.
**Prototype Script:** `connector-superoffice/create_sale_test.py`
**Key Findings:**
1. **Authentication:** Must use `load_dotenv(override=True)` to ensure production credentials are used (see GEMINI.md).
2. **Required Fields for `POST /Sale`:**
* `Heading`: The title of the opportunity.
* `Amount` & `Currency`: Use `Currency: { "Id": 33 }` (for EUR) instead of string "EUR".
* `SaleType`: `{ "Id": 1 }` (General Sale / Allgemeiner Verkauf).
* `Stage`: `{ "Id": 10 }` (5% Prospect / Angebot prospektiv).
* `Source`: `{ "Id": 2 }` (Proposal Center/Lead Source).
* `Contact`: `{ "ContactId": 123 }`.
* `Person`: `{ "PersonId": 456 }` (Optional but recommended).
**Usage:**
```bash
python3 connector-superoffice/create_sale_test.py
```
This script finds the first available contact in the CRM and creates a test opportunity for them.
---
This is the core logic used to generate the company-specific opener.