Skip to content
Merged
Prev Previous commit
Next Next commit
update README.md
  • Loading branch information
axshani committed Sep 12, 2022
commit 236220243f232dd385c9842e887cfc4871d8af28
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,27 @@ Fetching a customer
```python
import os
from unit import Unit
from unit.models.customer import *

token = os.environ.get("token")
api_url = os.environ.get("api_url")

unit = Unit(api_url, token)
customer = unit.customers.list().data[0]
print(customer.id)
```

## Retry
You can read about retries here: https://docs.unit.co/#retries.

the default amount of retries is 0.

Unit initialization with retries:
```python
import os
from unit import Unit

token = os.environ.get("token")
api_url = os.environ.get("api_url")

unit = Unit(api_url, token, retries=3)
```