Skip to content

Commit c0de56b

Browse files
committed
Add other API functions to README
1 parent 301521e commit c0de56b

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,73 @@ picnic = PicnicAPI(username='username', password='password', country_code="NL")
2828

2929
The country_code parameter defaults to `NL`, but you have to change it if you live in a different country than the Netherlands (ISO 3166-1 Alpha-2). This obviously only works for countries that picnic services.
3030

31-
## Searching for a product
31+
## Searching for an article
3232

3333
```python
3434
picnic.search('coffee')
3535
```
3636

3737
```python
3838
[{'items': [{'id': 's1019822', 'name': 'Lavazza Caffè Crema e Aroma Bohnen', 'decorators': [], 'display_price': 1799, 'image_id': 'aecbf7d3b018025ec78daf5a1099b6842a860a2e3faeceec777c13d708ce442c', 'max_count': 99, 'unit_quantity': '1kg', 'sole_article_id': None}, ... ]}]
39+
```
40+
41+
## Get article by ID
42+
43+
```python
44+
picnic.get_article("s1019822")
45+
```
46+
```python
47+
{'name': 'Lavazza Caffè Crema e Aroma Bohnen', 'id': 's1019822'}
48+
```
49+
50+
## Get article by GTIN (EAN)
51+
```python
52+
picnic.get_article_by_gtin("8000070025400")
53+
```
54+
```python
55+
{'name': 'Lavazza Caffè Crema e Aroma Bohnen', 'id': 's1019822'}
56+
```
57+
58+
## Check cart
59+
60+
```python
61+
picnic.get_cart()
62+
```
63+
64+
```python
65+
{'type': 'ORDER', 'id': 'shopping_cart', 'items': [{'type': 'ORDER_LINE', 'id': '1470', 'items': [{'type': 'ORDER_ARTICLE', 'id': 's1019822', 'name': 'Lavazza Caffè Crema e Aroma Bohnen',...
66+
```
67+
68+
## Manipulating your cart
69+
All of these methods will return the shopping cart.
70+
71+
```python
72+
# Add product with ID "s1019822" 2x
73+
picnic.add_product("s1019822", 2)
74+
75+
# Remove product with ID "s1019822" 1x
76+
picnic.remove_product("s1019822")
77+
78+
# Clear your cart
79+
picnic.clear_cart()
80+
```
81+
82+
## See upcoming deliveries
83+
84+
```python
85+
picnic.get_current_deliveries()
86+
```
87+
88+
```python
89+
[{'delivery_id': 'XXYYZZ', 'creation_time': '2025-04-28T08:08:41.666+02:00', 'slot': {'slot_id': 'XXYYZZ', 'hub_id': '...
90+
```
91+
92+
## See available delivery slots
93+
94+
```python
95+
picnic.get_delivery_slots()
96+
```
97+
98+
```python
99+
{'delivery_slots': [{'slot_id': 'XXYYZZ', 'hub_id': 'YYY', 'fc_id': 'FCX', 'window_start': '2025-04-29T17:15:00.000+02:00', 'window_end': '2025-04-29T19:15:00.000+02:00'...
39100
```

0 commit comments

Comments
 (0)