-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (33 loc) · 1.04 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from dotenv import dotenv_values
import json
from icountapi import iCountAPI
# flake8: noqa
if __name__ == "__main__":
icountConfig: dict = dotenv_values(".env")
with iCountAPI(
company=icountConfig.get("COMPANY"),
username=icountConfig.get("USERNAME"),
password=icountConfig.get("PASSWORD"),
) as session:
res = session.supplier_list()
print(res)
icountDoc = {
"doctype": "invrec",
"client_id": "323455555",
"email": "",
"client_name": "clientnameexample2",
"items": [
{"description": "descr", "unitprice_incvat": "100", "quantity": "1"},
{},
],
"cc": {
"sum": 100,
"card_type": "VISA",
"card_number": "0000",
"holder_id": "123456789",
"holder_name": "Israel Israeli",
"confirmation_code": "875646",
},
}
res = session.create_doc(icountDoc)
print(res)