Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 918 Bytes

File metadata and controls

41 lines (29 loc) · 918 Bytes
# Synchronous Example
from flexprice_py import Flexprice


with Flexprice(
    "https://api.example.com",
    api_key_auth="<YOUR_API_KEY_HERE>",
) as flexprice:

    res = flexprice.addons.create_addon(lookup_key="<value>", name="<value>", type_="multiple_instance")

    # Handle response
    print(res)

The same SDK client can also be used to make asynchronous requests by importing asyncio.

# Asynchronous Example
import asyncio
from flexprice_py import Flexprice

async def main():

    async with Flexprice(
        "https://api.example.com",
        api_key_auth="<YOUR_API_KEY_HERE>",
    ) as flexprice:

        res = await flexprice.addons.create_addon_async(lookup_key="<value>", name="<value>", type_="multiple_instance")

        # Handle response
        print(res)

asyncio.run(main())