Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.55 KB

README.md

File metadata and controls

63 lines (46 loc) · 2.55 KB

Orders

(orders)

Overview

The orders endpoints.

Available Operations

create_order

Create an order for a drink.

Example Usage

from speakeasy_bar_py import BarPython
from speakeasy_bar_py.models import components

with BarPython(
    security=components.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as s:
    res = s.orders.create_order(request_body=[
        {
            "type": components.OrderType.DRINK,
            "product_code": "APM-1F2D3",
            "quantity": 837978,
        },
        {
            "type": components.OrderType.DRINK,
            "product_code": "AC-A2DF3",
            "quantity": 589796,
        },
    ])

    if res.order is not None:
        # handle response
        pass

Parameters

Parameter Type Required Description
request_body List[components.OrderInput] ✔️ N/A
callback_url Optional[str] The url to call when the order is updated.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateOrderResponse

Errors

Error Type Status Code Content Type
errors.APIError 5XX application/json
errors.SDKError 4XX */*