Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ customer = client.customers.create(
email="[email protected]",
name="My Customer",
)
print(customer.id)
```

While you can provide an `api_key` keyword argument,
Expand All @@ -44,6 +45,7 @@ so that your API Key is not stored in source control.
Simply import `AsyncOrb` instead of `Orb` and use `await` with each API call:

```python
import asyncio
from orb import AsyncOrb

client = AsyncOrb(
Expand All @@ -52,12 +54,12 @@ client = AsyncOrb(
)


async def main():
async def main() -> None:
customer = await client.customers.create(
email="[email protected]",
name="My Customer",
)
print(customer)
print(customer.id)


asyncio.run(main())
Expand Down Expand Up @@ -145,7 +147,7 @@ from orb import Orb

client = Orb()

client.customers.create(
customer = client.customers.create(
email="[email protected]",
name="My Customer",
billing_address={
Expand All @@ -154,6 +156,7 @@ client.customers.create(
"line1": "123 Example Street",
},
)
print(customer.id)
```

## Handling errors
Expand Down Expand Up @@ -287,10 +290,9 @@ from orb import Orb

client = Orb()
response = client.customers.with_raw_response.create(
email="string",
name="string",
email="[email protected]",
name="My Customer",
)

print(response.headers.get('X-My-Header'))

customer = response.parse() # get the object that `customers.create()` would have returned
Expand Down