(orders)
The orders endpoints.
- create_order - Create an order.
Create an order for a drink.
from speakeasy_bar_py import BarPython
from speakeasy_bar_py.models import components
s = BarPython(
security=components.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.orders.create_order(request_body=[
{
"type": components.OrderType.DRINK,
"product_code": "NAC-3F2D1",
"quantity": 837978,
},
{
"type": components.OrderType.DRINK,
"product_code": "NAC-3F2D1",
"quantity": 589796,
},
])
if res.order is not None:
# handle response
pass
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. |
operations.CreateOrderResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 5XX | application/json |
errors.SDKError | 4XX | */* |