Skip to content

Commit 869b408

Browse files
committed
Update README to use config object in examples
1 parent 9730024 commit 869b408

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

README.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ How-to-use (By example)
2121
--------
2222

2323
The code is documented and there are no different endpoints with this API so there are no so many methods.
24-
25-
1) Create the `Invoice` object
24+
1) Create the `config` object
25+
```python
26+
config = InvoiceClientConfig(api_key="YOUR_API_KEY_HERE")
2627
```
28+
29+
2) Create the `Invoice` object
30+
```python
2731
invoice = InvoiceGenerator(
32+
config=config,
2833
sender="Invoiced, Inc.",
2934
to="Parag",
3035
logo="https://invoiced.com/img/logo-invoice.png",
@@ -34,8 +39,8 @@ invoice = InvoiceGenerator(
3439
)
3540
```
3641

37-
2) Add one or several items to it
38-
```
42+
3) Add one or several items to it
43+
```python
3944
invoice.add_item(
4045
name="Starter plan",
4146
quantity=1,
@@ -48,13 +53,13 @@ invoice.add_item(
4853
)
4954
```
5055

51-
3) You can basically customise the object after hand (useful if you have to process things after generating the invoice but before actually sending it, perhaps for some async tasks...)
52-
```
56+
4) You can basically customise the object after hand (useful if you have to process things after generating the invoice but before actually sending it, perhaps for some async tasks...)
57+
```python
5358
invoice.toggle_subtotal(shipping=True)
5459
```
5560

56-
4) Finally download the file (this will actually call the API). It can be absolute or relative path.
57-
```
61+
5) Finally download the file (this will actually call the API). It can be absolute or relative path.
62+
```python
5863
invoice.download("my-awesome-invoice.pdf")
5964
```
6065

0 commit comments

Comments
 (0)